1
1
// RUN: %clang_cc1 %s -o - "-triple" "riscv32cheriot-unknown-cheriotrtos" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" | FileCheck %s
2
2
int foo (void );
3
+
3
4
// CHECK: define dso_local i32 @disabled() local_unnamed_addr addrspace(200) #[[DIS:[0-9]]]
4
- __attribute__((cheri_interrupt_state (disabled )))
5
+ __attribute__((cheriot_interrupt_state (disabled )))
5
6
int disabled (void )
6
7
{
7
8
return foo ();
8
9
}
9
10
10
11
// CHECK: define dso_local i32 @enabled() local_unnamed_addr addrspace(200) #[[EN:[0-9]]]
11
- __attribute__((cheri_interrupt_state (enabled )))
12
+ __attribute__((cheriot_interrupt_state (enabled )))
12
13
int enabled (void )
13
14
{
14
15
return foo ();
15
16
}
16
17
17
18
// CHECK: define dso_local i32 @inherit() local_unnamed_addr addrspace(200) #[[INH:[0-9]]]
18
- __attribute__((cheri_interrupt_state (inherit )))
19
+ __attribute__((cheriot_interrupt_state (inherit )))
19
20
int inherit (void )
20
21
{
21
22
return foo ();
@@ -39,20 +40,57 @@ void default_enable_callback(void)
39
40
// Explicitly setting interrupt status should override the default
40
41
41
42
// CHECK: define dso_local chericcallcce i32 @_Z23explicit_disable_calleev() local_unnamed_addr addrspace(200) #[[EXPDIS:[0-9]]]
42
- __attribute__((cheri_interrupt_state (disabled )))
43
+ __attribute__((cheriot_interrupt_state (disabled )))
43
44
__attribute__((cheri_compartment ("example" )))
44
45
int explicit_disable_callee (void )
45
46
{
46
47
return 0 ;
47
48
}
48
49
49
50
// CHECK: define dso_local chericcallcc void @explicit_disable_callback() local_unnamed_addr addrspace(200) #[[EXPDIS]]
50
- __attribute__((cheri_interrupt_state (disabled )))
51
+ __attribute__((cheriot_interrupt_state (disabled )))
51
52
__attribute__((cheri_ccallback ))
52
53
void explicit_disable_callback (void )
53
54
{
54
55
}
55
56
57
+ // Check deprecated spellings
58
+
59
+ // CHECK: define dso_local i32 @disabled1() local_unnamed_addr addrspace(200) #[[DIS]]
60
+ __attribute__((cheri_interrupt_state (disabled )))
61
+ int disabled1 (void )
62
+ {
63
+ return foo ();
64
+ }
65
+
66
+ // CHECK: define dso_local i32 @enabled1() local_unnamed_addr addrspace(200) #[[EN]]
67
+ __attribute__((cheri_interrupt_state (enabled )))
68
+ int enabled1 (void )
69
+ {
70
+ return foo ();
71
+ }
72
+
73
+ // CHECK: define dso_local i32 @inherit1() local_unnamed_addr addrspace(200) #[[INH]]
74
+ __attribute__((cheri_interrupt_state (inherit )))
75
+ int inherit1 (void )
76
+ {
77
+ return foo ();
78
+ }
79
+
80
+ // CHECK: define dso_local chericcallcce i32 @_Z24explicit_disable_callee1v() local_unnamed_addr addrspace(200) #[[EXPDIS]]
81
+ __attribute__((cheri_interrupt_state (disabled )))
82
+ __attribute__((cheri_compartment ("example" )))
83
+ int explicit_disable_callee1 (void )
84
+ {
85
+ return 0 ;
86
+ }
87
+
88
+ // CHECK: define dso_local chericcallcc void @explicit_disable_callback1() local_unnamed_addr addrspace(200) #[[EXPDIS]]
89
+ __attribute__((cheri_interrupt_state (disabled )))
90
+ __attribute__((cheri_ccallback ))
91
+ void explicit_disable_callback1 (void )
92
+ {
93
+ }
56
94
57
95
// CHECK: attributes #[[DIS]]
58
96
// CHECK-SAME: "interrupt-state"="disabled"
0 commit comments