• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s -check-prefix=X86
2; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s -check-prefix=X64
3; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s -check-prefix=WIN64
4
5; Check that the argument gets zero-extended before calling.
6; X86-LABEL: bar1
7; X86: movzbl
8; X86: calll
9; X64-LABEL: bar1
10; X64: movzbl
11; X64: jmp
12; WIN64-LABEL: bar1
13; WIN64: movzbl
14; WIN64: callq
15define void @bar1(i1 zeroext %v1) nounwind ssp {
16entry:
17  %conv = zext i1 %v1 to i32
18  %call = tail call i32 (...) @foo1(i32 %conv) nounwind
19  ret void
20}
21
22; Check that on x86-64 the arguments are simply forwarded.
23; X64-LABEL: bar2
24; X64-NOT: movzbl
25; X64: jmp
26; WIN64-LABEL: bar2
27; WIN64-NOT: movzbl
28; WIN64: callq
29define void @bar2(i8 zeroext %v1) nounwind ssp {
30entry:
31  %conv = zext i8 %v1 to i32
32  %call = tail call i32 (...) @foo1(i32 %conv) nounwind
33  ret void
34}
35
36; Check that i1 return values are not zero-extended.
37; X86-LABEL: bar3
38; X86: call
39; X86-NEXT: {{add|pop}}
40; X86-NEXT: ret
41; X64-LABEL: bar3
42; X64: call
43; X64-NEXT: {{add|pop}}
44; X64-NEXT: ret
45; WIN64-LABEL: bar3
46; WIN64: call
47; WIN64-NEXT: {{add|pop}}
48; WIN64-NEXT: ret
49define zeroext i1 @bar3() nounwind ssp {
50entry:
51  %call = call i1 @foo2() nounwind
52  ret i1 %call
53}
54
55declare i32 @foo1(...)
56declare zeroext i1 @foo2()
57