1 // REQUIRES: arm-registered-target
2 // RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s
3 
4 void *f0()
5 {
6   return __builtin_thread_pointer();
7 }
8 
9 void f1(char *a, char *b) {
10 	__clear_cache(a,b);
11 }
12 
13 // CHECK: call {{.*}} @__clear_cache
14 
15 void test_eh_return_data_regno()
16 {
17   volatile int res;
18   res = __builtin_eh_return_data_regno(0);  // CHECK: store volatile i32 0
19   res = __builtin_eh_return_data_regno(1);  // CHECK: store volatile i32 1
20 }
21 
22 void sevl() {
23   __builtin_arm_sevl();
24 }
25 // CHECK: call {{.*}} @llvm.arm.sevl
26 
27 void test_barrier() {
28   __builtin_arm_dmb(1); //CHECK: call {{.*}} @llvm.arm.dmb(i32 1)
29   __builtin_arm_dsb(2); //CHECK: call {{.*}} @llvm.arm.dsb(i32 2)
30 }
31