brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 6124d31 Raw
52 lines · plain
1; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s --check-prefix=NOBTI2; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=NOBTI3; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel < %s | FileCheck %s --check-prefix=NOBTI4; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+no-bti-at-return-twice < %s | \5; RUN: FileCheck %s --check-prefix=NOBTI6; RUN: llc -mtriple=aarch64-none-linux-gnu -global-isel -mattr=+no-bti-at-return-twice < %s | \7; RUN: FileCheck %s --check-prefix=NOBTI8; RUN: llc -mtriple=aarch64-none-linux-gnu -fast-isel -mattr=+no-bti-at-return-twice < %s | \9; RUN: FileCheck %s --check-prefix=NOBTI10 11; Same as setjmp-bti.ll except that we do not enable branch target enforcement for this12; module. There should be no combination of options that leads to a bti being emitted.13 14; C source15; --------16; extern int setjmp(ptr);17; extern void notsetjmp(void);18;19; void bbb(void) {20;   setjmp(0);21;   int (*fnptr)(ptr) = setjmp;22;   fnptr(0);23;   notsetjmp();24; }25 26define void @bbb() {27; NOBTI-LABEL: bbb:28; NOBTI:     bl setjmp29; NOBTI-NOT: hint #3630; NOBTI:     blr x{{[0-9]+}}31; NOBTI-NOT: hint #3632; NOBTI:     bl notsetjmp33; NOBTI-NOT: hint #3634 35entry:36  %fnptr = alloca ptr, align 837  %call = call i32 @setjmp(ptr noundef null) #038  store ptr @setjmp, ptr %fnptr, align 839  %0 = load ptr, ptr %fnptr, align 840  %call1 = call i32 %0(ptr noundef null) #041  call void @notsetjmp()42  ret void43}44 45declare i32 @setjmp(ptr noundef) #046declare void @notsetjmp()47 48attributes #0 = { returns_twice }49 50; !llvm.module.flags = !{!0}51; !0 = !{i32 8, !"branch-target-enforcement", i32 1}52