blob: 6ee9566f9a315250079efd50c0894faba4301936 [file] [log] [blame]
Bill Wendling58e2d3d2013-09-09 02:37:14 +00001; RUN: llc < %s -disable-fp-elim -mtriple x86_64-apple-darwin11 | FileCheck -check-prefix=ASM %s
2; RUN: llc < %s -disable-fp-elim -mtriple x86_64-apple-darwin11 -filetype=obj -o - \
3; RUN: | llvm-objdump -triple x86_64-apple-darwin11 -s - \
4; RUN: | FileCheck -check-prefix=CU %s
Bill Wendling07fe2352013-05-09 20:10:38 +00005
6%ty = type { i8* }
7
8@gv = external global i32
9
10; This is aligning the stack with a push of a random register.
Bill Wendling58e2d3d2013-09-09 02:37:14 +000011; ASM: pushq %rax
Bill Wendling07fe2352013-05-09 20:10:38 +000012
13; Even though we can't encode %rax into the compact unwind, We still want to be
14; able to generate a compact unwind encoding in this particular case.
15;
Bill Wendling58e2d3d2013-09-09 02:37:14 +000016; CU: Contents of section __compact_unwind:
17; CU-NEXT: 0020 00000000 00000000 1e000000 01000101
18; CU-NEXT: 0030 00000000 00000000 00000000 00000000
Bill Wendling07fe2352013-05-09 20:10:38 +000019
20define i8* @foo(i64 %size) {
21 %addr = alloca i64, align 8
22 %tmp20 = load i32* @gv, align 4
23 %tmp21 = call i32 @bar()
24 %tmp25 = load i64* %addr, align 8
25 %tmp26 = inttoptr i64 %tmp25 to %ty*
26 %tmp29 = getelementptr inbounds %ty* %tmp26, i64 0, i32 0
27 %tmp34 = load i8** %tmp29, align 8
28 %tmp35 = getelementptr inbounds i8* %tmp34, i64 %size
29 store i8* %tmp35, i8** %tmp29, align 8
30 ret i8* null
31}
32
33declare i32 @bar()