On 20.05.15 22:30, Jeff Law wrote:
On 05/20/2015 11:04 AM, Andreas Tobler wrote:
Hi,

the attached patch enables some PIE tests on FreeBSD.

Ok for trunk?

Thanks,
Andreas

2015-05-20  Andreas Tobler  <andre...@gcc.gnu.org>

      * gcc.target/i386/pr32219-1.c: Enable test on FreeBSD.
      * gcc.target/i386/pr32219-2.c: Likewise.
      * gcc.target/i386/pr32219-3.c: Likewise.
      * gcc.target/i386/pr32219-4.c: Likewise.
      * gcc.target/i386/pr32219-5.c: Likewise.
      * gcc.target/i386/pr32219-6.c: Likewise
      * gcc.target/i386/pr32219-7.c: Likewise.
      * gcc.target/i386/pr32219-8.c: Likewise.
      * gcc.target/i386/pr39013-1.c: Likewise.
      * gcc.target/i386/pr39013-2.c: Likewise.
      * gcc.target/i386/pr64317.c: Likewise.
Wouldn't it be better to remove the target selector and instead add:

/* { dg-require-effective-target pie } */

In each of those tests?

While the net effect is the same today, it means there's only one place
to change if another x86 target gains PIE support in the future.

Pre-approved using that style.

Thanks!

Tested on amd64-freebsd and CentOS.

Andreas


This is what I committed:

2015-05-21  Andreas Tobler  <andre...@gcc.gnu.org>

        * gcc.target/i386/pr32219-1.c: Use 'dg-require-effective-target pie'
        instead of listing several targets on its own.
        * gcc.target/i386/pr32219-2.c: Likewise.
        * gcc.target/i386/pr32219-3.c: Likewise.
        * gcc.target/i386/pr32219-4.c: Likewise.
        * gcc.target/i386/pr32219-5.c: Likewise.
        * gcc.target/i386/pr32219-6.c: Likewise
        * gcc.target/i386/pr32219-7.c: Likewise.
        * gcc.target/i386/pr32219-8.c: Likewise.
        * gcc.target/i386/pr39013-1.c: Likewise.
        * gcc.target/i386/pr39013-2.c: Likewise.
        * gcc.target/i386/pr64317.c: Likewise.




Index: pr32219-1.c
===================================================================
--- pr32219-1.c (revision 223448)
+++ pr32219-1.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Initialized common symbol with -fpie.  */
Index: pr32219-2.c
===================================================================
--- pr32219-2.c (revision 223448)
+++ pr32219-2.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Common symbol with -fpic.  */
Index: pr32219-3.c
===================================================================
--- pr32219-3.c (revision 223448)
+++ pr32219-3.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Weak common symbol with -fpie.  */
Index: pr32219-4.c
===================================================================
--- pr32219-4.c (revision 223448)
+++ pr32219-4.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Weak common symbol with -fpic.  */
Index: pr32219-5.c
===================================================================
--- pr32219-5.c (revision 223448)
+++ pr32219-5.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Initialized symbol with -fpie.  */
Index: pr32219-6.c
===================================================================
--- pr32219-6.c (revision 223448)
+++ pr32219-6.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Initialized symbol with -fpic.  */
Index: pr32219-7.c
===================================================================
--- pr32219-7.c (revision 223448)
+++ pr32219-7.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Weak initialized symbol with -fpie.  */
Index: pr32219-8.c
===================================================================
--- pr32219-8.c (revision 223448)
+++ pr32219-8.c (working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Weak initialized symbol with -fpic.  */
Index: pr39013-1.c
===================================================================
--- pr39013-1.c (revision 223448)
+++ pr39013-1.c (working copy)
@@ -1,5 +1,6 @@
 /* PR target/39013 */
-/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie -std=gnu89" } */
 
 inline int foo (void);
Index: pr39013-2.c
===================================================================
--- pr39013-2.c (revision 223448)
+++ pr39013-2.c (working copy)
@@ -1,5 +1,6 @@
 /* PR target/39013 */
-/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target pie } */
 /* { dg-options "-O2 -fpie -std=gnu99" } */
 
 inline int foo (void);         /* { dg-warning "declared but never defined" } 
*/
Index: pr64317.c
===================================================================
--- pr64317.c   (revision 223448)
+++ pr64317.c   (working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { *-*-linux* && ia32 } } } */
+/* { dg-do compile { target { { *-*-freebsd* *-*-linux* } && ia32 } } } */
 /* { dg-options "-O2 -fpie" } */
 /* { dg-final { scan-assembler "addl\[ \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" 
} } */
 /* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" } } */

Reply via email to