xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/arm-microsoft-intrinsics.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple thumbv7-windows -fms-compatibility -emit-llvm -o - %s \
2*0a6a1f1dSLionel Sambuc // RUN:    | FileCheck %s -check-prefix CHECK-MSVC
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc // RUN: not %clang_cc1 -triple armv7-eabi -Werror -S -o /dev/null %s 2>&1 \
5*0a6a1f1dSLionel Sambuc // RUN:    | FileCheck %s -check-prefix CHECK-EABI
6*0a6a1f1dSLionel Sambuc 
check__dmb(void)7*0a6a1f1dSLionel Sambuc void check__dmb(void) {
8*0a6a1f1dSLionel Sambuc   __dmb(0);
9*0a6a1f1dSLionel Sambuc }
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.dmb(i32 0)
12*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '__dmb'
13*0a6a1f1dSLionel Sambuc 
check__dsb(void)14*0a6a1f1dSLionel Sambuc void check__dsb(void) {
15*0a6a1f1dSLionel Sambuc   __dsb(0);
16*0a6a1f1dSLionel Sambuc }
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.dsb(i32 0)
19*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '__dsb'
20*0a6a1f1dSLionel Sambuc 
check__isb(void)21*0a6a1f1dSLionel Sambuc void check__isb(void) {
22*0a6a1f1dSLionel Sambuc   __isb(0);
23*0a6a1f1dSLionel Sambuc }
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.isb(i32 0)
26*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '__isb'
27*0a6a1f1dSLionel Sambuc 
check__ldrexd(void)28*0a6a1f1dSLionel Sambuc __INT64_TYPE__ check__ldrexd(void) {
29*0a6a1f1dSLionel Sambuc   __INT64_TYPE__ i64;
30*0a6a1f1dSLionel Sambuc   return __ldrexd(&i64);
31*0a6a1f1dSLionel Sambuc }
32*0a6a1f1dSLionel Sambuc 
33*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.ldrexd(i8* {{.*}})
34*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '__ldrexd'
35*0a6a1f1dSLionel Sambuc 
check_MoveFromCoprocessor(void)36*0a6a1f1dSLionel Sambuc unsigned int check_MoveFromCoprocessor(void) {
37*0a6a1f1dSLionel Sambuc   return _MoveFromCoprocessor(0, 0, 0, 0, 0);
38*0a6a1f1dSLionel Sambuc }
39*0a6a1f1dSLionel Sambuc 
40*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.mrc(i32 0, i32 0, i32 0, i32 0, i32 0)
41*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '_MoveFromCoprocessor'
42*0a6a1f1dSLionel Sambuc 
check_MoveFromCoprocessor2(void)43*0a6a1f1dSLionel Sambuc unsigned int check_MoveFromCoprocessor2(void) {
44*0a6a1f1dSLionel Sambuc   return _MoveFromCoprocessor2(0, 0, 0, 0, 0);
45*0a6a1f1dSLionel Sambuc }
46*0a6a1f1dSLionel Sambuc 
47*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.mrc2(i32 0, i32 0, i32 0, i32 0, i32 0)
48*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '_MoveFromCoprocessor2'
49*0a6a1f1dSLionel Sambuc 
check_MoveToCoprocessor(void)50*0a6a1f1dSLionel Sambuc void check_MoveToCoprocessor(void) {
51*0a6a1f1dSLionel Sambuc   _MoveToCoprocessor(0, 0, 0, 0, 0, 0);
52*0a6a1f1dSLionel Sambuc }
53*0a6a1f1dSLionel Sambuc 
54*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.mcr(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
55*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '_MoveToCoprocessor'
56*0a6a1f1dSLionel Sambuc 
check_MoveToCoprocessor2(void)57*0a6a1f1dSLionel Sambuc void check_MoveToCoprocessor2(void) {
58*0a6a1f1dSLionel Sambuc   _MoveToCoprocessor2(0, 0, 0, 0, 0, 0);
59*0a6a1f1dSLionel Sambuc }
60*0a6a1f1dSLionel Sambuc 
61*0a6a1f1dSLionel Sambuc // CHECK-MSVC: @llvm.arm.mcr2(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
62*0a6a1f1dSLionel Sambuc // CHECK-EABI: error: implicit declaration of function '_MoveToCoprocessor2'
63*0a6a1f1dSLionel Sambuc 
64