1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/test/tools/llvm-size/common.test
James Henderson 056055f8f6 [llvm-size][test] Improve llvm-size testing
This patch significantly improves the llvm-size testing. The changes
made are:

1) Change all tests to use yaml2obj instead of assembly or pre-canned
   inputs.
2) Move the tests out of the X86 directory, since they don't need to be
   there after 1).
3) Increased test coverage.
4) Added comments to explain purpose of tests.

I haven't attempted to add test coverage for all Mach-O related code, as
I am not familiar enough with that file format to be able to.

Reviewers: grimar, MaskRay

Differential Revision: https://reviews.llvm.org/D66134

llvm-svn: 368821
2019-08-14 10:17:34 +00:00

45 lines
1.3 KiB
Plaintext

## Check that with the common switch common symbols are added to bss (Berkeley
## output) or shown as *COM* (sysv output). Otherwise their size is ignored.
# RUN: yaml2obj %s -o %t.o
# RUN: llvm-size -A --common %t.o | FileCheck --check-prefix=SYSV %s
# RUN: llvm-size -B --common %t.o | FileCheck --check-prefix=BSD %s
# RUN: llvm-size -A %t.o | FileCheck --check-prefix=SYSVNOCOMM %s
# RUN: llvm-size -B %t.o | FileCheck --check-prefix=BSDNOCOMM %s
# SYSV: {{.*}}.o :
# SYSV-NEXT: section size addr
# SYSV-NEXT: .text 0 0
# SYSV-NEXT: *COM* 8 0
# SYSV-NEXT: Total 8
# SYSVNOCOMM: {{.*}}.o :
# SYSVNOCOMM-NEXT: section size addr
# SYSVNOCOMM-NEXT: .text 0 0
# SYSVNOCOMM-NEXT: Total 0
# BSD: text data bss dec hex filename
# BSD-NEXT: 0 0 8 8 8 {{.*}}.o
# BSDNOCOMM: text data bss dec hex filename
# BSDNOCOMM-NEXT: 0 0 0 0 0 {{.*}}.o
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .text
Type: SHT_PROGBITS
Symbols:
- Name: y
Type: STT_OBJECT
Size: 4
Index: SHN_COMMON
- Name: z
Type: STT_OBJECT
Size: 4
Index: SHN_COMMON