Commit 7af4374f authored by Fangrui Song's avatar Fangrui Song
Browse files

[MC][test] Improve some llvm-objdump -t tests

Delete two redundant tests.
parent 216ef5b9
Loading
Loading
Loading
Loading
+0 −28
Original line number Diff line number Diff line
// RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj < %s | llvm-objdump -t - | FileCheck %s

        .text
        add w0, w0, w0

// .wibble should *not* inherit .text's mapping symbol. It's a completely different section.
        .section .wibble
        add w0, w0, w0

// A setion should be able to start with a $d
        .section .starts_data
        .word 42

// Changing back to .text should not emit a redundant $x
        .text
        add w0, w0, w0

// With all those constraints, we want:
//   + .text to have $x at 0 and no others
//   + .wibble to have $x at 0
//   + .starts_data to have $d at 0


// CHECK: 00000000 .starts_data 00000000 $d
// CHECK-NEXT: 00000000 .text 00000000 $x
// CHECK-NEXT: 00000000 .wibble 00000000 $x
// CHECK-NOT: ${{[adtx]}}
+0 −23
Original line number Diff line number Diff line
// RUN: llvm-mc -triple=arm64-none-linux-gnu -filetype=obj < %s | llvm-objdump -t - | FileCheck %s

    .text
// $x at 0x0000
    add w0, w0, w0
// $d at 0x0004
    .ascii "012"
    .byte 1
    .hword 2
    .word 4
    .xword 8
    .single 4.0
    .double 8.0
    .space 10
    .zero 3
    .fill 10, 2, 42
    .org 100, 12
// $x at 0x0018
    add x0, x0, x0

// CHECK: 00000004         .text  00000000 $d
// CHECK-NEXT: 00000000         .text  00000000 $x
// CHECK-NEXT: 00000064         .text  00000000 $x
+4 −4
Original line number Diff line number Diff line
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj < %s | llvm-objdump -t - | FileCheck %s
// RUN: llvm-mc -triple=aarch64-none-linux-gnu -filetype=obj %s | llvm-nm - | FileCheck %s

    .text
// $x at 0x0000
@@ -18,6 +18,6 @@
// $x at 0x0018
    add x0, x0, x0

// CHECK: 00000004         .text  00000000 $d
// CHECK-NEXT: 00000000         .text  00000000 $x
// CHECK-NEXT: 00000064         .text  00000000 $x
// CHECK:      0000000000000004 t $d.1
// CHECK-NEXT: 0000000000000000 t $x.0
// CHECK-NEXT: 0000000000000064 t $x.2
+8 −7
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
// RUN:   | FileCheck %s --check-prefix=CHECK-ASM
// RUN: llvm-mc %s -triple=aarch64-none-linux-gnu -filetype=obj -o %t
// RUN: llvm-readobj -S --sd %t | FileCheck %s  --check-prefix=CHECK-OBJ
// RUN: llvm-objdump -t %t | FileCheck %s  --check-prefix=CHECK-SYMS
// RUN: llvm-readelf -s %t | FileCheck %s  --check-prefix=SYMS

    .section    .size.aarch64_size

@@ -31,9 +31,10 @@ aarch64_size:
// CHECK-OBJ-NEXT:   0010: 00000000 0000                        |......|
// CHECK-OBJ-NEXT: )

// CHECK-SYMS:     0000000000000000         .size.aarch64_size	 00000000 $d.0
// CHECK-SYMS:     0000000000000000 g     F .size.aarch64_size	 00000000 aarch64_size
// CHECK-SYMS:     0000000000000000         *UND*		 00000000 also_double_word
// CHECK-SYMS:     0000000000000000         *UND*		 00000000 double_word
// CHECK-SYMS:     0000000000000000         *UND*		 00000000 full_word
// CHECK-SYMS:     0000000000000000         *UND*		 00000000 half_word
// SYMS:      Type   Bind   Vis     Ndx Name
// SYMS:      NOTYPE LOCAL  DEFAULT   3 $d.0
// SYMS-NEXT: FUNC   GLOBAL DEFAULT   3 aarch64_size
// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND also_double_word
// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND double_word
// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND full_word
// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND half_word
+3 −2
Original line number Diff line number Diff line
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s | llvm-objdump -t - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s | llvm-readelf -s - | FileCheck %s

# CHECK: 0000000000000004 g     O *COM*  00000004 C
# CHECK:    Value         Size Type   Bind   Vis     Ndx Name
# CHECK: 0000000000000004    4 OBJECT GLOBAL DEFAULT COM C
        .comm   C,4,4
        .comm   C,4,4
Loading