diff options
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/expand/default-init-array.c | 16 | ||||
| -rw-r--r-- | validation/expand/default-init-struct.c | 23 |
2 files changed, 39 insertions, 0 deletions
diff --git a/validation/expand/default-init-array.c b/validation/expand/default-init-array.c new file mode 100644 index 00000000..b372ea09 --- /dev/null +++ b/validation/expand/default-init-array.c @@ -0,0 +1,16 @@ +int test_array(int i) +{ + static const int a[3] = { [0] = 1, [2] = 3, }; + + return a[1]; +} + +/* + * check-name: default-init-array + * check-command: test-linearize -Wno-decl -fdump-ir $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: phisrc\\..*return.*\\$0 + * check-output-excludes: load\\. + */ diff --git a/validation/expand/default-init-struct.c b/validation/expand/default-init-struct.c new file mode 100644 index 00000000..c843a1ab --- /dev/null +++ b/validation/expand/default-init-struct.c @@ -0,0 +1,23 @@ +struct s { + int a; + int b; + int c; +}; + + +int test_struct(void) +{ + struct s s = { .a = 1, .c = 3, }; + + return s.b; +} + +/* + * check-name: default-init-struct + * check-command: test-linearize -Wno-decl -fdump-ir $file + * check-known-to-fail + * + * check-output-ignore + * check-output-contains: phisrc\\..*return.*\\$0 + * check-output-excludes: load\\. + */ |
