summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr66960-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr66960-1.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr66960-1.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr66960-1.c b/gcc/testsuite/gcc.target/i386/pr66960-1.c
new file mode 100644
index 00000000000..eeb67d2aadf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr66960-1.c
@@ -0,0 +1,21 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+extern void link_error (void);
+
+__attribute__ ((noinline, noclone))
+void
+foo (void)
+{
+ void **p = __builtin_ia32_interrupt_data ();
+ void *ra = __builtin_return_address (0);
+ if (*p != ra)
+ link_error ();
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}