1cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -s | FileCheck %s
27abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao
37abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// FIXME: This is a horrible way of checking the output, we need an llvm-mc
47abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// based 'otool'.
57abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao
67abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// This is a case where llvm-mc computes a better layout than Darwin 'as'. This
77abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// issue is that after the first jmp slides, the .align size must be
87abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// recomputed -- otherwise the second jump will appear to be out-of-range for a
97abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao// 1-byte jump.
107abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao
117abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei LiaoL0:
127abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao        .space 0x8a, 0x90
137abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao	jmp	L0
147abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao        .space (0xb3 - 0x8f), 0x90
157abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao	jle	L2
167abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao        .space (0xcd - 0xb5), 0x90
177abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao	.align	4, 0x90
187abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei LiaoL1:
197abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao        .space (0x130 - 0xd0),0x90
207abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao	jl	L1
217abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei LiaoL2:
227abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao
237abe37e4aee38cc79d91dd069a37d7e91d5bef53Shih-wei Liao.zerofill __DATA,__bss,_sym,4,2
24cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar
25cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK: Section {
26cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Index: 0
27cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
28cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
29cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Address: 0x0
30cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Size: 0x132
31cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Offset: 340
32cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Alignment: 4
33cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   RelocationOffset: 0x0
34cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   RelocationCount: 0
35cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Type: 0x0
36cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Attributes [ (0x800004)
37cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:     PureInstructions (0x800000)
38cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:     SomeInstructions (0x4)
39cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   ]
40cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Reserved1: 0x0
41cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT:   Reserved2: 0x0
42cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar// CHECK-NEXT: }
43