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