mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
29e1b86c43
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368821 91177308-0d34-0410-b5e6-96231b3b80d8
45 lines
1.3 KiB
Plaintext
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
|