aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-05-16 22:53:21 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-05-16 22:53:21 +0000
commit9750bde7e561731ce8a07cdbd0165a688e74a696 (patch)
treee68335702852880258ba8a9a5c9a9a808a0b790f /gcc-4.9/gcc/testsuite
parent18927802fc8b991c35d7703427a53807e3c6d8c7 (diff)
parent331e362574142e4c1d9d509533d1c96b6dc54d13 (diff)
downloadtoolchain_gcc-9750bde7e561731ce8a07cdbd0165a688e74a696.zip
toolchain_gcc-9750bde7e561731ce8a07cdbd0165a688e74a696.tar.gz
toolchain_gcc-9750bde7e561731ce8a07cdbd0165a688e74a696.tar.bz2
Merge "[4.8, 4.9] Add simplify-got"
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-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 0000000..46a67fb
--- /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 0000000..725f49e
--- /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;
+}