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 5 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 10 11// CHECK: <entry>: 12// CHECK-NEXT: movl $0x11010, %edx 13// CHECK-NEXT: movl $0x11010, %edx 14// CHECK-NEXT: movl $0x11000, %edx 15 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 20 21// foo = 0xC0011000 = 3221295104 22// __wrap_foo = 0xC0011010 = 3221295120 23// SYM1: Name: foo 24// SYM1-NEXT: Value: 3221295104 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: 3221295120 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 36 37#--- main.s 38.global entry 39entry: 40 movl $foo, %edx 41 movl $__wrap_foo, %edx 42 movl $__real_foo, %edx 43 44#--- other.s 45.global foo 46.global __wrap_foo 47.global __real_foo 48 49foo = 0x11000 50__wrap_foo = 0x11010 51__real_foo = 0x11020 52