From: rdapp Date: Fri, 17 May 2019 12:18:09 +0000 (+0000) Subject: S/390: Fix larl/PIC test case. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=46feabd30d3f69a60bf6ce2dd194f48b7f06090a;p=thirdparty%2Fgcc.git 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 * gcc.target/s390/global-array-element-pic.c: Add -march=z900. * gcc.target/s390/global-array-element-pic2.c: New test for z10+. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271321 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 650c25a89e52..f63c04d4cba0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-17 Robin Dapp + + * 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 * 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 787212061518..3569d5b2be71 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 000000000000..b9398a8042fc --- /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[^@]} } } */ +}