blob: 6847e48d6141e135eda88b001380484f3f368e57 [file] [log] [blame]
Evan Cheng54a4ce42012-02-08 22:33:17 +00001; RUN: llc < %s -mcpu=atom -march=x86 | FileCheck -check-prefix=atom %s
2; RUN: llc < %s -mcpu=core2 -march=x86 | FileCheck %s
3
4declare void @use_arr(i8*)
5declare void @many_params(i32, i32, i32, i32, i32, i32)
6
7define void @test1() nounwind {
8; atom: test1:
9; atom: leal -1052(%esp), %esp
10; atom-NOT: sub
11; atom: call
12; atom: leal 1052(%esp), %esp
13
14; CHECK: test1:
15; CHECK: subl
16; CHECK: call
17; CHECK-NOT: lea
18 %arr = alloca [1024 x i8], align 16
19 %arr_ptr = getelementptr inbounds [1024 x i8]* %arr, i8 0, i8 0
20 call void @use_arr(i8* %arr_ptr)
21 ret void
22}
23
24define void @test2() nounwind {
25; atom: test2:
26; atom: leal -28(%esp), %esp
27; atom: call
28; atom: leal 28(%esp), %esp
29
30; CHECK: test2:
31; CHECK-NOT: lea
32 call void @many_params(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
33 ret void
34}
35
36define void @test3() nounwind {
37; atom: test3:
38; atom: leal -8(%esp), %esp
39; atom: leal 8(%esp), %esp
40
41; CHECK: test3:
42; CHECK-NOT: lea
43 %x = alloca i32, align 4
44 %y = alloca i32, align 4
45 store i32 0, i32* %x, align 4
46 ret void
47}
48