brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · a928aa8 Raw
27 lines · c
1// Make sure that __cpuidex in cpuid.h doesn't conflict with the MS2// 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-gnu8// 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 13typedef __SIZE_TYPE__ size_t;14 15// We declare __cpuidex here as where the buitlin should be exposed (MSVC), the16// declaration is in <intrin.h>, but <intrin.h> is not available from all the17// targets that are being tested here.18IS_STATIC void __cpuidex (int[4], int, int);19 20#include <cpuid.h>21 22int cpuid_info[4];23 24void test_cpuidex(unsigned level, unsigned count) {25  __cpuidex(cpuid_info, level, count);26}27