diff mbox

[AARCH64] Skip gcc.target/aarch64/pr66912.c in tiny or large memory model.

Message ID 5811D626.6030000@foss.arm.com
State New
Headers show

Commit Message

Renlin Li Oct. 27, 2016, 10:25 a.m. UTC
Hi all,

This a simple patch to fix gcc.target/aarch64/pr66912.c.
It's a test case only applicable to small memory model which is the default
one.

It has been tested to run only when the memory model is small.
Okay to commit?

Regards,
Renlin Li

gcc/testsuite/ChangeLog:

2016-10-27  Renlin Li  <renlin.li@arm.com>

	* gcc.target/aarch64/pr66912.c: Skip tiny and large memory model.

Comments

Szabolcs Nagy Oct. 27, 2016, 10:48 a.m. UTC | #1
On 27/10/16 11:25, Renlin Li wrote:
> Hi all,

> 

> This a simple patch to fix gcc.target/aarch64/pr66912.c.

> It's a test case only applicable to small memory model which is the default

> one.

> 


  /* { dg-final { scan-assembler ":got(page_lo15)?:n_common" } } */

i think this is supposed to work on tiny and small model as well.
(:got:var vs :gotpage_lo15:var)

it will have to be updated for large model when we have support for that.

> It has been tested to run only when the memory model is small.

> Okay to commit?

> 

> Regards,

> Renlin Li

> 

> gcc/testsuite/ChangeLog:

> 

> 2016-10-27  Renlin Li  <renlin.li@arm.com>

> 

>     * gcc.target/aarch64/pr66912.c: Skip tiny and large memory model.
Renlin Li Oct. 27, 2016, 11:24 a.m. UTC | #2
Hi,

On 27/10/16 11:48, Szabolcs Nagy wrote:
> On 27/10/16 11:25, Renlin Li wrote:

>> Hi all,

>>

>> This a simple patch to fix gcc.target/aarch64/pr66912.c.

>> It's a test case only applicable to small memory model which is the default

>> one.

>>

>

>    /* { dg-final { scan-assembler ":got(page_lo15)?:n_common" } } */

>

> i think this is supposed to work on tiny and small model as well.

> (:got:var vs :gotpage_lo15:var)

>

Sorry, I didn't aware it's a regex which will match both.

> it will have to be updated for large model when we have support for that.


yes, large memory model will have different relocation for this case, which will
not be caught by this pattern.

Regards,
Renlin

>

>> It has been tested to run only when the memory model is small.

>> Okay to commit?

>>

>> Regards,

>> Renlin Li

>>

>> gcc/testsuite/ChangeLog:

>>

>> 2016-10-27  Renlin Li  <renlin.li@arm.com>

>>

>>      * gcc.target/aarch64/pr66912.c: Skip tiny and large memory model.

>
Andrew Pinski Oct. 27, 2016, 3:28 p.m. UTC | #3
On Thu, Oct 27, 2016 at 4:24 AM, Renlin Li <renlin.li@foss.arm.com> wrote:
> Hi,

>

> On 27/10/16 11:48, Szabolcs Nagy wrote:

>>

>> On 27/10/16 11:25, Renlin Li wrote:

>>>

>>> Hi all,

>>>

>>> This a simple patch to fix gcc.target/aarch64/pr66912.c.

>>> It's a test case only applicable to small memory model which is the

>>> default

>>> one.

>>>

>>

>>    /* { dg-final { scan-assembler ":got(page_lo15)?:n_common" } } */

>>

>> i think this is supposed to work on tiny and small model as well.

>> (:got:var vs :gotpage_lo15:var)

>>

> Sorry, I didn't aware it's a regex which will match both.

>

>> it will have to be updated for large model when we have support for that.

>

>

> yes, large memory model will have different relocation for this case, which

> will

> not be caught by this pattern.



It also fails for ILP32.  I have not looked into the assembler output there yet.

Thanks,
Andrew

>

> Regards,

> Renlin

>

>

>>

>>> It has been tested to run only when the memory model is small.

>>> Okay to commit?

>>>

>>> Regards,

>>> Renlin Li

>>>

>>> gcc/testsuite/ChangeLog:

>>>

>>> 2016-10-27  Renlin Li  <renlin.li@arm.com>

>>>

>>>      * gcc.target/aarch64/pr66912.c: Skip tiny and large memory model.

>>

>>

>
Renlin Li Oct. 27, 2016, 4:17 p.m. UTC | #4
On 27/10/16 16:28, Andrew Pinski wrote:
> On Thu, Oct 27, 2016 at 4:24 AM, Renlin Li <renlin.li@foss.arm.com> wrote:

>> Hi,

>>

>> On 27/10/16 11:48, Szabolcs Nagy wrote:

>>>

>>> On 27/10/16 11:25, Renlin Li wrote:

>>>>

>>>> Hi all,

>>>>

>>>> This a simple patch to fix gcc.target/aarch64/pr66912.c.

>>>> It's a test case only applicable to small memory model which is the

>>>> default

>>>> one.

>>>>

>>>

>>>     /* { dg-final { scan-assembler ":got(page_lo15)?:n_common" } } */

>>>

>>> i think this is supposed to work on tiny and small model as well.

>>> (:got:var vs :gotpage_lo15:var)

>>>

>> Sorry, I didn't aware it's a regex which will match both.

>>

>>> it will have to be updated for large model when we have support for that.

>>

>>

>> yes, large memory model will have different relocation for this case, which

>> will

>> not be caught by this pattern.

>

>

> It also fails for ILP32.  I have not looked into the assembler output there yet.

>

Hi Andrew,

For ILP32, the relocation will be R_AARCH64_LD32_GOTPAGE_LO14 in small memory model.
So the string modifier would be "gotpage_lo14"

Regards,
Renlin

> Thanks,

> Andrew

>

>>

>> Regards,

>> Renlin

>>

>>

>>>

>>>> It has been tested to run only when the memory model is small.

>>>> Okay to commit?

>>>>

>>>> Regards,

>>>> Renlin Li

>>>>

>>>> gcc/testsuite/ChangeLog:

>>>>

>>>> 2016-10-27  Renlin Li  <renlin.li@arm.com>

>>>>

>>>>       * gcc.target/aarch64/pr66912.c: Skip tiny and large memory model.

>>>

>>>

>>
diff mbox

Patch

commit 364538b449d62c9a411b31021bdd9f355d36edf1
Author: Renlin Li <renlin.li@arm.com>
Date:   Wed Jan 6 14:00:16 2016 +0000

    fix pr66912.c

diff --git a/gcc/testsuite/gcc.target/aarch64/pr66912.c b/gcc/testsuite/gcc.target/aarch64/pr66912.c
index b8aabcd..be07641 100644
--- a/gcc/testsuite/gcc.target/aarch64/pr66912.c
+++ b/gcc/testsuite/gcc.target/aarch64/pr66912.c
@@ -1,5 +1,7 @@ 
 /* { dg-do compile { target *-*-linux* } } */
+/* { dg-require-effective-target aarch64_small_fpic } */
 /* { dg-options "-O2 -fpic" } */
+/* { dg-skip-if "small memory model" { aarch64*-*-* }  { "-mcmodel=tiny" "-mcmodel=large" } { "" } } */
 
 __attribute__((visibility("protected")))
 int n_common;