aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/got1.c10
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/got2.c11
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/got1.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/got1.c
new file mode 100644
index 000000000..46a67fb9b
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/got1.c
@@ -0,0 +1,10 @@
+/* { dg-options "-Os -fpic" } */
+/* { dg-final { scan-assembler "GOT_PREL" } } */
+
+extern int x;
+int foo(int j)
+{
+ int t = x;
+ x = j;
+ return t;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/got2.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/got2.c
new file mode 100644
index 000000000..725f49e9c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/got2.c
@@ -0,0 +1,11 @@
+/* We should not use GOT_PREL relocation to load global address with so
+ many global accesses. */
+
+/* { dg-options "-Os -fpic" } */
+/* { dg-final { scan-assembler-not "GOT_PREL" } } */
+
+extern int x1, x2, x3, x4, x5;
+int sum()
+{
+ return x1 + x2 + x3 + x4 + x5;
+}