llvm/test/MC/COFF/temporary-alias.s
Peter Collingbourne 41984d3288 MC: Simplify handling of temporary symbols in COFF writer.
The COFF object writer was previously adding unnecessary symbols to its
temporary data structures and cleaning them up later. This made the code
harder to understand and caused a bug (aliases classed as temporary symbols
would cause an assertion failure). A much simpler way of handling such
symbols is to ask the layout for their section-relative position when needed.

Tested with a bootstrap on Windows and by building Chrome.

Differential Revision: http://reviews.llvm.org/D14975

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 23:29:27 +00:00

22 lines
439 B
ArmAsm

// RUN: llvm-mc -triple=i686-pc-windows -filetype=obj -o %t %s
// RUN: llvm-objdump -d -r %t | FileCheck %s
.globl _main
_main:
// CHECK: 00 00 00 00
// CHECK-NEXT: 00000002: IMAGE_REL_I386_DIR32 .rdata
movb L_alias1(%eax), %al
// CHECK: 01 00 00 00
// CHECK-NEXT: 00000008: IMAGE_REL_I386_DIR32 .rdata
movb L_alias2(%eax), %al
retl
.section .rdata,"dr"
L_sym1:
.ascii "\001"
L_sym2:
.ascii "\002"
L_alias1 = L_sym1
L_alias2 = L_sym2