brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 4d77dc2 Raw
67 lines · plain
1@ REQUIRES: arm-registered-target2 3// Test that code symbols take priority over data symbols if both are4// defined at the same address during disassembly.5//6// In the past, llvm-objdump would select the alphabetically last7// symbol at each address. To demonstrate that it's now choosing by8// symbol type, we define pairs of code and data symbols at the same9// address in such a way that the code symbol and data symbol each10// have a chance to appear alphabetically last. Also, we test that11// both STT_FUNC and STT_NOTYPE are regarded as code symbols.12 13@ RUN: llvm-mc -triple armv8a-unknown-linux -filetype=obj %s -o %t.o14@ RUN: llvm-objdump --no-print-imm-hex --triple armv8a -d %t.o | FileCheck %s15 16// Ensure that all four instructions in the section are disassembled17// rather than dumped as data, and that in each case, the code symbol18// is displayed before the disassembly, and not the data symbol at the19// same address.20 21@ CHECK:        Disassembly of section .text:22@ CHECK-EMPTY:23@ CHECK-NEXT:   <A1function>:24@ CHECK-NEXT:   movw r0, #125@ CHECK-EMPTY:26@ CHECK-NEXT:   <B2function>:27@ CHECK-NEXT:   movw r0, #228@ CHECK-EMPTY:29@ CHECK-NEXT:   <A3notype>:30@ CHECK-NEXT:   movw r0, #331@ CHECK-EMPTY:32@ CHECK-NEXT:   <B4notype>:33@ CHECK-NEXT:   movw r0, #434 35.text36 37.globl A1function38.globl B2function39.globl A3notype40.globl B4notype41.globl B1object42.globl A2object43.globl B3object44.globl A4object45 46.type A1function,%function47.type B2function,%function48.type A3notype,%notype49.type B4notype,%notype50.type B1object,%object51.type A2object,%object52.type B3object,%object53.type A4object,%object54 55A1function:56B1object:57        movw r0, #158A2object:59B2function:60        movw r0, #261A3notype:62B3object:63        movw r0, #364A4object:65B4notype:66        movw r0, #467