[X86] Generate .cfi_adjust_cfa_offset correctly when pushing arguments
[oota-llvm.git] / test / CodeGen / X86 / push-cfi-obj.ll
1 ; RUN: llc < %s -mtriple=i686-pc-linux -filetype=obj | llvm-readobj -s -sr -sd | FileCheck %s -check-prefix=LINUX
2 ; RUN: llc < %s -mtriple=i686-darwin-macosx10.7 -filetype=obj | llvm-readobj -sections | FileCheck -check-prefix=DARWIN %s
3
4 ; On darwin, check that we manage to generate the compact unwind section
5 ; DARWIN: Name: __compact_unwind
6 ; DARWIN: Segment: __LD
7
8 ; LINUX:         Index: 8
9 ; LINUX-NEXT:    Name: .eh_frame (41)
10 ; LINUX-NEXT:    Type: SHT_PROGBITS (0x1)
11 ; LINUX-NEXT:    Flags [ (0x2)
12 ; LINUX-NEXT:      SHF_ALLOC (0x2)
13 ; LINUX-NEXT:    ]
14 ; LINUX-NEXT:    Address: 0x0
15 ; LINUX-NEXT:    Offset: 0x68
16 ; LINUX-NEXT:    Size: 64
17 ; LINUX-NEXT:    Link: 0
18 ; LINUX-NEXT:    Info: 0
19 ; LINUX-NEXT:    AddressAlignment: 4
20 ; LINUX-NEXT:    EntrySize: 0
21 ; LINUX-NEXT:    Relocations [
22 ; LINUX-NEXT:    ]
23 ; LINUX-NEXT:    SectionData (
24 ; LINUX-NEXT:      0000: 1C000000 00000000 017A504C 5200017C  |.........zPLR..||
25 ; LINUX-NEXT:      0010: 08070000 00000000 1B0C0404 88010000  |................|
26 ; LINUX-NEXT:      0020: 1C000000 24000000 00000000 1D000000  |....$...........|
27 ; LINUX-NEXT:      0030: 04000000 00410E08 8502420D 05432E10  |.....A....B..C..|
28 ; LINUX-NEXT:    )
29
30 declare i32 @__gxx_personality_v0(...)
31 declare void @good(i32 %a, i32 %b, i32 %c, i32 %d)
32
33 define void @test() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
34 entry:
35   invoke void @good(i32 1, i32 2, i32 3, i32 4)
36           to label %continue unwind label %cleanup
37 continue:
38   ret void
39 cleanup:  
40   landingpad { i8*, i32 }
41      cleanup
42   ret void
43 }
44
45 attributes #0 = { optsize "no-frame-pointer-elim"="true" }