brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · f269d6d Raw
76 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3 4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/same-size.s -o %t/same-size.o6# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/smaller-size.s -o %t/smaller-size.o7# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/zero-align.s -o %t/zero-align.o8# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/zero-align-round-up.s -o %t/zero-align-round-up.o9 10## Check that we pick the definition with the larger size, regardless of11## its alignment.12# RUN: %lld %t/test.o %t/smaller-size.o -order_file %t/order -o %t/test13# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=814# RUN: %lld %t/smaller-size.o %t/test.o -order_file %t/order -o %t/test15# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=816 17## When the sizes are equal, we pick the symbol whose file occurs later in the18## command-line argument list.19# RUN: %lld %t/test.o %t/same-size.o -order_file %t/order -o %t/test20# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=1621# RUN: %lld %t/same-size.o %t/test.o -order_file %t/order -o %t/test22# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=823 24# RUN: %lld %t/test.o %t/zero-align.o -order_file %t/order -o %t/test25# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=1626# RUN: %lld %t/zero-align.o %t/test.o -order_file %t/order -o %t/test27# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=1628 29# RUN: %lld %t/test.o %t/zero-align-round-up.o -order_file %t/order -o %t/test30# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=1631# RUN: %lld %t/zero-align-round-up.o %t/test.o -order_file %t/order -o %t/test32# RUN: llvm-objdump --section-headers --syms %t/test | FileCheck %s -D#ALIGN=1633 34# CHECK-LABEL: Sections:35# CHECK:       __common      {{[0-9a-f]+}} [[#%.16x, COMMON_START:]]  BSS36 37# CHECK-LABEL: SYMBOL TABLE:38# CHECK-DAG:   [[#%.16x, COMMON_START]]          g     O __DATA,__common _check_size39# CHECK-DAG:   [[#%.16x, COMMON_START + 2]]      g     O __DATA,__common _end_marker40# CHECK-DAG:   [[#%.16x, COMMON_START + ALIGN]]  g     O __DATA,__common _check_alignment41 42#--- order43## Order is important as we determine the size of a given symbol via the44## address of the next symbol.45_check_size46_end_marker47_check_alignment48 49#--- smaller-size.s50.comm _check_size, 1, 151.comm _check_alignment, 1, 452 53#--- same-size.s54.comm _check_size, 2, 155.comm _check_alignment, 2, 456 57#--- zero-align.s58.comm _check_size, 2, 159## If alignment is set to zero, use the size to determine the alignment.60.comm _check_alignment, 16, 061 62#--- zero-align-round-up.s63.comm _check_size, 2, 164## If alignment is set to zero, use the size to determine the alignment. If the65## size is not a power of two, round it up. (In this case, 14 rounds to 16.)66.comm _check_alignment, 14, 067 68#--- test.s69.comm _check_size, 2, 170.comm _end_marker, 171.comm _check_alignment, 2, 372 73.globl _main74_main:75  ret76