llvm-project/clang/test/PCH/designated-init.c.h
Aaron Ballman 0dd49a5628 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the eighth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-12 07:25:06 -05:00

65 lines
2.7 KiB
C

static void *FooToken = &FooToken;
static void *FooTable[256] = {
[0x3] = (void *[256]) { // 1
[0x5b] = (void *[256]) { // 2
[0x81] = (void *[256]) { // 3
[0x42] = (void *[256]) { // 4
[0xa2] = (void *[256]) { // 5
[0xe] = (void *[256]) { // 6
[0x20] = (void *[256]) { // 7
[0xd7] = (void *[256]) { // 8
[0x39] = (void *[256]) { // 9
[0xf1] = (void *[256]) { // 10
[0xa4] = (void *[256]) { // 11
[0xa8] = (void *[256]) { // 12
[0x21] = (void *[256]) { // 13
[0x86] = (void *[256]) { // 14
[0x1d] = (void *[256]) { // 15
[0xdc] = (void *[256]) { // 16
[0xa5] = (void *[256]) { // 17
[0xef] = (void *[256]) { // 18
[0x9] = (void *[256]) { // 19
[0x34] = &FooToken,
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
},
}
};
struct P1 {
struct Q1 {
char a[6];
char b[6];
} q;
};
struct P1 l1 = {
(struct Q1){ "foo", "bar" },
.q.b = { "boo" },
.q.b = { [1] = 'x' }
};
extern struct Q1 *foo(void);
static struct P1 test_foo(void) {
struct P1 l = { *foo(),
.q.b = { "boo" },
.q.b = { [1] = 'x' }
};
return l;
}