1 ; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s --check-prefix=NOBTI
2 ; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=NOBTI
3 ; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel < %s | FileCheck %s --check-prefix=NOBTI
4 ; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+no-bti-at-return-twice < %s | \
5 ; RUN: FileCheck %s --check-prefix=NOBTI
6 ; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -mattr=+no-bti-at-return-twice < %s | \
7 ; RUN: FileCheck %s --check-prefix=NOBTI
8 ; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -mattr=+no-bti-at-return-twice < %s | \
9 ; RUN: FileCheck %s --check-prefix=NOBTI
11 ; Same as setjmp-bti.ll except that we do not enable branch target enforcement for this
12 ; module. There should be no combination of options that leads to a bti being emitted.
16 ; extern int setjmp(ptr);
17 ; extern void notsetjmp(void);
21 ; int (*fnptr)(ptr) = setjmp;
30 ; NOBTI: blr x{{[0-9]+}}
36 %fnptr = alloca ptr, align 8
37 %call = call i32 @setjmp(ptr noundef null) #0
38 store ptr @setjmp, ptr %fnptr, align 8
39 %0 = load ptr, ptr %fnptr, align 8
40 %call1 = call i32 %0(ptr noundef null) #0
41 call void @notsetjmp()
45 declare i32 @setjmp(ptr noundef) #0
46 declare void @notsetjmp()
48 attributes #0 = { returns_twice }
50 ; !llvm.module.flags = !{!0}
51 ; !0 = !{i32 8, !"branch-target-enforcement", i32 1}