1 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=NO-OPTION
2 ; RUN: llc < %s -mtriple=x86_64-- -disable-tail-calls | FileCheck %s --check-prefix=DISABLE-TRUE
3 ; RUN: llc < %s -mtriple=x86_64-- -disable-tail-calls=false | FileCheck %s --check-prefix=DISABLE-FALSE
5 ; Check that command line option "-disable-tail-calls" overrides function
6 ; attribute "disable-tail-calls".
8 ; NO-OPTION-LABEL: {{\_?}}func_attr
9 ; NO-OPTION: callq {{\_?}}callee
11 ; DISABLE-FALSE-LABEL: {{\_?}}func_attr
12 ; DISABLE-FALSE: jmp {{\_?}}callee
14 ; DISABLE-TRUE-LABEL: {{\_?}}func_attr
15 ; DISABLE-TRUE: callq {{\_?}}callee
17 define tailcc i32 @func_attr(i32 %a) #0 {
19 %call = tail call tailcc i32 @callee(i32 %a)
23 ; NO-OPTION-LABEL: {{\_?}}func_noattr
24 ; NO-OPTION: jmp {{\_?}}callee
26 ; DISABLE-FALSE-LABEL: {{\_?}}func_noattr
27 ; DISABLE-FALSE: jmp {{\_?}}callee
29 ; DISABLE-TRUE-LABEL: {{\_?}}func_noattr
30 ; DISABLE-TRUE: callq {{\_?}}callee
32 define tailcc i32 @func_noattr(i32 %a) {
34 %call = tail call tailcc i32 @callee(i32 %a)
38 declare tailcc i32 @callee(i32)
40 attributes #0 = { "disable-tail-calls"="true" }