From: Pan Li <pan2...@intel.com>

Move the run test of pr116278 to c-torture and leave the risc-v the
asm check under risc-v part.

        PR target/116278

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/pr116278-run-1.c: Take compile instead of
        run test.
        * gcc.target/riscv/pr116278-run-2.c: Ditto.
        * gcc.c-torture/execute/pr116278-run-1.c: New test.
        * gcc.c-torture/execute/pr116278-run-2.c: New test.

Signed-off-by: Pan Li <pan2...@intel.com>
---
 .../gcc.c-torture/execute/pr116278-run-1.c     | 18 ++++++++++++++++++
 .../gcc.c-torture/execute/pr116278-run-2.c     | 18 ++++++++++++++++++
 .../gcc.target/riscv/pr116278-run-1.c          |  2 +-
 .../gcc.target/riscv/pr116278-run-2.c          |  2 +-
 4 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr116278-run-1.c
 create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr116278-run-2.c

diff --git a/gcc/testsuite/gcc.c-torture/execute/pr116278-run-1.c 
b/gcc/testsuite/gcc.c-torture/execute/pr116278-run-1.c
new file mode 100644
index 00000000000..fa5340c9d58
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr116278-run-1.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdint-gcc.h>
+
+int8_t b[1];
+int8_t *d = b;
+int32_t c;
+
+int main() {
+  b[0] = -40;
+  uint16_t t = (uint16_t)d[0];
+
+  c = (t < 0xFFF6 ? t : 0xFFF6) + 9;
+
+  if (c != 65505)
+    __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr116278-run-2.c 
b/gcc/testsuite/gcc.c-torture/execute/pr116278-run-2.c
new file mode 100644
index 00000000000..65439d614a1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr116278-run-2.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdint-gcc.h>
+
+int16_t b[1];
+int16_t *d = b;
+int64_t c;
+
+int main() {
+  b[0] = -40;
+  uint32_t t = (uint32_t)d[0];
+
+  c = (t < 0xFFFFFFF6u ? t : 0xFFFFFFF6u) + 9;
+
+  if (c != 4294967265)
+    __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.target/riscv/pr116278-run-1.c 
b/gcc/testsuite/gcc.target/riscv/pr116278-run-1.c
index d3812bdcdfb..c758fca7975 100644
--- a/gcc/testsuite/gcc.target/riscv/pr116278-run-1.c
+++ b/gcc/testsuite/gcc.target/riscv/pr116278-run-1.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { riscv_v } } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fdump-rtl-expand-details" } */
 
 #include <stdint-gcc.h>
diff --git a/gcc/testsuite/gcc.target/riscv/pr116278-run-2.c 
b/gcc/testsuite/gcc.target/riscv/pr116278-run-2.c
index 669cd4f003f..a4da8a323f0 100644
--- a/gcc/testsuite/gcc.target/riscv/pr116278-run-2.c
+++ b/gcc/testsuite/gcc.target/riscv/pr116278-run-2.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { riscv_v } } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fdump-rtl-expand-details" } */
 
 #include <stdint-gcc.h>
-- 
2.43.0

Reply via email to