57 lines · plain
1; Check that command line option "-disable-tail-calls" overrides function2; attribute "disable-tail-calls".3 4; RUN: llc < %s -mtriple=riscv32-unknown-elf \5; RUN: | FileCheck %s --check-prefixes=CALLER1,NOTAIL6; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \7; RUN: | FileCheck %s --check-prefixes=CALLER1,NOTAIL8; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \9; RUN: | FileCheck %s --check-prefixes=CALLER1,TAIL10 11; RUN: llc < %s -mtriple=riscv32-unknown-elf \12; RUN: | FileCheck %s --check-prefixes=CALLER2,TAIL13; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \14; RUN: | FileCheck %s --check-prefixes=CALLER2,NOTAIL15; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \16; RUN: | FileCheck %s --check-prefixes=CALLER2,TAIL17 18; RUN: llc < %s -mtriple=riscv32-unknown-elf \19; RUN: | FileCheck %s --check-prefixes=CALLER3,TAIL20; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \21; RUN: | FileCheck %s --check-prefixes=CALLER3,NOTAIL22; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \23; RUN: | FileCheck %s --check-prefixes=CALLER3,TAIL24 25; CALLER1-LABEL: {{\_?}}caller126; CALLER2-LABEL: {{\_?}}caller227; CALLER3-LABEL: {{\_?}}caller328; NOTAIL-NOT: tail callee29; NOTAIL: call callee30; TAIL: tail callee31; TAIL-NOT: call callee32 33; Function with attribute #0 = { "disable-tail-calls"="true" }34define i32 @caller1(i32 %a) #0 {35entry:36 %call = tail call i32 @callee(i32 %a)37 ret i32 %call38}39 40; Function with attribute #1 = { "disable-tail-calls"="false" }41define i32 @caller2(i32 %a) #0 {42entry:43 %call = tail call i32 @callee(i32 %a)44 ret i32 %call45}46 47define i32 @caller3(i32 %a) {48entry:49 %call = tail call i32 @callee(i32 %a)50 ret i32 %call51}52 53declare i32 @callee(i32)54 55attributes #0 = { "disable-tail-calls"="true" }56attributes #1 = { "disable-tail-calls"="false" }57