54 lines · plain
1;; This test checks if CFI instructions for all callee saved registers are emitted2;; correctly with basic block sections.3; RUN: llc %s -mtriple=x86_64 -filetype=asm --basic-block-sections=all --frame-pointer=all -o - | FileCheck --check-prefix=SECTIONS_CFI %s4 5; SECTIONS_CFI: _Z3foob:6; SECTIONS_CFI: .cfi_offset %rbp, -167; SECTIONS_CFI: .cfi_offset [[RA:%r.+]], -568; SECTIONS_CFI-NEXT: .cfi_offset [[RB:%r.+]], -489; SECTIONS_CFI-NEXT: .cfi_offset [[RC:%r.+]], -4010; SECTIONS_CFI-NEXT: .cfi_offset [[RD:%r.+]], -3211; SECTIONS_CFI-NEXT: .cfi_offset [[RE:%r.+]], -2412 13; SECTIONS_CFI: _Z3foob.__part.1:14; SECTIONS_CFI: .cfi_offset %rbp, -1615; SECTIONS_CFI: .cfi_offset [[RA]], -5616; SECTIONS_CFI-NEXT: .cfi_offset [[RB]], -4817; SECTIONS_CFI-NEXT: .cfi_offset [[RC]], -4018; SECTIONS_CFI-NEXT: .cfi_offset [[RD]], -3219; SECTIONS_CFI-NEXT: .cfi_offset [[RE]], -2420 21; SECTIONS_CFI: _Z3foob.__part.2:22; SECTIONS_CFI: .cfi_offset %rbp, -1623; SECTIONS_CFI: .cfi_offset [[RA]], -5624; SECTIONS_CFI-NEXT: .cfi_offset [[RB]], -4825; SECTIONS_CFI-NEXT: .cfi_offset [[RC]], -4026; SECTIONS_CFI-NEXT: .cfi_offset [[RD]], -3227; SECTIONS_CFI-NEXT: .cfi_offset [[RE]], -2428 29 30;; void foo(bool b) {31;; if (b) // adds a basic block32;; // clobber all callee-save registers to force them to be callee-saved and to33;; // be described by cfi_offset directives.34;; asm("nop" ::: "r12", "r13", "r14", "r15", "rbx");35;; }36 37define dso_local void @_Z3foob(i1 zeroext %b) {38entry:39 %b.addr = alloca i8, align 140 %frombool = zext i1 %b to i841 store i8 %frombool, ptr %b.addr, align 142 %0 = load i8, ptr %b.addr, align 143 %tobool = trunc i8 %0 to i144 br i1 %tobool, label %if.then, label %if.end45 46if.then: ; preds = %entry47 call void asm sideeffect "nop", "~{r12},~{r13},~{r14},~{r15},~{rbx},~{dirflag},~{fpsr},~{flags}"() #1, !srcloc !248 br label %if.end49 50if.end: ; preds = %if.then, %entry51 ret void52}53!2 = !{i32 38}54