This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.
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" } } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]