aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c b/gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c
new file mode 100644
index 000000000..f2719529e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/pr57793.c
@@ -0,0 +1,23 @@
+/* PR c++/57793 */
+
+struct A { unsigned a : 1; unsigned b : 1; };
+struct B /* { dg-error "type .B. is too large" "" { target { c++ && ilp32 } } } */
+{
+ unsigned char c[0x40000000]; /* { dg-error "size of array .c. is too large" "" { target { ! int32plus } } } */
+ unsigned char d[0x40000ff0];/* { dg-error "size of array .d. is too large" "" { target { ! int32plus } } } */
+ struct A e;
+}; /* { dg-error "type .struct B. is too large" "" { target { c && ilp32 } } } */
+
+void *foo (struct B *p)
+{
+ if (p->e.a)
+ return (void *) 0;
+ p->e.b = 1;
+ return p->c;
+}
+
+void
+bar (struct B *p)
+{
+ foo (p);
+}