aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/external/c-testsuite/tests/single-exec/00150.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-13 19:21:04 +0100
committerlemon <lsof@mailbox.org>2025-12-13 19:21:04 +0100
commite51ac7ec7d3e32e1771c9f824da3dc7e4dcd2bc5 (patch)
treea0b7a0c29247374b96fdbfb29bc365d15e9e36a5 /test/external/c-testsuite/tests/single-exec/00150.c
parent6c7cdc537b7b341f9ca25a3e8b61de46c99840e7 (diff)
add c-testsuite
Diffstat (limited to 'test/external/c-testsuite/tests/single-exec/00150.c')
-rw-r--r--test/external/c-testsuite/tests/single-exec/00150.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/external/c-testsuite/tests/single-exec/00150.c b/test/external/c-testsuite/tests/single-exec/00150.c
new file mode 100644
index 0000000..1c94454
--- /dev/null
+++ b/test/external/c-testsuite/tests/single-exec/00150.c
@@ -0,0 +1,33 @@
+struct S1 {
+ int a;
+ int b;
+};
+struct S2 {
+ struct S1 s1;
+ struct S1 *ps1;
+ int arr[2];
+};
+struct S1 gs1 = { .a = 1, 2 };
+struct S2 *s = &(struct S2) {
+ {.b = 2, .a = 1},
+ &gs1,
+ {[0] = 1, 1+1}
+};
+
+int
+main()
+{
+ if(s->s1.a != 1)
+ return 1;
+ if(s->s1.b != 2)
+ return 2;
+ if(s->ps1->a != 1)
+ return 3;
+ if(s->ps1->b != 2)
+ return 4;
+ if(s->arr[0] != 1)
+ return 5;
+ if(s->arr[1] != 2)
+ return 6;
+ return 0;
+}