44 lines · c
1// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -O1 -emit-llvm %s -o - 2>&1 | \2// RUN: FileCheck %s --check-prefix=CHECK-NOSE --check-prefix=CHECK3// RUN: %clang_cc1 -triple thumbebv8m.base-none-eabi -O1 -emit-llvm %s -o - 2>&1 | \4// RUN: FileCheck %s --check-prefix=CHECK-NOSE --check-prefix=CHECK5// RUN: %clang_cc1 -triple thumbv8m.base-none-eabi -mcmse -O1 -emit-llvm %s -o - 2>&1 | \6// RUN: FileCheck %s --check-prefix=CHECK-SE --check-prefix=CHECK7// RUN: %clang_cc1 -triple thumbebv8m.base-none-eabi -mcmse -O1 -emit-llvm %s -o - 2>&1 | \8// RUN: FileCheck %s --check-prefix=CHECK-SE --check-prefix=CHECK9 10typedef void (*callback_t)(void) __attribute__((cmse_nonsecure_call));11typedef void callback2_t(void) __attribute__((cmse_nonsecure_call));12 13void f1(callback_t fptr)14{15 fptr();16}17 18void f2(callback2_t *fptr)19{20 fptr();21}22 23void f3(void) __attribute__((cmse_nonsecure_entry));24void f3(void)25{26}27 28void f4(void) __attribute__((cmse_nonsecure_entry))29{30}31 32// CHECK: define{{.*}} void @f1(ptr noundef readonly captures(none) %fptr) {{[^#]*}}#0 {33// CHECK: call void %fptr() #234// CHECK: define{{.*}} void @f2(ptr noundef readonly captures(none) %fptr) {{[^#]*}}#0 {35// CHECK: call void %fptr() #236// CHECK: define{{.*}} void @f3() {{[^#]*}}#1 {37// CHECK: define{{.*}} void @f4() {{[^#]*}}#1 {38 39// CHECK-NOSE-NOT: cmse_nonsecure_entry40// CHECK-NOSE-NOT: cmse_nonsecure_call41// CHECK-SE: attributes #0 = { nounwind42// CHECK-SE: attributes #1 = { {{.*}} "cmse_nonsecure_entry"43// CHECK-SE: attributes #2 = { {{.*}} "cmse_nonsecure_call"44