summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/designated-initializers.c
blob: 466933928665c71dd869ce1d1566b12d7a1e4221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "<{ i8\* null, i32 1024 }>" &&
// RUN: clang-cc -triple i386-unknown-unknown %s -emit-llvm -o - | grep "i32 0, i32 22"

struct foo {
    void *a;
    int b;
};

union { int i; float f; } u = { };

int main(int argc, char **argv)
{
  union { int i; float f; } u2 = { };
    static struct foo foo = {
        .b = 1024,
    };
}

int b[2] = {
    [1] 22
};
OpenPOWER on IntegriCloud