• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=arm-unknown-unknown | FileCheck %s --check-prefix=NO-OPTION
2; RUN: llc < %s -mtriple=arm-unknown-unknown -disable-tail-calls | FileCheck %s --check-prefix=DISABLE-TRUE
3; RUN: llc < %s -mtriple=arm-unknown-unknown -disable-tail-calls=false | FileCheck %s --check-prefix=DISABLE-FALSE
4
5; Check that command line option "-disable-tail-calls" overrides function
6; attribute "disable-tail-calls".
7
8; NO-OPTION-LABEL: {{\_?}}func_attr
9; NO-OPTION: bl {{\_?}}callee
10
11; DISABLE-FALSE-LABEL: {{\_?}}func_attr
12; DISABLE-FALSE: b {{\_?}}callee
13
14; DISABLE-TRUE-LABEL: {{\_?}}func_attr
15; DISABLE-TRUE: bl {{\_?}}callee
16
17define i32 @func_attr(i32 %a) #0 {
18entry:
19  %call = tail call i32 @callee(i32 %a)
20  ret i32 %call
21}
22
23; NO-OPTION-LABEL: {{\_?}}func_noattr
24; NO-OPTION: b {{\_?}}callee
25
26; DISABLE-FALSE-LABEL: {{\_?}}func_noattr
27; DISABLE-FALSE: b {{\_?}}callee
28
29; DISABLE-TRUE-LABEL: {{\_?}}func_noattr
30; DISABLE-TRUE: bl {{\_?}}callee
31
32define i32 @func_noattr(i32 %a) {
33entry:
34  %call = tail call i32 @callee(i32 %a)
35  ret i32 %call
36}
37
38declare i32 @callee(i32)
39
40attributes #0 = { "disable-tail-calls"="true" }
41