; RUN: llc -mtriple riscv32 -mattr=+experimental-zicfilp,+relax,+c < %s | FileCheck %s ; RUN: llc -mtriple riscv64 -mattr=+experimental-zicfilp,+relax,+c < %s | FileCheck %s ; Test that when Zicfilp is enabled but the cf-protection-branch module flag ; is NOT set, no LPAD is inserted AFTER the setjmp call and no .option push/exact ; workaround is applied. The function entry LPAD is still generated by Zicfilp, ; but the special returns_twice handling is not triggered. declare i32 @setjmp(ptr) returns_twice define i32 @test_no_cf_protection() { ; CHECK-LABEL: test_no_cf_protection: ; CHECK-NOT: .option exact ; CHECK: call setjmp ; Verify no lpad immediately after setjmp (next instruction is register reload). ; Use regex to match both lw (RV32) and ld (RV64). ; CHECK-NEXT: {{(lw|ld)}} ra, %buf = alloca [1 x i32], align 4 %call = call i32 @setjmp(ptr %buf) ret i32 %call } ; Note: No !llvm.module.flags with cf-protection-branch - this is intentional.