aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/compound-literal01.c
blob: 8a4935ea76e9fb3ee697f6d1d4c5c5c5f3d1663e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
struct bfs {
        int a: 2;
        int b: 30;
};

int foo(void)
{
        struct bfs bf = { .a = 1, .b = 2 };
        return (struct bfs[]){bf}[0].b;
}

int bar(void)
{
        struct bfs bf = { .a = 1, .b = 4 };
        return (struct bfs[]){bf, { .a = 3, .b = 6}}[1].b;
}

/*
 * check-name: compound-literal01.c
 * check-command: test-linearize -Wno-decl $file
 *
 * check-known-to-fail
 * check-output-ignore
 * check-output-contains: ret\\..*\\$2
 * check-output-contains: ret\\..*\\$6
 * check-error-end
 */