]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP: Fix "begin declare variant" test failure with -m32
authorSandra Loosemore <sloosemore@baylibre.com>
Sun, 23 Nov 2025 03:29:34 +0000 (03:29 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Sun, 23 Nov 2025 03:38:48 +0000 (03:38 +0000)
As reported by Haochen Jiang, this recently-added test case was
failing on x86_64 with -m32; the target hook for matching the "arch"
selector won't match "x86_64" in that case, even if gcc was configured
for that target.  It does match plain "x86" for both 64 and 32 bit targets,
so I've switched the testcase to use that instead.

Committed as obvious (at least in retrospect).

gcc/testsuite/ChangeLog
* c-c++-common/gomp/delim-declare-variant-6.c (f3): Use "x86"
instead of "x86_64" in the arch selector, to match both 64- and
32-bit targets.

gcc/testsuite/c-c++-common/gomp/delim-declare-variant-6.c

index 0f87118d01766e0fd1b0d8ca43d532d6f6984d2a..085006302613fada4825128a37b9787fb5d44d29 100644 (file)
@@ -36,12 +36,12 @@ int f2 (int x) { return -x; }
 /* Check that non-duplicate traits are collected from both inner and outer.  */
 
 #pragma omp begin declare variant match (device={kind("host")})
-#pragma omp begin declare variant match (device={arch("x86_64")})
+#pragma omp begin declare variant match (device={arch("x86")})
 int f3 (int x) { return -x; }
 #pragma omp end declare variant
 #pragma omp end declare variant
 /* { dg-final { scan-tree-dump "f3\\.ompvariant.*kind \\(.host.\\)" "gimple" } } */
-/* { dg-final { scan-tree-dump "f3\\.ompvariant.*arch \\(.x86_64.\\)" "gimple" } } */
+/* { dg-final { scan-tree-dump "f3\\.ompvariant.*arch \\(.x86.\\)" "gimple" } } */
 
 /* Check that traits for construct selectors merge as expected.  */