diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/arm/got1.c | 10 | ||||
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.target/arm/got2.c | 11 |
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; +} |