1// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -s | FileCheck %s
2
3// FIXME: This is a horrible way of checking the output, we need an llvm-mc
4// based 'otool'.
5
6// This is a case where llvm-mc computes a better layout than Darwin 'as'. This
7// issue is that after the first jmp slides, the .align size must be
8// recomputed -- otherwise the second jump will appear to be out-of-range for a
9// 1-byte jump.
10
11L0:
12        .space 0x8a, 0x90
13	jmp	L0
14        .space (0xb3 - 0x8f), 0x90
15	jle	L2
16        .space (0xcd - 0xb5), 0x90
17	.align	4, 0x90
18L1:
19        .space (0x130 - 0xd0),0x90
20	jl	L1
21L2:
22
23.zerofill __DATA,__bss,_sym,4,2
24
25// CHECK: Section {
26// CHECK-NEXT:   Index: 0
27// CHECK-NEXT:   Name: __text (5F 5F 74 65 78 74 00 00 00 00 00 00 00 00 00 00)
28// CHECK-NEXT:   Segment: __TEXT (5F 5F 54 45 58 54 00 00 00 00 00 00 00 00 00 00)
29// CHECK-NEXT:   Address: 0x0
30// CHECK-NEXT:   Size: 0x132
31// CHECK-NEXT:   Offset: 340
32// CHECK-NEXT:   Alignment: 4
33// CHECK-NEXT:   RelocationOffset: 0x0
34// CHECK-NEXT:   RelocationCount: 0
35// CHECK-NEXT:   Type: 0x0
36// CHECK-NEXT:   Attributes [ (0x800004)
37// CHECK-NEXT:     PureInstructions (0x800000)
38// CHECK-NEXT:     SomeInstructions (0x4)
39// CHECK-NEXT:   ]
40// CHECK-NEXT:   Reserved1: 0x0
41// CHECK-NEXT:   Reserved2: 0x0
42// CHECK-NEXT: }
43