public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] testsuite enable PIE tests on FreeBSD
@ 2015-05-20 17:11 Andreas Tobler
  2015-05-20 20:40 ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Tobler @ 2015-05-20 17:11 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

Hi,

the attached patch enables some PIE tests on FreeBSD.

Ok for trunk?

Thanks,
Andreas

2015-05-20  Andreas Tobler  <andreast@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.

[-- Attachment #2: fbsd_pie_tests.diff --]
[-- Type: text/plain, Size: 4660 bytes --]

Index: gcc.target/i386/pr32219-1.c
===================================================================
--- gcc.target/i386/pr32219-1.c	(revision 223412)
+++ gcc.target/i386/pr32219-1.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Initialized common symbol with -fpie.  */
Index: gcc.target/i386/pr32219-2.c
===================================================================
--- gcc.target/i386/pr32219-2.c	(revision 223412)
+++ gcc.target/i386/pr32219-2.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Common symbol with -fpic.  */
Index: gcc.target/i386/pr32219-3.c
===================================================================
--- gcc.target/i386/pr32219-3.c	(revision 223412)
+++ gcc.target/i386/pr32219-3.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Weak common symbol with -fpie.  */
Index: gcc.target/i386/pr32219-4.c
===================================================================
--- gcc.target/i386/pr32219-4.c	(revision 223412)
+++ gcc.target/i386/pr32219-4.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Weak common symbol with -fpic.  */
Index: gcc.target/i386/pr32219-5.c
===================================================================
--- gcc.target/i386/pr32219-5.c	(revision 223412)
+++ gcc.target/i386/pr32219-5.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Initialized symbol with -fpie.  */
Index: gcc.target/i386/pr32219-6.c
===================================================================
--- gcc.target/i386/pr32219-6.c	(revision 223412)
+++ gcc.target/i386/pr32219-6.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Initialized symbol with -fpic.  */
Index: gcc.target/i386/pr32219-7.c
===================================================================
--- gcc.target/i386/pr32219-7.c	(revision 223412)
+++ gcc.target/i386/pr32219-7.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpie" } */
 
 /* Weak initialized symbol with -fpie.  */
Index: gcc.target/i386/pr32219-8.c
===================================================================
--- gcc.target/i386/pr32219-8.c	(revision 223412)
+++ gcc.target/i386/pr32219-8.c	(working copy)
@@ -1,4 +1,4 @@
-/* { dg-do compile { target *-*-linux* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* } } */
 /* { dg-options "-O2 -fpic" } */
 
 /* Weak initialized symbol with -fpic.  */
Index: gcc.target/i386/pr39013-1.c
===================================================================
--- gcc.target/i386/pr39013-1.c	(revision 223412)
+++ gcc.target/i386/pr39013-1.c	(working copy)
@@ -1,5 +1,5 @@
 /* PR target/39013 */
-/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* *-*-gnu* } } */
 /* { dg-options "-O2 -fpie -std=gnu89" } */
 
 inline int foo (void);
Index: gcc.target/i386/pr39013-2.c
===================================================================
--- gcc.target/i386/pr39013-2.c	(revision 223412)
+++ gcc.target/i386/pr39013-2.c	(working copy)
@@ -1,5 +1,5 @@
 /* PR target/39013 */
-/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-do compile { target *-*-freebsd* *-*-linux* *-*-gnu* } } */
 /* { dg-options "-O2 -fpie -std=gnu99" } */
 
 inline int foo (void);		/* { dg-warning "declared but never defined" } */
Index: gcc.target/i386/pr64317.c
===================================================================
--- gcc.target/i386/pr64317.c	(revision 223412)
+++ gcc.target/i386/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\[)\]" } } */

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-20 17:11 [patch] testsuite enable PIE tests on FreeBSD Andreas Tobler
@ 2015-05-20 20:40 ` Jeff Law
  2015-05-21 18:23   ` Andreas Tobler
  2015-05-28 11:49   ` Thomas Schwinge
  0 siblings, 2 replies; 11+ messages in thread
From: Jeff Law @ 2015-05-20 20:40 UTC (permalink / raw)
  To: Andreas Tobler, GCC Patches

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  <andreast@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.
jeff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-20 20:40 ` Jeff Law
@ 2015-05-21 18:23   ` Andreas Tobler
  2015-05-21 20:44     ` Andreas Tobler
  2015-05-28 11:49   ` Thomas Schwinge
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Tobler @ 2015-05-21 18:23 UTC (permalink / raw)
  To: Jeff Law, GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

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  <andreast@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  <andreast@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.





[-- Attachment #2: fbsd_pie3_test.diff --]
[-- Type: text/plain, Size: 4194 bytes --]

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\[)\]" } } */

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-21 18:23   ` Andreas Tobler
@ 2015-05-21 20:44     ` Andreas Tobler
  2015-05-22 22:54       ` Jeff Law
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Tobler @ 2015-05-21 20:44 UTC (permalink / raw)
  To: Jeff Law, GCC Patches

On 21.05.15 20:14, Andreas Tobler wrote:
> 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  <andreast@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  <andreast@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/pr64317.c: Likewise.

Yes, I know. The comment and the content for this test case do not match.

Is this ok:

Index: gcc.target/i386/pr64317.c
===================================================================
--- gcc.target/i386/pr64317.c	(revision 223498)
+++ gcc.target/i386/pr64317.c	(working copy)
@@ -1,4 +1,5 @@
-/* { dg-do compile { target { { *-*-freebsd* *-*-linux* } && ia32 } } } */
+/* { dg-do compile { target ia32 } } */
+/* { dg-require-effective-target pie } */
  /* { dg-options "-O2 -fpie" } */
  /* { dg-final { scan-assembler "addl\[ 
\\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" } } */
  /* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" } 
} */


or do you prefer instead of

/* { dg-do compile { target ia32 } } */

this one:

/* { dg-do compile } */
/* { dg-require-effective-target ia32 } */


Btw, all three variants run on i386.

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-21 20:44     ` Andreas Tobler
@ 2015-05-22 22:54       ` Jeff Law
  2015-05-25 10:29         ` Andreas Tobler
  0 siblings, 1 reply; 11+ messages in thread
From: Jeff Law @ 2015-05-22 22:54 UTC (permalink / raw)
  To: Andreas Tobler, GCC Patches

On 05/21/2015 02:01 PM, Andreas Tobler wrote:
> On 21.05.15 20:14, Andreas Tobler wrote:
>> 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  <andreast@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  <andreast@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/pr64317.c: Likewise.
>
> Yes, I know. The comment and the content for this test case do not match.
>
> Is this ok:
>
> Index: gcc.target/i386/pr64317.c
> ===================================================================
> --- gcc.target/i386/pr64317.c    (revision 223498)
> +++ gcc.target/i386/pr64317.c    (working copy)
> @@ -1,4 +1,5 @@
> -/* { dg-do compile { target { { *-*-freebsd* *-*-linux* } && ia32 } } } */
> +/* { dg-do compile { target ia32 } } */
> +/* { dg-require-effective-target pie } */
>   /* { dg-options "-O2 -fpie" } */
>   /* { dg-final { scan-assembler "addl\[
> \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" } } */
>   /* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" }
> } */
>
>
> or do you prefer instead of
>
> /* { dg-do compile { target ia32 } } */
>
> this one:
>
> /* { dg-do compile } */
> /* { dg-require-effective-target ia32 } */
>
>
> Btw, all three variants run on i386.
It looks like the dg-require-effective-target is typically on a line by 
itself.  So let's stick with the last version.

jeff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-22 22:54       ` Jeff Law
@ 2015-05-25 10:29         ` Andreas Tobler
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Tobler @ 2015-05-25 10:29 UTC (permalink / raw)
  To: Jeff Law, GCC Patches

On 22.05.15 23:47, Jeff Law wrote:
> On 05/21/2015 02:01 PM, Andreas Tobler wrote:
>> On 21.05.15 20:14, Andreas Tobler wrote:
>>> 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  <andreast@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  <andreast@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/pr64317.c: Likewise.
>>
>> Yes, I know. The comment and the content for this test case do not match.
>>
>> Is this ok:
>>
>> Index: gcc.target/i386/pr64317.c
>> ===================================================================
>> --- gcc.target/i386/pr64317.c    (revision 223498)
>> +++ gcc.target/i386/pr64317.c    (working copy)
>> @@ -1,4 +1,5 @@
>> -/* { dg-do compile { target { { *-*-freebsd* *-*-linux* } && ia32 } } } */
>> +/* { dg-do compile { target ia32 } } */
>> +/* { dg-require-effective-target pie } */
>>    /* { dg-options "-O2 -fpie" } */
>>    /* { dg-final { scan-assembler "addl\[
>> \\t\]+\[$\]_GLOBAL_OFFSET_TABLE_, %ebx" } } */
>>    /* { dg-final { scan-assembler "movl\[ \\t\]+c@GOTOFF\[(\]%ebx\[)\]" }
>> } */
>>
>>
>> or do you prefer instead of
>>
>> /* { dg-do compile { target ia32 } } */
>>
>> this one:
>>
>> /* { dg-do compile } */
>> /* { dg-require-effective-target ia32 } */
>>
>>
>> Btw, all three variants run on i386.
> It looks like the dg-require-effective-target is typically on a line by
> itself.  So let's stick with the last version.

So, finally committed. Thanks!
Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-20 20:40 ` Jeff Law
  2015-05-21 18:23   ` Andreas Tobler
@ 2015-05-28 11:49   ` Thomas Schwinge
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Schwinge @ 2015-05-28 11:49 UTC (permalink / raw)
  To: Jeff Law, Andreas Tobler; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Hi!

On Wed, 20 May 2015 14:30:38 -0600, Jeff Law <law@redhat.com> wrote:
> On 05/20/2015 11:04 AM, Andreas Tobler wrote:
> > the attached patch enables some PIE tests on FreeBSD.

> Wouldn't it be better to remove the target selector and instead add:
> 
> /* { dg-require-effective-target pie } */
> 
> In each of those tests?

(Got committed to trunk in r223498.)  Thanks!  I wanted to suggest
something along the same lines, because:

> 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.

GNU Hurd got it, too.  :-)


Grüße,
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-25 20:14 ` Andreas Tobler
@ 2015-05-26 14:18   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2015-05-26 14:18 UTC (permalink / raw)
  To: Andreas Tobler, Dominique Dhumieres, gcc-patches

On 05/25/2015 01:52 PM, Andreas Tobler wrote:
> On 25.05.15 14:42, Dominique Dhumieres wrote:
>>> Wouldn't it be better to remove the target selector and instead add:
>>>
>>> /* { dg-require-effective-target pie } */
>>> ...
>>
>> This allows the tests to be run on Darwin and fail because the code
>> generated does not
>> match the scan-assembler:
>>
>> FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align
>> FAIL: gcc.target/i386/pr32219-1.c scan-assembler movl[
>> \\t]xxx\\\\(%rip\\\\), %eax
>> FAIL: gcc.target/i386/pr32219-3.c scan-assembler movl[
>> \\t]xxx\\\\(%rip\\\\), %eax
>> FAIL: gcc.target/i386/pr32219-3.c scan-assembler-not xxx@GOTPCREL
>> FAIL: gcc.target/i386/pr32219-5.c scan-assembler movl[
>> \\t]xxx\\\\(%rip\\\\), %eax
>> FAIL: gcc.target/i386/pr32219-6.c scan-assembler xxx@GOTPCREL
>> FAIL: gcc.target/i386/pr32219-7.c scan-assembler movl[
>> \\t]xxx\\\\(%rip\\\\), %eax
>> FAIL: gcc.target/i386/pr32219-7.c scan-assembler-not xxx@GOTPCREL
>> FAIL: gcc.target/i386/pr39013-1.c scan-assembler bar@PLT
>> FAIL: gcc.target/i386/pr39013-1.c scan-assembler foo@PLT
>> FAIL: gcc.target/i386/pr39013-2.c scan-assembler bar@PLT
>> FAIL: gcc.target/i386/pr39013-2.c scan-assembler foo@PLT
>>
>> I suspect that this will also be the case for gcc.target/i386/pr64317.c.
>
> Ok. As written on #irc I can exclude *-*-darwin* from the tests with
> this one:
>
> /* { dg-do compile { target { ! { *-*-darwin* } } } } */
>
> Let me know what you prefer.
That should be our fallback depending on Dominique's response to my 
message.

We need to figure out if the expected output needs tweaking or if 
there's some capability these tests expect that isn't available on Darwin.

Sorry you got sucked into the Darwin black hole...  I'll do what I can 
to minimize its effects.


Jeff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-25 14:00 Dominique Dhumieres
  2015-05-25 20:14 ` Andreas Tobler
@ 2015-05-26 14:14 ` Jeff Law
  1 sibling, 0 replies; 11+ messages in thread
From: Jeff Law @ 2015-05-26 14:14 UTC (permalink / raw)
  To: Dominique Dhumieres, andreast-list; +Cc: gcc-patches

On 05/25/2015 06:42 AM, Dominique Dhumieres wrote:
>> Wouldn't it be better to remove the target selector and instead add:
>>
>> /* { dg-require-effective-target pie } */
>> ...
>
> This allows the tests to be run on Darwin and fail because the code generated does not
> match the scan-assembler:
>
> FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align
> FAIL: gcc.target/i386/pr32219-1.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-3.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-3.c scan-assembler-not xxx@GOTPCREL
> FAIL: gcc.target/i386/pr32219-5.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-6.c scan-assembler xxx@GOTPCREL
> FAIL: gcc.target/i386/pr32219-7.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-7.c scan-assembler-not xxx@GOTPCREL
> FAIL: gcc.target/i386/pr39013-1.c scan-assembler bar@PLT
> FAIL: gcc.target/i386/pr39013-1.c scan-assembler foo@PLT
> FAIL: gcc.target/i386/pr39013-2.c scan-assembler bar@PLT
> FAIL: gcc.target/i386/pr39013-2.c scan-assembler foo@PLT
>
> I suspect that this will also be the case for gcc.target/i386/pr64317.c.
Can you dig a little bit deeper -- is it the case that we just need a 
more general pattern to match whatever assembler is necessary for Darwin?

Or is it the case that Darwin doesn't have some particular capability in 
its assembler/linker that these tests depend on (and thus we need 
another check-effective-target-whatever)

I'm happy to iterate with Andreas to get this addressed for Darwin, but 
neither Andreas nor myself really know much about that platform.

jeff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
  2015-05-25 14:00 Dominique Dhumieres
@ 2015-05-25 20:14 ` Andreas Tobler
  2015-05-26 14:18   ` Jeff Law
  2015-05-26 14:14 ` Jeff Law
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Tobler @ 2015-05-25 20:14 UTC (permalink / raw)
  To: Dominique Dhumieres, gcc-patches; +Cc: law

On 25.05.15 14:42, Dominique Dhumieres wrote:
>> Wouldn't it be better to remove the target selector and instead add:
>>
>> /* { dg-require-effective-target pie } */
>> ...
>
> This allows the tests to be run on Darwin and fail because the code generated does not
> match the scan-assembler:
>
> FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align
> FAIL: gcc.target/i386/pr32219-1.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-3.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-3.c scan-assembler-not xxx@GOTPCREL
> FAIL: gcc.target/i386/pr32219-5.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-6.c scan-assembler xxx@GOTPCREL
> FAIL: gcc.target/i386/pr32219-7.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
> FAIL: gcc.target/i386/pr32219-7.c scan-assembler-not xxx@GOTPCREL
> FAIL: gcc.target/i386/pr39013-1.c scan-assembler bar@PLT
> FAIL: gcc.target/i386/pr39013-1.c scan-assembler foo@PLT
> FAIL: gcc.target/i386/pr39013-2.c scan-assembler bar@PLT
> FAIL: gcc.target/i386/pr39013-2.c scan-assembler foo@PLT
>
> I suspect that this will also be the case for gcc.target/i386/pr64317.c.

Ok. As written on #irc I can exclude *-*-darwin* from the tests with 
this one:

/* { dg-do compile { target { ! { *-*-darwin* } } } } */

Let me know what you prefer.

Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [patch] testsuite enable PIE tests on FreeBSD
@ 2015-05-25 14:00 Dominique Dhumieres
  2015-05-25 20:14 ` Andreas Tobler
  2015-05-26 14:14 ` Jeff Law
  0 siblings, 2 replies; 11+ messages in thread
From: Dominique Dhumieres @ 2015-05-25 14:00 UTC (permalink / raw)
  To: andreast-list; +Cc: gcc-patches, law

> Wouldn't it be better to remove the target selector and instead add:
>
> /* { dg-require-effective-target pie } */
> ...

This allows the tests to be run on Darwin and fail because the code generated does not
match the scan-assembler:

FAIL: gcc.target/i386/iinline-attr-2.c scan-assembler p2align
FAIL: gcc.target/i386/pr32219-1.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
FAIL: gcc.target/i386/pr32219-3.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
FAIL: gcc.target/i386/pr32219-3.c scan-assembler-not xxx@GOTPCREL
FAIL: gcc.target/i386/pr32219-5.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
FAIL: gcc.target/i386/pr32219-6.c scan-assembler xxx@GOTPCREL
FAIL: gcc.target/i386/pr32219-7.c scan-assembler movl[ \\t]xxx\\\\(%rip\\\\), %eax
FAIL: gcc.target/i386/pr32219-7.c scan-assembler-not xxx@GOTPCREL
FAIL: gcc.target/i386/pr39013-1.c scan-assembler bar@PLT
FAIL: gcc.target/i386/pr39013-1.c scan-assembler foo@PLT
FAIL: gcc.target/i386/pr39013-2.c scan-assembler bar@PLT
FAIL: gcc.target/i386/pr39013-2.c scan-assembler foo@PLT

I suspect that this will also be the case for gcc.target/i386/pr64317.c.

TIA

Dominique

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-05-28 11:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20 17:11 [patch] testsuite enable PIE tests on FreeBSD Andreas Tobler
2015-05-20 20:40 ` Jeff Law
2015-05-21 18:23   ` Andreas Tobler
2015-05-21 20:44     ` Andreas Tobler
2015-05-22 22:54       ` Jeff Law
2015-05-25 10:29         ` Andreas Tobler
2015-05-28 11:49   ` Thomas Schwinge
2015-05-25 14:00 Dominique Dhumieres
2015-05-25 20:14 ` Andreas Tobler
2015-05-26 14:18   ` Jeff Law
2015-05-26 14:14 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).