Home | History | Annotate | Download | only in CodeGen
      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 
      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 
     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 
     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 
     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 
     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 
     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 
     50 void check_MoveToCoprocessor(void) {
     51   _MoveToCoprocessor(0, 0, 0, 0, 0, 0);
     52 }
     53 
     54 // CHECK-MSVC: @llvm.arm.mcr(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
     55 // CHECK-EABI: error: implicit declaration of function '_MoveToCoprocessor'
     56 
     57 void check_MoveToCoprocessor2(void) {
     58   _MoveToCoprocessor2(0, 0, 0, 0, 0, 0);
     59 }
     60 
     61 // CHECK-MSVC: @llvm.arm.mcr2(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
     62 // CHECK-EABI: error: implicit declaration of function '_MoveToCoprocessor2'
     63 
     64