aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.ext/constructor.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ext/constructor.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.ext/constructor.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ext/constructor.C b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C
new file mode 100644
index 00000000000..cdf9f1da98b
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.ext/constructor.C
@@ -0,0 +1,19 @@
+// Testcase for constructor expressions (GNU extension)
+// Special g++ Options:
+
+struct Any {
+ int *type;
+ int *addr;
+};
+
+int i, j;
+
+main () {
+ struct Any *ap = (struct Any *)
+ __builtin_alloca (sizeof(struct Any));
+ *ap = ((struct Any){ &i, &j }) ;
+
+ if (ap->type != &i || ap->addr != &j)
+ return 1;
+ return 0;
+}