]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[APX ZU] Fix test for target-support check
authorLingling Kong <lingling.kong@intel.com>
Mon, 17 Jun 2024 08:11:09 +0000 (16:11 +0800)
committerLingling Kong <lingling.kong@intel.com>
Mon, 17 Jun 2024 08:17:47 +0000 (16:17 +0800)
gcc/testsuite/ChangeLog:

* gcc.target/i386/apx-zu-1.c: Add attribute for noinline,
and target apx.
* gcc.target/i386/apx-zu-2.c: Add target-support check.

gcc/testsuite/gcc.target/i386/apx-zu-1.c
gcc/testsuite/gcc.target/i386/apx-zu-2.c

index 927a87673a7a3fca7b2cdb2b4778a7465b14d753..bc0e7fbb4dd61818dfd2c7bbc8560e4d9199bfd1 100644 (file)
@@ -9,26 +9,32 @@
 /* { dg-final { scan-assembler-times "setzue" 1} } */
 /* { dg-final { scan-assembler-times "setzuge" 1} } */
 /* { dg-final { scan-assembler "imulzu"} } */
+
+__attribute__((noinline, noclone, target("apxf")))
 long long foo0 (int a)
 {
   return a == 0 ? 0 : 1;
 }
 
+__attribute__((noinline, noclone, target("apxf")))
 long foo1 (int a, int b)
 {
   return a > b ? 0 : 1;
 }
 
+__attribute__((noinline, noclone, target("apxf")))
 int foo2 (int a, int b)
 {
   return a != b ? 0 : 1;
 }
 
+__attribute__((noinline, noclone, target("apxf")))
 short foo3 (int a, int b)
 {
   return a < b ? 0 : 1;
 }
 
+__attribute__((noinline, noclone, target("apxf")))
 unsigned long
 f1(unsigned short x)
 {
index 3ee04495d98a99924878646da21fd0918c6ccb3d..7585492bd7c245d5ea7f66ccdf552a1d07f1ab27 100644 (file)
@@ -5,6 +5,9 @@
 
 int main(void)
 {
+  if (!__builtin_cpu_supports ("apxf"))
+    return 0;
+
   if (foo0 (0))
     __builtin_abort ();
   if (foo1 (3, 2))