1 ; Check that command line option "-disable-tail-calls" overrides function
2 ; attribute "disable-tail-calls".
4 ; RUN: llc < %s -mtriple=riscv32-unknown-elf \
5 ; RUN: | FileCheck %s --check-prefixes=CALLER1,NOTAIL
6 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \
7 ; RUN: | FileCheck %s --check-prefixes=CALLER1,NOTAIL
8 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \
9 ; RUN: | FileCheck %s --check-prefixes=CALLER1,TAIL
11 ; RUN: llc < %s -mtriple=riscv32-unknown-elf \
12 ; RUN: | FileCheck %s --check-prefixes=CALLER2,TAIL
13 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \
14 ; RUN: | FileCheck %s --check-prefixes=CALLER2,NOTAIL
15 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \
16 ; RUN: | FileCheck %s --check-prefixes=CALLER2,TAIL
18 ; RUN: llc < %s -mtriple=riscv32-unknown-elf \
19 ; RUN: | FileCheck %s --check-prefixes=CALLER3,TAIL
20 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls \
21 ; RUN: | FileCheck %s --check-prefixes=CALLER3,NOTAIL
22 ; RUN: llc < %s -mtriple=riscv32-unknown-elf -disable-tail-calls=false \
23 ; RUN: | FileCheck %s --check-prefixes=CALLER3,TAIL
25 ; CALLER1-LABEL: {{\_?}}caller1
26 ; CALLER2-LABEL: {{\_?}}caller2
27 ; CALLER3-LABEL: {{\_?}}caller3
28 ; NOTAIL-NOT: tail callee
31 ; TAIL-NOT: call callee
33 ; Function with attribute #0 = { "disable-tail-calls"="true" }
34 define i32 @caller1(i32 %a) #0 {
36 %call = tail call i32 @callee(i32 %a)
40 ; Function with attribute #1 = { "disable-tail-calls"="false" }
41 define i32 @caller2(i32 %a) #0 {
43 %call = tail call i32 @callee(i32 %a)
47 define i32 @caller3(i32 %a) {
49 %call = tail call i32 @callee(i32 %a)
53 declare i32 @callee(i32)
55 attributes #0 = { "disable-tail-calls"="true" }
56 attributes #1 = { "disable-tail-calls"="false" }