]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/ms-intrinsics-cpuid.c
Vendor import of clang trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / CodeGen / ms-intrinsics-cpuid.c
1 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
2 // RUN:         -triple i686-windows-msvc -emit-llvm %s -o - | FileCheck %s
3 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
4 // RUN:         -triple x86_64-windows-msvc -emit-llvm %s -o - | FileCheck %s
5
6 // intrin.h needs size_t, but -ffreestanding prevents us from getting it from
7 // stddef.h.  Work around it with this typedef.
8 typedef __SIZE_TYPE__ size_t;
9
10 #include <intrin.h>
11
12 void test__cpuid(int *info, int level) {
13   __cpuid(info, level);
14 }
15 // CHECK-LABEL: define {{.*}} @test__cpuid(i32* %{{.*}}, i32 %{{.*}})
16 // CHECK: call { i32, i32, i32, i32 } asm "cpuid",
17 // CHECK-SAME:   "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"
18 // CHECK-SAME:   (i32 %{{.*}}, i32 0)