1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin10.0 %s | llvm-objdump -unwind-info - | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker .section __TEXT,__text,regular,pure_instructions 4*9880d681SAndroid Build Coastguard Worker .macosx_version_min 10, 10 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker# Check that we emit compact-unwind info with UNWIND_X86_MODE_STACK_IND encoding 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker# CHECK: Contents of __compact_unwind section: 9*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: Entry at offset 0x0: 10*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: start: 0x0 _test0 11*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: length: 0x15 12*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: compact encoding: 0x03056804 13*9880d681SAndroid Build Coastguard Worker .globl _test0 14*9880d681SAndroid Build Coastguard Worker_test0: ## @test0 15*9880d681SAndroid Build Coastguard Worker .cfi_startproc 16*9880d681SAndroid Build Coastguard Worker## BB#0: ## %entry 17*9880d681SAndroid Build Coastguard Worker pushq %rbp 18*9880d681SAndroid Build Coastguard WorkerLtmp0: 19*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 16 20*9880d681SAndroid Build Coastguard Worker pushq %rbx 21*9880d681SAndroid Build Coastguard WorkerLtmp1: 22*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 24 23*9880d681SAndroid Build Coastguard Worker subq $14408, %rsp ## imm = 0x3848 24*9880d681SAndroid Build Coastguard WorkerLtmp2: 25*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 14432 26*9880d681SAndroid Build Coastguard WorkerLtmp3: 27*9880d681SAndroid Build Coastguard Worker .cfi_offset %rbx, -24 28*9880d681SAndroid Build Coastguard WorkerLtmp4: 29*9880d681SAndroid Build Coastguard Worker .cfi_offset %rbp, -16 30*9880d681SAndroid Build Coastguard Worker xorl %eax, %eax 31*9880d681SAndroid Build Coastguard Worker addq $14408, %rsp ## imm = 0x3848 32*9880d681SAndroid Build Coastguard Worker popq %rbx 33*9880d681SAndroid Build Coastguard Worker popq %rbp 34*9880d681SAndroid Build Coastguard Worker retq 35*9880d681SAndroid Build Coastguard Worker .cfi_endproc 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker# Check that we emit compact-unwind info with UNWIND_X86_MODE_STACK_IMMD encoding 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Worker# CHECK: Entry at offset 0x20: 40*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: start: 0x15 _test1 41*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: length: 0x15 42*9880d681SAndroid Build Coastguard Worker# CHECK-NEXT: compact encoding: 0x02360804 43*9880d681SAndroid Build Coastguard Worker .globl _test1 44*9880d681SAndroid Build Coastguard Worker_test1: ## @test1 45*9880d681SAndroid Build Coastguard Worker .cfi_startproc 46*9880d681SAndroid Build Coastguard Worker## BB#0: ## %entry 47*9880d681SAndroid Build Coastguard Worker pushq %rbp 48*9880d681SAndroid Build Coastguard WorkerLtmp10: 49*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 16 50*9880d681SAndroid Build Coastguard Worker pushq %rbx 51*9880d681SAndroid Build Coastguard WorkerLtmp11: 52*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 24 53*9880d681SAndroid Build Coastguard Worker subq $408, %rsp ## imm = 0x198 54*9880d681SAndroid Build Coastguard WorkerLtmp12: 55*9880d681SAndroid Build Coastguard Worker .cfi_def_cfa_offset 432 56*9880d681SAndroid Build Coastguard WorkerLtmp13: 57*9880d681SAndroid Build Coastguard Worker .cfi_offset %rbx, -24 58*9880d681SAndroid Build Coastguard WorkerLtmp14: 59*9880d681SAndroid Build Coastguard Worker .cfi_offset %rbp, -16 60*9880d681SAndroid Build Coastguard Worker xorl %eax, %eax 61*9880d681SAndroid Build Coastguard Worker addq $408, %rsp ## imm = 0x198 62*9880d681SAndroid Build Coastguard Worker popq %rbx 63*9880d681SAndroid Build Coastguard Worker popq %rbp 64*9880d681SAndroid Build Coastguard Worker retq 65*9880d681SAndroid Build Coastguard Worker .cfi_endproc 66*9880d681SAndroid Build Coastguard Worker 67*9880d681SAndroid Build Coastguard Worker .section __TEXT,__cstring,cstring_literals 68*9880d681SAndroid Build Coastguard WorkerL_.str: ## @.str 69*9880d681SAndroid Build Coastguard Worker .asciz "%d\n" 70*9880d681SAndroid Build Coastguard Worker 71*9880d681SAndroid Build Coastguard Worker 72*9880d681SAndroid Build Coastguard Worker.subsections_via_symbols 73