1 # Check for the simplification of .rodata loads.
3 RUN: %clang %cflags %p/Inputs/rodata_simpl_loads.s -o %t.exe
4 RUN: llvm-bolt %t.exe -o %t --simplify-rodata-loads
5 RUN: FileCheck %s --check-prefix=ORIGINAL --input-file %p/Inputs/rodata_simpl_loads.s
6 RUN: llvm-objdump -d %t --print-imm-hex --disassemble-symbols=main | FileCheck %s
8 CHECK: Disassembly of section .text:
10 # check that the following rip-relative operands have been
11 # replaced with immediates
13 ORIGINAL: movzbl s1(%rip), %eax
14 CHECK: movl $0x41, %eax
16 ORIGINAL: cmpb s2(%rip), %al
17 CHECK: cmpb $0x41, %al
19 ORIGINAL: movzbl s1+1(%rip), %eax
20 CHECK: movl $0x42, %eax
22 ORIGINAL: cmpb s2+1(%rip), %al
23 CHECK: cmpb $0x42, %al
25 ORIGINAL: movzbl s1+2(%rip), %eax
26 CHECK: movl $0x43, %eax
28 ORIGINAL: cmpb s2+2(%rip), %al
29 CHECK: cmpb $0x43, %al
31 ORIGINAL: movzbl s1+3(%rip), %eax
32 CHECK: movl $0x0, %eax
34 ORIGINAL: cmpb s2+3(%rip), %al
37 ORIGINAL: movl I1(%rip), %eax
38 CHECK: movl $0x6, %eax
40 ORIGINAL: addl I2(%rip), %eax
41 CHECK: addl $0x43, %eax
43 ORIGINAL: movl I2(%rip), %eax
44 CHECK: movl $0x43, %eax