diff options
author | Robin Dapp <rdapp@linux.ibm.com> | 2019-05-17 12:18:09 +0000 |
---|---|---|
committer | Robin Dapp <rdapp@gcc.gnu.org> | 2019-05-17 12:18:09 +0000 |
commit | 5719731f479e4aa29035cfa540a67245cfe15321 (patch) | |
tree | cdaa294e9bce439c371a03761b122bacdb49b84e | |
parent | c4499192638ad901fc03021834eec60399bfa736 (diff) | |
download | gcc-5719731f479e4aa29035cfa540a67245cfe15321.zip gcc-5719731f479e4aa29035cfa540a67245cfe15321.tar.gz gcc-5719731f479e4aa29035cfa540a67245cfe15321.tar.bz2 |
S/390: Fix larl/PIC test case.
This patch adds -march=z900 to a test case that expects larl for loading
a value via the GOT. On z10 and later, lgrl is used which is tested in
a new, separate test case.
gcc/testsuite/ChangeLog:
2019-05-17 Robin Dapp <rdapp@linux.ibm.com>
* gcc.target/s390/global-array-element-pic.c: Add -march=z900.
* gcc.target/s390/global-array-element-pic2.c: New test for z10+.
From-SVN: r271321
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/global-array-element-pic.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/global-array-element-pic2.c | 13 |
3 files changed, 19 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 650c25a..f63c04d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-17 Robin Dapp <rdapp@linux.ibm.com> + + * gcc.target/s390/global-array-element-pic.c: Add -march=z900. + * gcc.target/s390/global-array-element-pic2.c: New test for z10+. + 2019-05-17 Richard Biener <rguenther@suse.de> * gcc.dg/gimplefe-41.c: New testcase. diff --git a/gcc/testsuite/gcc.target/s390/global-array-element-pic.c b/gcc/testsuite/gcc.target/s390/global-array-element-pic.c index 7872120..3569d5b 100644 --- a/gcc/testsuite/gcc.target/s390/global-array-element-pic.c +++ b/gcc/testsuite/gcc.target/s390/global-array-element-pic.c @@ -1,6 +1,6 @@ /* Test accesses to global array elements in PIC code. */ /* { dg-do compile } */ -/* { dg-options "-O1 -fPIC" } */ +/* { dg-options "-O1 -march=z900 -fPIC" } */ extern char a[] __attribute__ ((aligned (2))); extern char *b; diff --git a/gcc/testsuite/gcc.target/s390/global-array-element-pic2.c b/gcc/testsuite/gcc.target/s390/global-array-element-pic2.c new file mode 100644 index 0000000..b9398a8 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/global-array-element-pic2.c @@ -0,0 +1,13 @@ +/* Test accesses to global array elements in PIC code. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -march=z10 -fPIC" } */ + +extern char a[] __attribute__ ((aligned (2))); +extern char *b; + +void c() +{ + b = a + 4; + /* { dg-final { scan-assembler {(?n)\n\tlgrl\t%r\d+,a@GOTENT\n} } } */ + /* { dg-final { scan-assembler-not {(?n)\n\tlarl\t%r\d+,a[^@]} } } */ +} |