aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/dilayout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/dilayout.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/dilayout.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/dilayout.c b/gcc/testsuite/gcc.c-torture/compile/dilayout.c
new file mode 100644
index 0000000..4bba661
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/dilayout.c
@@ -0,0 +1,33 @@
+struct ii
+{
+ int a;
+ int b;
+};
+
+struct foo
+{
+ int a;
+ struct ii ab;
+ int b;
+};
+
+struct ii
+foo (int *p, struct foo a)
+{
+ p[0] = a.a;
+ p[1] = a.ab.a;
+ p[2] = a.ab.b;
+ p[3] = a.b;
+ return a.ab;
+}
+
+str (struct ii ab, struct ii *p)
+{
+ *p = ab;
+}
+
+ll (long long ab, long long *p)
+{
+ *p = ab;
+}
+