diff mbox

[2/2] Add some more test cases for fentry and pg

Message ID 20140917143900.GY4120@two.firstfloor.org
State New
Headers show

Commit Message

Andi Kleen Sept. 17, 2014, 2:39 p.m. UTC
On Wed, Sep 17, 2014 at 04:32:21PM +0200, Andi Kleen wrote:
> On Wed, Sep 17, 2014 at 03:42:37PM +0200, Dominique Dhumieres wrote:
> > 
> > On darwin I get
> > 
> > FAIL: gcc.target/i386/fentry-override.c (test for excess errors)
> > UNRESOLVED: gcc.target/i386/fentry-override.c scan-assembler-not __fentry__
> > FAIL: gcc.target/i386/fentry.c (test for excess errors)
> > UNRESOLVED: gcc.target/i386/fentry.c scan-assembler __fentry__
> > 
> > with -m32. The error is
> > 
> > sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic
> > 
> > With -m64 I get
> > 
> > FAIL: gcc.target/i386/fentry.c scan-assembler __fentry__
> > 
> > with no string 'entry' in the fentry.s file.
> 
> __fentry__ doesn't exist on all x86 targets.
> I'm not sure how to mark a test to be Linux only. I'll just remove it.

Ok, this should fix it:

I'll commit it as obvious after testing unless there are objections.

Comments

Jakub Jelinek Sept. 17, 2014, 2:51 p.m. UTC | #1
On Wed, Sep 17, 2014 at 04:39:00PM +0200, Andi Kleen wrote:
> Ok, this should fix it:
> 
> I'll commit it as obvious after testing unless there are objections.

This isn't sufficient.
If -mfentry isn't compatible with -m32 -fpic, supposedly you need
something like (untested):
/* { dg-do compile { target { { *-*-linux* } && { nonpic || ! { ia32 } } } } } */
or similar (dunno about -mx32 -fpic, whether it is supposed to work or not).
Otherwise, if somebody tests (and some people do) with
make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-fpic,-m64,-m64/-fpic\}'
or similar, there could be failures.
Just test your patch with
make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-fpic,-m64,-m64/-fpic\} i386.exp=fentry*.c'
in addition to normal testing...

> --- a/gcc/testsuite/gcc.target/i386/fentry-override.c
> +++ b/gcc/testsuite/gcc.target/i386/fentry-override.c
> @@ -1,5 +1,5 @@
>  /* Test -mfentry override */
> -/* { dg-do compile } */
> +/* { dg-do compile { target { *-*-linux* } } } */
>  /* { dg-options "-mfentry" } */
>  /* { dg-final { scan-assembler-not "__fentry__" } } */
>  /* Origin: Andi Kleen */
> diff --git a/gcc/testsuite/gcc.target/i386/fentry.c b/gcc/testsuite/gcc.target/i386/fentry.c
> index bd3db13..2222888 100644
> --- a/gcc/testsuite/gcc.target/i386/fentry.c
> +++ b/gcc/testsuite/gcc.target/i386/fentry.c
> @@ -1,5 +1,5 @@
>  /* Test -mfentry */
> -/* { dg-do compile } */
> +/* { dg-do compile { target { *-*-linux* } } } */
>  /* { dg-options "-fprofile -mfentry" } */
>  /* { dg-final { scan-assembler "__fentry__" } } */
>  /* Origin: Andi Kleen */
> 
> 
> -- 
> ak@linux.intel.com -- Speaking for myself only.

	Jakub
Andi Kleen Sept. 17, 2014, 3:46 p.m. UTC | #2
On Wed, Sep 17, 2014 at 04:51:33PM +0200, Jakub Jelinek wrote:
> On Wed, Sep 17, 2014 at 04:39:00PM +0200, Andi Kleen wrote:
> > Ok, this should fix it:
> > 
> > I'll commit it as obvious after testing unless there are objections.
> 
> This isn't sufficient.
> If -mfentry isn't compatible with -m32 -fpic, supposedly you need

-mfentry works fine with -m32 -fpic as far as I know.

[my recent pending patch adding some extensions didn't support it
though, but that's not tested here]

-Andi
Jakub Jelinek Sept. 17, 2014, 3:50 p.m. UTC | #3
On Wed, Sep 17, 2014 at 05:46:45PM +0200, Andi Kleen wrote:
> On Wed, Sep 17, 2014 at 04:51:33PM +0200, Jakub Jelinek wrote:
> > On Wed, Sep 17, 2014 at 04:39:00PM +0200, Andi Kleen wrote:
> > > Ok, this should fix it:
> > > 
> > > I'll commit it as obvious after testing unless there are objections.
> > 
> > This isn't sufficient.
> > If -mfentry isn't compatible with -m32 -fpic, supposedly you need
> 
> -mfentry works fine with -m32 -fpic as far as I know.
> 
> [my recent pending patch adding some extensions didn't support it
> though, but that's not tested here]

Well, so why does
make -k check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m32/-fpic,-m64,-m64/-fpic\} i386.exp=fentry*.c'
fail for -m32/-fpic then on x86_64-linux (current trunk)?

/usr/src/gcc/gcc/testsuite/gcc.target/i386/fentry-override.c:1:0: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic
/usr/src/gcc/gcc/testsuite/gcc.target/i386/fentry.c:1:0: sorry, unimplemented: -mfentry isn't supported for 32-bit in combination with -fpic

	Jakub
Andi Kleen Sept. 17, 2014, 4:19 p.m. UTC | #4
> Well, so why does

Yo're right. It's actually not supported. I'll use the method you
suggested earlier.

-Andi
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/i386/fentry-override.c b/gcc/testsuite/gcc.target/i386/fentry-override.c
index 3771f19..1b158b3 100644
--- a/gcc/testsuite/gcc.target/i386/fentry-override.c
+++ b/gcc/testsuite/gcc.target/i386/fentry-override.c
@@ -1,5 +1,5 @@ 
 /* Test -mfentry override */
-/* { dg-do compile } */
+/* { dg-do compile { target { *-*-linux* } } } */
 /* { dg-options "-mfentry" } */
 /* { dg-final { scan-assembler-not "__fentry__" } } */
 /* Origin: Andi Kleen */
diff --git a/gcc/testsuite/gcc.target/i386/fentry.c b/gcc/testsuite/gcc.target/i386/fentry.c
index bd3db13..2222888 100644
--- a/gcc/testsuite/gcc.target/i386/fentry.c
+++ b/gcc/testsuite/gcc.target/i386/fentry.c
@@ -1,5 +1,5 @@ 
 /* Test -mfentry */
-/* { dg-do compile } */
+/* { dg-do compile { target { *-*-linux* } } } */
 /* { dg-options "-fprofile -mfentry" } */
 /* { dg-final { scan-assembler "__fentry__" } } */
 /* Origin: Andi Kleen */