Debian Codegraph @

clang/test/Headers/__cpuidex_conflict.c

raw
1 // Make sure that __cpuidex in cpuid.h doesn't conflict with the MS
2 // extensions built in by ensuring compilation succeeds:
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
8 // RUN: %clang_cc1 -DIS_STATIC="" -triple nvptx64-nvidia-cuda -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu x86-64 -fcuda-is-device -x cuda %s -o -
9 // RUN: %clang_cc1 -DIS_STATIC="" -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu x86-64 -fcuda-is-device -x cuda %s -o -
10 // RUN: %clang_cc1 -DIS_STATIC="" -triple spirv64 -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu x86-64 -fcuda-is-device -x cuda %s -o -
11 // RUN: %clang_cc1 -DIS_STATIC="" -triple spirv64 -aux-triple x86_64-unknown-linux-gnu -aux-target-cpu x86-64 -fsycl-is-device %s -o -
12
13 typedef __SIZE_TYPE__ size_t;
14
15 // We declare __cpuidex here as where the buitlin should be exposed (MSVC), the
16 // declaration is in <intrin.h>, but <intrin.h> is not available from all the
17 // targets that are being tested here.
18 IS_STATIC void __cpuidex (int[4], int, int);
19
20 #include <cpuid.h>
21
22 int cpuid_info[4];
23
24 void test_cpuidex(unsigned level, unsigned count) {
25 __cpuidex(cpuid_info, level, count);
26 }