1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 08:23:21 +01:00
llvm-mirror/test/MC/MachO/relax-jumps.s
Daniel Dunbar 8ad9589475 MC/Mach-O: Implement initial support for relaxation.
- The implementation is currently very brain dead and inefficient, but I have a
   clear plan on how to fix it.

 - The good news is, it works and correctly assembles 403.gcc (when built with
   Clang, at '-Os', '-Os -g', and '-O3'). Even better, at '-Os' and '-Os -g',
   the resulting binary is exactly equivalent to that when built with the system
   assembler. So it probably works! :)

llvm-svn: 98396
2010-03-12 22:07:14 +00:00

32 lines
924 B
ArmAsm

// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
// FIXME: This is a horrible way of checking the output, we need an llvm-mc
// based 'otool'. Use:
// (f=relax-jumps;
// llvm-mc -filetype=obj -o $f.mc.o $f.s &&
// as -arch i386 -o $f.as.o $f.s &&
// otool -tvr $f.mc.o | tail +2 > $f.mc.dump &&
// otool -tvr $f.as.o | tail +2 > $f.as.dump &&
// diff $f.{as,mc}.dump)
// to examine the results in a more sensible fashion.
// CHECK: ('_section_data', '\x90
// 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
// CHECK: \x901\xc0')
L1:
.space 200, 0x90
je L1
jb L2
ja L1
jg L2
js L1
jae L2
jns L1
.space 200, 0x90
L2:
xorl %eax, %eax