MC/Mach-O: Implement initial support for relaxation.
[oota-llvm.git] / test / MC / MachO / relax-jumps.s
1 // RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
2
3 // FIXME: This is a horrible way of checking the output, we need an llvm-mc
4 // based 'otool'. Use:
5 //   (f=relax-jumps;
6 //    llvm-mc -filetype=obj -o $f.mc.o $f.s &&
7 //    as -arch i386 -o $f.as.o $f.s &&
8 //    otool -tvr $f.mc.o | tail +2 > $f.mc.dump &&
9 //    otool -tvr $f.as.o | tail +2 > $f.as.dump &&
10 //    diff $f.{as,mc}.dump)
11 // to examine the results in a more sensible fashion.
12
13 // CHECK: ('_section_data', '\x90
14 // CHECK: \x0f\x842\xff\xff\xff\x0f\x82\xe6\x00\x00\x00\x0f\x87&\xff\xff\xff\x0f\x8f\xda\x00\x00\x00\x0f\x88\x1a\xff\xff\xff\x0f\x83\xce\x00\x00\x00\x0f\x89\x0e\xff\xff\xff\x90
15 // CHECK: \x901\xc0')
16
17 L1:
18         .space 200, 0x90
19
20         je L1
21         jb L2
22         ja L1
23         jg L2
24         js L1
25         jae L2
26         jns L1
27
28         .space 200, 0x90
29 L2:
30
31         xorl %eax, %eax