xref: /aosp_15_r20/external/llvm/test/MC/ELF/relax-all-flag.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// By default, the jmp here does not need relaxation (so the 0xeb opdoce can be
2*9880d681SAndroid Build Coastguard Worker// used).
3*9880d681SAndroid Build Coastguard Worker// However, with -mc-relax-all passed to MC, all jumps are relaxed and we
4*9880d681SAndroid Build Coastguard Worker// expect to see a different instruction.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -filetype=obj -mc-relax-all -triple x86_64-pc-linux-gnu %s -o - \
7*9880d681SAndroid Build Coastguard Worker// RUN:  | llvm-objdump -disassemble - | FileCheck -check-prefix=RELAXALL %s
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
10*9880d681SAndroid Build Coastguard Worker// RUN:  | llvm-objdump -disassemble - | FileCheck %s
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker.text
13*9880d681SAndroid Build Coastguard Workerfoo:
14*9880d681SAndroid Build Coastguard Worker  mov %rax, %rax
15*9880d681SAndroid Build Coastguard Worker  jmp foo
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker// RELAXALL:    3:  e9
18*9880d681SAndroid Build Coastguard Worker// CHECK:       3:  eb
19*9880d681SAndroid Build Coastguard Worker
20