Skip to content

Commit 3b5aff5

Browse files
[clang][X86] Update __cpuidex_conflict.c test post #126324 (#151220)
It does not look like __cpuidex builtins are being incorrectly included in compilations for offload targets anymore, so change up the test to assume that we are defining __cpuidex as static in cpuid.h now that \#126324 updates the behavior of __has_builtin on offload compilations. This ensures we are still testing that we are avoiding the conflicts around offloading that were first pointed out in https://reviews.llvm.org/D150646.
1 parent a194d51 commit 3b5aff5

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
// Make sure that __cpuidex in cpuid.h doesn't conflict with the MS
22
// extensions built in by ensuring compilation succeeds:
3-
// RUN: %clang_cc1 %s -ffreestanding -fms-extensions -fms-compatibility \
4-
// RUN: -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o -
5-
// %clang_cc1 %s -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o -
6-
//
7-
// FIXME: See https://github.com/llvm/llvm-project/pull/121839 and
8-
// FIXME: https://github.com/llvm/llvm-project/pull/126324
9-
// RUN: not %clang_cc1 %s -ffreestanding -fopenmp -fopenmp-is-target-device -aux-triple x86_64-unknown-linux-gnu
3+
// RUN: %clang_cc1 %s -DIS_STATIC="" -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o -
4+
// RUN: %clang_cc1 %s -DIS_STATIC="" -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o -
5+
6+
// Ensure that we do not run into conflicts when offloading.
7+
// RUN: %clang_cc1 %s -DIS_STATIC=static -ffreestanding -fopenmp -fopenmp-is-target-device -aux-triple x86_64-unknown-linux-gnu
108

119
typedef __SIZE_TYPE__ size_t;
1210

1311
// We declare __cpuidex here as where the buitlin should be exposed (MSVC), the
1412
// declaration is in <intrin.h>, but <intrin.h> is not available from all the
1513
// targets that are being tested here.
16-
void __cpuidex (int[4], int, int);
14+
IS_STATIC void __cpuidex (int[4], int, int);
1715

1816
#include <cpuid.h>
1917

@@ -22,4 +20,3 @@ int cpuid_info[4];
2220
void test_cpuidex(unsigned level, unsigned count) {
2321
__cpuidex(cpuid_info, level, count);
2422
}
25-

0 commit comments

Comments
 (0)