diff mbox

[AArch64] Get %c output template tests to pass for -fPIC

Message ID 5264E8B4.3070200@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov Oct. 21, 2013, 8:41 a.m. UTC
Hi all,

When I added the tests for the %c output template for aarch64 I did not take 
into account that compiling them with -fPIC would fail. This patch fixes them to 
use the 'S' constraint to get them to work.

Ok for trunk?

Tested on aarch64-none-elf/-fPIC

Thanks,
Kyrill


[gcc/testsuite]
2013-10-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.target/aarch64/c-output-mod-2.c: Fix for -fPIC.
     * gcc.target/aarch64/c-output-mod-3.c: Likewise.

Comments

Marcus Shawcroft Oct. 24, 2013, 2:39 p.m. UTC | #1
On 21 October 2013 09:41, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:

> [gcc/testsuite]
> 2013-10-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * gcc.target/aarch64/c-output-mod-2.c: Fix for -fPIC.
>     * gcc.target/aarch64/c-output-mod-3.c: Likewise.

OK
/Marcus
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c b/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c
index 16ff58d..ced96d0 100644
--- a/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c
+++ b/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c
@@ -1,15 +1,9 @@ 
 /* { dg-do compile } */
 
-struct tracepoint {
-    int dummy;
-    int state;
-};
-static struct tracepoint tp;
-
 void
 test (void)
 {
-    __asm__ ("@ %c0" : : "i" (&tp));
+    __asm__ ("@ %c0" : : "S" (test));
 }
 
-/* { dg-final { scan-assembler "@ tp" } } */
+/* { dg-final { scan-assembler "@ test" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c b/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c
index e332fe1..c28837c 100644
--- a/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c
+++ b/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c
@@ -1,15 +1,10 @@ 
 /* { dg-do compile } */
-
-struct tracepoint {
-    int dummy;
-    int state;
-};
-static struct tracepoint tp;
+/* { dg-options "-Wno-pointer-arith" } */
 
 void
 test (void)
 {
-    __asm__ ("@ %c0" : : "i" (&tp.state));
+    __asm__ ("@ %c0" : : "S" (&test + 4));
 }
 
-/* { dg-final { scan-assembler "@ tp\\+4" } } */
+/* { dg-final { scan-assembler "@ test\\+4" } } */