mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-28 22:44:59 -04:00
37 lines
538 B
C
37 lines
538 B
C
$NetBSD$
|
|
|
|
--- gcc/testsuite/gcc.dg/torture/pr49651.c.orig Wed May 21 19:48:58 2014
|
|
+++ gcc/testsuite/gcc.dg/torture/pr49651.c
|
|
@@ -0,0 +1,31 @@
|
|
+/* { dg-do run } */
|
|
+
|
|
+extern void abort (void);
|
|
+
|
|
+struct X {
|
|
+ int *p;
|
|
+ int *q;
|
|
+};
|
|
+
|
|
+void __attribute__((noinline, noclone))
|
|
+foo (struct X x) { *x.q = 0; }
|
|
+
|
|
+volatile int what;
|
|
+struct X y;
|
|
+
|
|
+int main()
|
|
+{
|
|
+ int i, j;
|
|
+ struct X x, *p;
|
|
+ x.p = &i;
|
|
+ x.q = &j;
|
|
+ if (what)
|
|
+ p = &y;
|
|
+ else
|
|
+ p = &x;
|
|
+ j = 1;
|
|
+ foo (*p);
|
|
+ if (j != 0)
|
|
+ abort ();
|
|
+ return 0;
|
|
+}
|