diff mbox series

S/390: Add -march to test case

Message ID c72b1dc8-9a21-ccbd-8814-4e07a0815e7d@linux.ibm.com
State New
Headers show
Series S/390: Add -march to test case | expand

Commit Message

Robin Dapp May 15, 2019, 3:45 p.m. UTC
Hi,

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 test case.

Regards
 Robin

--

gcc/testsuite/ChangeLog:

2019-05-15  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+.

Comments

Ilya Leoshkevich May 16, 2019, 8:54 a.m. UTC | #1
> 2019-05-15  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+.

LGTM
Andreas Krebbel May 16, 2019, 9:02 a.m. UTC | #2
On 15.05.19 17:45, Robin Dapp wrote:
> Hi,
> 
> 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 test case.
> 
> Regards
>  Robin
> 
> --
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-05-15  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+.
> 
Fine with me. Thanks!

Andreas
diff mbox series

Patch

commit 55b586bca052b697605b6f3b29248a91f6bb19d1
Author: Robin Dapp <rdapp@linux.ibm.com>
Date:   Tue May 14 12:15:57 2019 +0200

    Change larl/lgrl fPIC test cases.

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 78721206151..3569d5b2be7 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 00000000000..b9398a8042f
--- /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[^@]} } } */
+}