2013-09-11 21:06:04 +02:00
|
|
|
; RUN: llc < %s -disable-fp-elim -mtriple x86_64-apple-darwin11 -mcpu corei7 | FileCheck -check-prefix=ASM %s
|
|
|
|
; RUN: llc < %s -disable-fp-elim -mtriple x86_64-apple-darwin11 -mcpu corei7 -filetype=obj -o - \
|
2013-09-09 04:37:14 +02:00
|
|
|
; RUN: | llvm-objdump -triple x86_64-apple-darwin11 -s - \
|
|
|
|
; RUN: | FileCheck -check-prefix=CU %s
|
2013-09-11 21:06:04 +02:00
|
|
|
; RUN: llc < %s -disable-fp-elim -mtriple x86_64-apple-darwin11 -mcpu corei7 \
|
2013-09-09 22:29:32 +02:00
|
|
|
; RUN: | llvm-mc -triple x86_64-apple-darwin11 -filetype=obj -o - \
|
2013-09-09 22:10:54 +02:00
|
|
|
; RUN: | llvm-objdump -triple x86_64-apple-darwin11 -s - \
|
|
|
|
; RUN: | FileCheck -check-prefix=FROM-ASM %s
|
2013-05-09 22:10:38 +02:00
|
|
|
|
|
|
|
%ty = type { i8* }
|
|
|
|
|
|
|
|
@gv = external global i32
|
|
|
|
|
|
|
|
; This is aligning the stack with a push of a random register.
|
2013-09-09 04:37:14 +02:00
|
|
|
; ASM: pushq %rax
|
2013-05-09 22:10:38 +02:00
|
|
|
|
|
|
|
; Even though we can't encode %rax into the compact unwind, We still want to be
|
|
|
|
; able to generate a compact unwind encoding in this particular case.
|
2013-09-09 22:10:54 +02:00
|
|
|
|
2013-09-09 04:37:14 +02:00
|
|
|
; CU: Contents of section __compact_unwind:
|
|
|
|
; CU-NEXT: 0020 00000000 00000000 1e000000 01000101
|
|
|
|
; CU-NEXT: 0030 00000000 00000000 00000000 00000000
|
2013-05-09 22:10:38 +02:00
|
|
|
|
2013-09-09 22:10:54 +02:00
|
|
|
; FROM-ASM: Contents of section __compact_unwind:
|
|
|
|
; FROM-ASM-NEXT: 0020 00000000 00000000 1e000000 01000101
|
|
|
|
; FROM-ASM-NEXT: 0030 00000000 00000000 00000000 00000000
|
|
|
|
|
2013-05-09 22:10:38 +02:00
|
|
|
define i8* @foo(i64 %size) {
|
|
|
|
%addr = alloca i64, align 8
|
|
|
|
%tmp20 = load i32* @gv, align 4
|
|
|
|
%tmp21 = call i32 @bar()
|
|
|
|
%tmp25 = load i64* %addr, align 8
|
|
|
|
%tmp26 = inttoptr i64 %tmp25 to %ty*
|
|
|
|
%tmp29 = getelementptr inbounds %ty* %tmp26, i64 0, i32 0
|
|
|
|
%tmp34 = load i8** %tmp29, align 8
|
|
|
|
%tmp35 = getelementptr inbounds i8* %tmp34, i64 %size
|
|
|
|
store i8* %tmp35, i8** %tmp29, align 8
|
|
|
|
ret i8* null
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @bar()
|