• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Check that with the common switch common symbols are added to bss (Berkeley
2## output) or shown as *COM* (sysv output). Otherwise their size is ignored.
3
4# RUN: yaml2obj %s -o %t.o
5# RUN: llvm-size -A --common %t.o | FileCheck --check-prefix=SYSV %s
6# RUN: llvm-size -B --common %t.o | FileCheck --check-prefix=BSD %s
7# RUN: llvm-size -A %t.o | FileCheck --check-prefix=SYSVNOCOMM %s
8# RUN: llvm-size -B %t.o | FileCheck --check-prefix=BSDNOCOMM %s
9
10# SYSV:      {{.*}}.o  :
11# SYSV-NEXT: section     size   addr
12# SYSV-NEXT: .text          0      0
13# SYSV-NEXT: *COM*          8      0
14# SYSV-NEXT: Total          8
15
16# SYSVNOCOMM:      {{.*}}.o  :
17# SYSVNOCOMM-NEXT: section     size   addr
18# SYSVNOCOMM-NEXT: .text          0      0
19# SYSVNOCOMM-NEXT: Total          0
20
21# BSD:      text    data     bss     dec     hex filename
22# BSD-NEXT:    0       0       8       8       8 {{.*}}.o
23
24# BSDNOCOMM:      text    data     bss     dec     hex filename
25# BSDNOCOMM-NEXT:    0       0       0       0       0 {{.*}}.o
26
27--- !ELF
28FileHeader:
29  Class:   ELFCLASS64
30  Data:    ELFDATA2LSB
31  Type:    ET_EXEC
32  Machine: EM_X86_64
33Sections:
34  - Name: .text
35    Type: SHT_PROGBITS
36Symbols:
37  - Name:  y
38    Type:  STT_OBJECT
39    Size:  4
40    Index: SHN_COMMON
41  - Name:  z
42    Type:  STT_OBJECT
43    Size:  4
44    Index: SHN_COMMON
45