[ELF] relocateNonAlloc: clean up workaround code
[llvm-project.git] / lld / test / COFF / wrap.s
blob7a964fa61ce8ae1d4cdfb97a00b46c0a96ef2880
1 // REQUIRES: x86
2 // RUN: split-file %s %t.dir
3 // RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/main.s -o %t.main.obj
4 // RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/other.s -o %t.other.obj
6 // RUN: lld-link -out:%t.exe %t.main.obj %t.other.obj -entry:entry -subsystem:console -debug:symtab -wrap:foo -wrap:nosuchsym
7 // RUN: llvm-objdump -d --print-imm-hex %t.exe | FileCheck %s
8 // RUN: lld-link -out:%t.exe %t.main.obj %t.other.obj -entry:entry -subsystem:console -debug:symtab -wrap:foo -wrap:foo -wrap:nosuchsym
9 // RUN: llvm-objdump -d --print-imm-hex %t.exe | FileCheck %s
11 // CHECK: <entry>:
12 // CHECK-NEXT: movl $0x11010, %edx
13 // CHECK-NEXT: movl $0x11010, %edx
14 // CHECK-NEXT: movl $0x11000, %edx
16 // RUN: llvm-readobj --symbols %t.exe > %t.dump
17 // RUN: FileCheck --check-prefix=SYM1 %s < %t.dump
18 // RUN: FileCheck --check-prefix=SYM2 %s < %t.dump
19 // RUN: FileCheck --check-prefix=SYM3 %s < %t.dump
21 // foo = 0x00011000 = 69632
22 // __wrap_foo = 0x00011010 = 69648
23 // SYM1: Name: foo
24 // SYM1-NEXT: Value: 69632
25 // SYM1-NEXT: Section: IMAGE_SYM_ABSOLUTE
26 // SYM1-NEXT: BaseType: Null
27 // SYM1-NEXT: ComplexType: Null
28 // SYM1-NEXT: StorageClass: External
29 // SYM2: Name: __wrap_foo
30 // SYM2-NEXT: Value: 69648
31 // SYM2-NEXT: Section: IMAGE_SYM_ABSOLUTE
32 // SYM2-NEXT: BaseType: Null
33 // SYM2-NEXT: ComplexType: Null
34 // SYM2-NEXT: StorageClass: External
35 // SYM3-NOT: Name: __real_foo
37 #--- main.s
38 .global entry
39 entry:
40 movl $foo, %edx
41 movl $__wrap_foo, %edx
42 movl $__real_foo, %edx
44 #--- other.s
45 .global foo
46 .global __wrap_foo
47 .global __real_foo
49 foo = 0x11000
50 __wrap_foo = 0x11010
51 __real_foo = 0x11020