Add more tests for PR target/66232
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 27 Jul 2015 16:24:35 +0000 (16:24 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 27 Jul 2015 16:24:35 +0000 (09:24 -0700)
PR target/66232
* gcc.target/i386/pr66232-6.c: New tests.
* gcc.target/i386/pr66232-7.c: Likewise.
* gcc.target/i386/pr66232-8.c: Likewise.
* gcc.target/i386/pr66232-9.c: Likewise.

From-SVN: r226254

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr66232-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66232-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66232-8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr66232-9.c [new file with mode: 0644]

index 8b572c28fee43cc83177fd97e7018778fcc8f7d9..3e409dda43b76b43e71166d8ea043822cbad6f85 100644 (file)
@@ -1,3 +1,11 @@
+2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/66232
+       * gcc.target/i386/pr66232-6.c: New tests.
+       * gcc.target/i386/pr66232-7.c: Likewise.
+       * gcc.target/i386/pr66232-8.c: Likewise.
+       * gcc.target/i386/pr66232-9.c: Likewise.
+
 2015-07-27  Marek Polacek  <polacek@redhat.com>
 
        PR c++/66555
diff --git a/gcc/testsuite/gcc.target/i386/pr66232-6.c b/gcc/testsuite/gcc.target/i386/pr66232-6.c
new file mode 100644 (file)
index 0000000..e95c789
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fno-pic -fno-plt" } */
+
+extern void bar (void) __attribute__((visibility("hidden")));
+
+void
+foo (void)
+{
+  bar ();
+}
+
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*.bar@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*.bar@GOT" { target ia32 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr66232-7.c b/gcc/testsuite/gcc.target/i386/pr66232-7.c
new file mode 100644 (file)
index 0000000..63a1809
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fno-pic -fno-plt" } */
+
+extern void bar (void) __attribute__((visibility("hidden")));
+
+int
+foo (void)
+{
+  bar ();
+  return 0;
+}
+
+/* { dg-final { scan-assembler-not "call\[ \t\]*.bar@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "call\[ \t\]*.bar@GOT" { target ia32 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr66232-8.c b/gcc/testsuite/gcc.target/i386/pr66232-8.c
new file mode 100644 (file)
index 0000000..89bb605
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fno-pic -fno-plt" } */
+
+extern int bar (void) __attribute__((visibility("hidden")));
+
+int
+foo (void)
+{
+  return bar ();
+}
+
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*.bar@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "jmp\[ \t\]*.bar@GOT" { target ia32 } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr66232-9.c b/gcc/testsuite/gcc.target/i386/pr66232-9.c
new file mode 100644 (file)
index 0000000..4aec477
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile { target *-*-linux* } } */
+/* { dg-options "-O2 -fno-pic -fno-plt" } */
+
+extern int bar (void) __attribute__((visibility("hidden")));
+
+int
+foo (void)
+{
+  return bar () + 1;
+}
+
+/* { dg-final { scan-assembler-not "call\[ \t\]*.bar@GOTPCREL" { target { ! ia32 } } } } */
+/* { dg-final { scan-assembler-not "call\[ \t\]*.bar@GOT" { target ia32 } } } */