[lld-macho][nfc] Simplify common-symbol-coalescing test

This commit is contained in:
Jez Ng 2021-07-29 11:05:14 -04:00
parent e49374f9e0
commit a26bb9cc05
1 changed files with 14 additions and 22 deletions

View File

@ -10,42 +10,34 @@
## Check that we pick the definition with the larger size, regardless of
## its alignment.
# RUN: %lld %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=SMALLER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8
# RUN: %lld %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=SMALLER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8
## When the sizes are equal, we pick the symbol whose file occurs later in the
## command-line argument list.
# RUN: %lld %t/test.o %t/same-size.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=LARGER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16
# RUN: %lld %t/same-size.o %t/test.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=SMALLER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=8
# RUN: %lld %t/test.o %t/zero-align.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=LARGER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16
# RUN: %lld %t/zero-align.o %t/test.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=LARGER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16
# RUN: %lld %t/test.o %t/zero-align-round-up.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=LARGER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16
# RUN: %lld %t/zero-align-round-up.o %t/test.o -order_file %t/order -o %t/test
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s --check-prefix=LARGER-ALIGNMENT
# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=16
# SMALLER-ALIGNMENT-LABEL: Sections:
# SMALLER-ALIGNMENT: __common {{[0-9a-f]+}} [[#%x, COMMON_START:]] BSS
# CHECK-LABEL: Sections:
# CHECK: __common {{[0-9a-f]+}} [[#%.16x, COMMON_START:]] BSS
# SMALLER-ALIGNMENT-LABEL: SYMBOL TABLE:
# SMALLER-ALIGNMENT-DAG: [[#COMMON_START]] g O __DATA,__common _check_size
# SMALLER-ALIGNMENT-DAG: [[#COMMON_START + 2]] g O __DATA,__common _end_marker
# SMALLER-ALIGNMENT-DAG: [[#COMMON_START + 8]] g O __DATA,__common _check_alignment
# LARGER-ALIGNMENT-LABEL: Sections:
# LARGER-ALIGNMENT: __common {{[0-9a-f]+}} [[#%x, COMMON_START:]] BSS
# LARGER-ALIGNMENT-LABEL: SYMBOL TABLE:
# LARGER-ALIGNMENT-DAG: [[#COMMON_START]] g O __DATA,__common _check_size
# LARGER-ALIGNMENT-DAG: [[#COMMON_START + 2]] g O __DATA,__common _end_marker
# LARGER-ALIGNMENT-DAG: [[#COMMON_START + 16]] g O __DATA,__common _check_alignment
# CHECK-LABEL: SYMBOL TABLE:
# CHECK-DAG: [[#%.16x, COMMON_START]] g O __DATA,__common _check_size
# CHECK-DAG: [[#%.16x, COMMON_START + 2]] g O __DATA,__common _end_marker
# CHECK-DAG: [[#%.16x, COMMON_START + ALIGN]] g O __DATA,__common _check_alignment
#--- order
## Order is important as we determine the size of a given symbol via the