diff mbox series

[v2] Test: Move pr116278 run test to dg/torture [NFC]

Message ID 20240819020430.1041509-2-pan2.li@intel.com
State New
Headers show
Series [v2] Test: Move pr116278 run test to dg/torture [NFC] | expand

Commit Message

Li, Pan2 Aug. 19, 2024, 2:04 a.m. UTC
From: Pan Li <pan2.li@intel.com>

Move the run test of pr116278 to dg/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.
	* gcc.target/riscv/pr116278-run-2.c: Ditto.
	* gcc.dg/torture/pr116278-run-1.c: New test.
	* gcc.dg/torture/pr116278-run-2.c: New test.

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

Comments

Li, Pan2 Aug. 28, 2024, 1:17 a.m. UTC | #1
Kindly ping.

Pan

-----Original Message-----
From: Li, Pan2 <pan2.li@intel.com> 
Sent: Monday, August 19, 2024 10:05 AM
To: gcc-patches@gcc.gnu.org
Cc: juzhe.zhong@rivai.ai; kito.cheng@gmail.com; jeffreyalaw@gmail.com; rdapp.gcc@gmail.com; Li, Pan2 <pan2.li@intel.com>
Subject: [PATCH v2] Test: Move pr116278 run test to dg/torture [NFC]

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

Move the run test of pr116278 to dg/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.
	* gcc.target/riscv/pr116278-run-2.c: Ditto.
	* gcc.dg/torture/pr116278-run-1.c: New test.
	* gcc.dg/torture/pr116278-run-2.c: New test.

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

diff --git a/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
new file mode 100644
index 00000000000..8e07fb6af29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32 } */
+/* { 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.dg/torture/pr116278-run-2.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
new file mode 100644
index 00000000000..d85e21531e1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32 } */
+/* { 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>
Richard Biener Aug. 28, 2024, 7:23 a.m. UTC | #2
On Wed, Aug 28, 2024 at 3:18 AM Li, Pan2 <pan2.li@intel.com> wrote:
>
> Kindly ping.

Please do not include stdint-gcc.h but stdint.h.

otherwise OK.

Richard.

> Pan
>
> -----Original Message-----
> From: Li, Pan2 <pan2.li@intel.com>
> Sent: Monday, August 19, 2024 10:05 AM
> To: gcc-patches@gcc.gnu.org
> Cc: juzhe.zhong@rivai.ai; kito.cheng@gmail.com; jeffreyalaw@gmail.com; rdapp.gcc@gmail.com; Li, Pan2 <pan2.li@intel.com>
> Subject: [PATCH v2] Test: Move pr116278 run test to dg/torture [NFC]
>
> From: Pan Li <pan2.li@intel.com>
>
> Move the run test of pr116278 to dg/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.
>         * gcc.target/riscv/pr116278-run-2.c: Ditto.
>         * gcc.dg/torture/pr116278-run-1.c: New test.
>         * gcc.dg/torture/pr116278-run-2.c: New test.
>
> Signed-off-by: Pan Li <pan2.li@intel.com>
> ---
>  gcc/testsuite/gcc.dg/torture/pr116278-run-1.c | 19 +++++++++++++++++++
>  gcc/testsuite/gcc.dg/torture/pr116278-run-2.c | 19 +++++++++++++++++++
>  .../gcc.target/riscv/pr116278-run-1.c         |  2 +-
>  .../gcc.target/riscv/pr116278-run-2.c         |  2 +-
>  4 files changed, 40 insertions(+), 2 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
>  create mode 100644 gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
>
> diff --git a/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
> new file mode 100644
> index 00000000000..8e07fb6af29
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-require-effective-target int32 } */
> +/* { 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.dg/torture/pr116278-run-2.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
> new file mode 100644
> index 00000000000..d85e21531e1
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-require-effective-target int32 } */
> +/* { 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
>
Li, Pan2 Aug. 28, 2024, 7:27 a.m. UTC | #3
Noted with thanks, will commit with that change if no surprise from test.

Pan

-----Original Message-----
From: Richard Biener <richard.guenther@gmail.com> 
Sent: Wednesday, August 28, 2024 3:24 PM
To: Li, Pan2 <pan2.li@intel.com>
Cc: gcc-patches@gcc.gnu.org; juzhe.zhong@rivai.ai; kito.cheng@gmail.com; jeffreyalaw@gmail.com; rdapp.gcc@gmail.com
Subject: Re: [PATCH v2] Test: Move pr116278 run test to dg/torture [NFC]

On Wed, Aug 28, 2024 at 3:18 AM Li, Pan2 <pan2.li@intel.com> wrote:
>
> Kindly ping.

Please do not include stdint-gcc.h but stdint.h.

otherwise OK.

Richard.

> Pan
>
> -----Original Message-----
> From: Li, Pan2 <pan2.li@intel.com>
> Sent: Monday, August 19, 2024 10:05 AM
> To: gcc-patches@gcc.gnu.org
> Cc: juzhe.zhong@rivai.ai; kito.cheng@gmail.com; jeffreyalaw@gmail.com; rdapp.gcc@gmail.com; Li, Pan2 <pan2.li@intel.com>
> Subject: [PATCH v2] Test: Move pr116278 run test to dg/torture [NFC]
>
> From: Pan Li <pan2.li@intel.com>
>
> Move the run test of pr116278 to dg/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.
>         * gcc.target/riscv/pr116278-run-2.c: Ditto.
>         * gcc.dg/torture/pr116278-run-1.c: New test.
>         * gcc.dg/torture/pr116278-run-2.c: New test.
>
> Signed-off-by: Pan Li <pan2.li@intel.com>
> ---
>  gcc/testsuite/gcc.dg/torture/pr116278-run-1.c | 19 +++++++++++++++++++
>  gcc/testsuite/gcc.dg/torture/pr116278-run-2.c | 19 +++++++++++++++++++
>  .../gcc.target/riscv/pr116278-run-1.c         |  2 +-
>  .../gcc.target/riscv/pr116278-run-2.c         |  2 +-
>  4 files changed, 40 insertions(+), 2 deletions(-)
>  create mode 100644 gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
>  create mode 100644 gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
>
> diff --git a/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
> new file mode 100644
> index 00000000000..8e07fb6af29
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-require-effective-target int32 } */
> +/* { 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.dg/torture/pr116278-run-2.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
> new file mode 100644
> index 00000000000..d85e21531e1
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
> @@ -0,0 +1,19 @@
> +/* { dg-do run } */
> +/* { dg-require-effective-target int32 } */
> +/* { 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
>
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
new file mode 100644
index 00000000000..8e07fb6af29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-1.c
@@ -0,0 +1,19 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target int32 } */
+/* { 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.dg/torture/pr116278-run-2.c b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
new file mode 100644
index 00000000000..d85e21531e1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr116278-run-2.c
@@ -0,0 +1,19 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target int32 } */
+/* { 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>