1 // RUN: %clang_cc1 -triple thumbv8m.base-unknown-unknown-eabi -emit-llvm -mrelocation-model static -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple thumbebv8m.base-unknown-unknown-eabi -emit-llvm -mrelocation-model static -o - %s | FileCheck %s
6 unsigned test_cmse_primitives(void *p
) {
7 // CHECK: define {{.*}} i32 @test_cmse_primitives
8 cmse_address_info_t tt_val
, ttt_val
;
12 ttt_val
= cmse_TTT(p
);
13 // CHECK: call i32 @llvm.arm.cmse.tt
14 // CHECK: call i32 @llvm.arm.cmse.ttt
15 // CHECK-NOT: llvm.arm.cmse.tta
16 // CHECK-NOT: llvm.arm.cmse.ttat
21 sum
+= tt_val
.flags
.mpu_region
;
22 sum
+= tt_val
.flags
.mpu_region_valid
;
23 sum
+= tt_val
.flags
.read_ok
;
24 sum
+= tt_val
.flags
.readwrite_ok
;
29 void *test_address_range(void *p
) {
30 // CHECK: define {{.*}} ptr @test_address_range
31 return cmse_check_address_range(p
, 128, CMSE_MPU_UNPRIV
34 // CHECK: call i32 @llvm.arm.cmse.tt
35 // CHECK: call i32 @llvm.arm.cmse.ttt
36 // CHECK-NOT: llvm.arm.cmse.tta
37 // CHECK-NOT: llvm.arm.cmse.ttat
44 void *test_pointed_object(void *p
) {
45 // CHECK: define {{.*}} ptr @test_pointed_object
46 Point
*pt
= (Point
*)p
;
47 cmse_check_pointed_object(pt
, CMSE_MPU_READ
);
48 // CHECK: call i32 @llvm.arm.cmse.tt
49 // CHECK: call i32 @llvm.arm.cmse.ttt
50 // CHECK-NOT: call i32 @llvm.arm.cmse.tta
51 // CHECK-NOT: call i32 @llvm.arm.cmse.ttat