1 ## Show that llvm-readobj prints the symbol visibility where recognised, or
2 ## something sensible when not, for both GNU and LLVM output.
4 ## Check how we dump symbols when they have only STV_* bits set for st_other.
5 ## (This is the most common case).
7 # RUN: yaml2obj --docnum=1 %s -o %t1.o
8 # RUN: llvm-readobj --symbols %t1.o | FileCheck %s --check-prefix=LLVM
9 # RUN: llvm-readelf --symbols %t1.o | FileCheck %s --strict-whitespace --check-prefix=GNU
10 # RUN: llvm-readobj --symbols --pretty-print --elf-output-style=JSON %t1.o | FileCheck %s --check-prefix=JSON
14 # LLVM: Name: internal
16 # LLVM-NEXT: STV_INTERNAL (0x1)
20 # LLVM-NEXT: STV_HIDDEN (0x2)
22 # LLVM: Name: protected
24 # LLVM-NEXT: STV_PROTECTED (0x3)
28 # GNU-NEXT: DEFAULT UND
29 # GNU-NEXT: DEFAULT UND default
30 # GNU-NEXT: INTERNAL UND internal
31 # GNU-NEXT: HIDDEN UND hidden
32 # GNU-NEXT: PROTECTED UND protected
34 # JSON: "Name": "default",
36 # JSON-NEXT: "Value": 0,
37 # JSON-NEXT: "Flags": []
40 # JSON: "Name": "internal",
42 # JSON-NEXT: "Value": 1,
43 # JSON-NEXT: "Flags": [
45 # JSON-NEXT: "Name": "STV_INTERNAL",
46 # JSON-NEXT: "Value": 1
51 # JSON: "Name": "hidden",
53 # JSON-NEXT: "Value": 2,
54 # JSON-NEXT: "Flags": [
56 # JSON-NEXT: "Name": "STV_HIDDEN",
57 # JSON-NEXT: "Value": 2
62 # JSON: "Name": "protected",
64 # JSON-NEXT: "Value": 3,
65 # JSON-NEXT: "Flags": [
67 # JSON-NEXT: "Name": "STV_PROTECTED",
68 # JSON-NEXT: "Value": 3
80 Other: [ STV_DEFAULT ]
83 Other: [ STV_INTERNAL ]
89 Other: [ STV_PROTECTED ]
92 ## Check the output when we have non-visibility bits set for at least one of the symbols.
94 # RUN: yaml2obj --docnum=2 %s -o %t2.o
95 # RUN: llvm-readobj --symbols %t2.o | FileCheck %s --check-prefixes=LLVM,LLVM-OTHER
96 # RUN: llvm-readelf --symbols %t2.o | FileCheck %s --strict-whitespace --check-prefix=GNU-OTHER
98 # LLVM-OTHER: Name: other
99 # LLVM-OTHER: Other [ (0x4)
102 # GNU-OTHER: Vis Ndx Name
103 # GNU-OTHER-NEXT: DEFAULT UND
104 # GNU-OTHER-NEXT: DEFAULT UND default
105 # GNU-OTHER-NEXT: INTERNAL UND internal
106 # GNU-OTHER-NEXT: HIDDEN UND hidden
107 # GNU-OTHER-NEXT: PROTECTED UND protected
108 # GNU-OTHER-NEXT: DEFAULT [<other: 0x4>] UND other
117 Other: [ STV_DEFAULT ]
119 Other: [ STV_INTERNAL ]
121 Other: [ STV_HIDDEN ]
123 Other: [ STV_PROTECTED ]