Skip to content

Commit

Permalink
Update CHERI clang tests for minor upstream changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
resistor committed Nov 6, 2024
1 parent 8e3ceaf commit a1e4a5f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions clang/test/CodeGen/cheri/cheri-mcu-call-libcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ int foo(void);

// CHECK: define dso_local i32 @callFromNotLibcall() local_unnamed_addr addrspace(200) #0 {
int callFromNotLibcall(void) {
// CHECK: call cherilibcallcc i32 @_Z3addii(i32 1, i32 2) #2
// CHECK: call cherilibcallcc i32 @_Z3addii(i32 noundef 1, i32 noundef 2) #2
// CHECK: call cherilibcallcc i32 @_Z3foov() #2
return add(1, 2) + foo();
}

// CHECK: declare cherilibcallcc i32 @_Z3addii(i32, i32) local_unnamed_addr addrspace(200) #1
// CHECK: declare cherilibcallcc i32 @_Z3addii(i32 noundef, i32 noundef) local_unnamed_addr addrspace(200) #1
// CHECK: declare cherilibcallcc i32 @_Z3foov() local_unnamed_addr addrspace(200) #1

// CHECK: attributes #0
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGen/cheri/cheri-mcu-ccall.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-xcheri-rvc" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" | FileCheck %s
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" | FileCheck %s

// CHECK: define dso_local chericcallcce i32 @_Z5test2ii(i32 %a0, i32 %a1) local_unnamed_addr addrspace(200) #0
// CHECK: define dso_local chericcallcce i32 @_Z5test2ii(i32 noundef %a0, i32 noundef %a1) local_unnamed_addr addrspace(200) #0
__attribute__((cheri_compartment("example"))) int test2(int a0, int a1) {
return a0 + a1;
}
Expand All @@ -20,7 +20,7 @@ int testcall6() {
&stack_arg);
}

// CHECK: declare chericcallcc i32 @_Z11test6calleePiS_S_S_S_S_(i32 addrspace(200)*, i32 addrspace(200)*, i32 addrspace(200)*, i32 addrspace(200)*, i32 addrspace(200)*, i32 addrspace(200)*) local_unnamed_addr addrspace(200) #3
// CHECK: declare chericcallcc i32 @_Z11test6calleePiS_S_S_S_S_(ptr addrspace(200) noundef, ptr addrspace(200) noundef, ptr addrspace(200) noundef, ptr addrspace(200) noundef, ptr addrspace(200) noundef, ptr addrspace(200) noundef) local_unnamed_addr addrspace(200) #3

// CHECK: attributes #0 = {
// CHECK-SAME: "cheri-compartment"="example"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/cheri/cheriot-variadic.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" -std=c2x | FileCheck %s
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" -std=c2x | FileCheck %s

typedef __builtin_va_list va_list;
#define va_start(v, l) __builtin_va_start((v), l)
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/cheri/cheri-mcu-interrupts.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-xcheri-rvc" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" | FileCheck %s
// RUN: %clang_cc1 %s -o - "-triple" "riscv32-unknown-unknown" "-emit-llvm" "-mframe-pointer=none" "-mcmodel=small" "-target-cpu" "cheriot" "-target-feature" "+xcheri" "-target-feature" "-64bit" "-target-feature" "-relax" "-target-feature" "-save-restore" "-target-abi" "cheriot" "-Oz" "-Werror" "-cheri-compartment=example" | FileCheck %s
int foo(void);
// CHECK: define dso_local i32 @_Z8disabledv() local_unnamed_addr addrspace(200) #[[DIS:[0-9]]]
// CHECK: define dso_local noundef i32 @_Z8disabledv() local_unnamed_addr addrspace(200) #[[DIS:[0-9]]]
[[cheri::interrupt_state(disabled)]]
int disabled(void)
{
return foo();
}

// CHECK: define dso_local i32 @_Z7enabledv() local_unnamed_addr addrspace(200) #[[EN:[0-9]]]
// CHECK: define dso_local noundef i32 @_Z7enabledv() local_unnamed_addr addrspace(200) #[[EN:[0-9]]]
[[cheri::interrupt_state(enabled)]]
int enabled(void)
{
return foo();
}

// CHECK: define dso_local i32 @_Z7inheritv() local_unnamed_addr addrspace(200) #[[INH:[0-9]]]
// CHECK: define dso_local noundef i32 @_Z7inheritv() local_unnamed_addr addrspace(200) #[[INH:[0-9]]]
[[cheri::interrupt_state(inherit)]]
int inherit(void)
{
Expand Down

0 comments on commit a1e4a5f

Please sign in to comment.