]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390: testsuite: Fix bitops-{1,2}.c and andc-splitter-2.c
authorStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Wed, 17 Sep 2025 11:12:30 +0000 (13:12 +0200)
committerStefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
Wed, 17 Sep 2025 11:12:30 +0000 (13:12 +0200)
After r16-2649-g0340177d54d tests fail for
gcc.target/s390/arch13/bitops-{1,2}.c since sign extends in conjunction
with (subreg (not a)) are folded, now.  That is, of course, wanted.
Since the original tests were about 32-bit operations, circumvent the
sign extend by not returning a value but rather writing it to memory.

Similar for andc-splitter-2.c sign extends are folded there, too.  Since
the test is not about 32- or 64-bit adjust the scan assembler directives
only.

gcc/testsuite/ChangeLog:

* gcc.target/s390/arch13/bitops-1.c: Do not return a 32bit value
but write it to memory.
* gcc.target/s390/arch13/bitops-2.c: Ditto.
* gcc.target/s390/md/andc-splitter-2.c: Adjust scan assembler
directive because sign extends are folded, now.

gcc/testsuite/gcc.target/s390/arch13/bitops-1.c
gcc/testsuite/gcc.target/s390/arch13/bitops-2.c
gcc/testsuite/gcc.target/s390/md/andc-splitter-2.c

index 8d84655f71cce19af9fa35df705c2ba1784f2b7a..41915a88f3319e6b9fb7d10b7f1df99a09a5fd06 100644 (file)
@@ -2,10 +2,12 @@
 
 /* and with complement */
 
-int
+int i32;
+
+void
 ncrk (int a, int b)
 {
-  return a & ~b;
+  i32 = a & ~b;
 }
 
 /* { dg-final { scan-assembler-times "\tncrk\t" 1 } } */
@@ -20,10 +22,10 @@ ncgrk (long long a, long long b)
 
 /* or with complement */
 
-int
+void
 ocrk (int a, int b)
 {
-  return a | ~b;
+  i32 = a | ~b;
 }
 
 /* { dg-final { scan-assembler-times "\tocrk\t" 1 } } */
@@ -38,10 +40,10 @@ ocgrk (long long a, long long b)
 
 /* nand */
 
-int
+void
 nnrk (int a, int b)
 {
-  return ~(a & b);
+  i32 = ~(a & b);
 }
 
 /* { dg-final { scan-assembler-times "\tnnrk\t" 1 } } */
@@ -56,10 +58,10 @@ nngrk (long long a, long long b)
 
 /* nor */
 
-int
+void
 nork (int a, int b)
 {
-  return ~(a | b);
+  i32 = ~(a | b);
 }
 
 /* { dg-final { scan-assembler-times "\tnork\t" 1 } } */
@@ -74,10 +76,10 @@ nogrk (long long a, long long b)
 
 /* nxor */
 
-int
+void
 nxrk (int a, int b)
 {
-  return ~(a ^ b);
+  i32 = ~(a ^ b);
 }
 
 /* { dg-final { scan-assembler-times "\tnxrk\t" 1 } } */
index 1bfada3b05abb526b77ccbe473c17f219845221c..db05309fcaed385a2c9d28c6a08ff766e3071581 100644 (file)
@@ -4,6 +4,8 @@
 
 /* and with complement */
 
+int i32;
+
 int
 ncrk (int a, int b)
 {
@@ -58,10 +60,10 @@ nngrk (long long a, long long b)
 
 /* nor */
 
-int
+void
 nork (int a, int b)
 {
-  return ~(a | b);
+  i32 = ~(a | b);
 }
 
 /* { dg-final { scan-assembler-times "\tnork\t" 1 } } */
index 03df7b214db11e58d58f96078d041724fe1d8d58..7d098d8d987ef921bf7ea226667e3972dc344f5a 100644 (file)
@@ -37,8 +37,8 @@ unsigned int andc_pp(unsigned int *a, unsigned int *b)
 /* { dg-final { scan-assembler ":36:.\* \{\\*andsi3_\(esa\|zarch\)\}" } } */
 /* { dg-final { scan-assembler ":36:.\* \{\\*xorsi3\}" } } */
 
-/* { dg-final { scan-assembler-times "\tnr\?k\?\t" 4 } } */
-/* { dg-final { scan-assembler-times "\txr\?k\?\t" 4 } } */
+/* { dg-final { scan-assembler-times "\tng\?r\?k\?\t" 4 } } */
+/* { dg-final { scan-assembler-times "\txg\?r\?k\?\t" 4 } } */
 
 int
 main (void)