diff mbox

[committed] : Add more tests for PR target/66232

Message ID 20150727162513.GA13155@intel.com
State New
Headers show

Commit Message

H.J. Lu July 27, 2015, 4:25 p.m. UTC

diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 226252)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@ 
+2015-07-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* 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
Index: gcc.target/i386/pr66232-6.c
===================================================================
--- gcc.target/i386/pr66232-6.c	(revision 0)
+++ gcc.target/i386/pr66232-6.c	(working copy)
@@ -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 } } } */
Index: gcc.target/i386/pr66232-7.c
===================================================================
--- gcc.target/i386/pr66232-7.c	(revision 0)
+++ gcc.target/i386/pr66232-7.c	(working copy)
@@ -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 } } } */
Index: gcc.target/i386/pr66232-8.c
===================================================================
--- gcc.target/i386/pr66232-8.c	(revision 0)
+++ gcc.target/i386/pr66232-8.c	(working copy)
@@ -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 } } } */
Index: gcc.target/i386/pr66232-9.c
===================================================================
--- gcc.target/i386/pr66232-9.c	(revision 0)
+++ gcc.target/i386/pr66232-9.c	(working copy)
@@ -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 } } } */