File: symbols-invalid.test

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (78 lines) | stat: -rw-r--r-- 3,149 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
## Test that we report warnings or dump raw data when symbols are invalid.

# RUN: yaml2obj %s --docnum=1 -o %t1
# RUN: llvm-readobj --syms %t1 2>&1 | FileCheck %s -DFILE=%t1 --check-prefix=CASE1

# CASE1: warning: '[[FILE]]': the non-function C_EXT symbol at index 1 should have only 1 auxiliary entry, i.e. the CSECT auxiliary entry

--- !XCOFF
FileHeader:
  MagicNumber: 0x1DF
Symbols:
  - Name: .sym
  - Name:               .fun
    StorageClass:       [[STORAGECLASS='C_EXT']]
    NumberOfAuxEntries: 2

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_WEAKEXT' -o %t2
# RUN: llvm-readobj --syms %t2 2>&1 | FileCheck %s -DFILE=%t2 --check-prefix=CASE2

# CASE2: warning: '[[FILE]]': the non-function C_WEAKEXT symbol at index 1 should have only 1 auxiliary entry, i.e. the CSECT auxiliary entry

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_HIDEXT' -o %t3
# RUN: llvm-readobj --syms %t3 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=CASE3

# CASE3: warning: '[[FILE]]': the non-function C_HIDEXT symbol at index 1 should have only 1 auxiliary entry, i.e. the CSECT auxiliary entry

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_STAT' -o %t4
# RUN: llvm-readobj --syms %t4 2>&1 | FileCheck %s -DFILE=%t4 --check-prefix=CASE4

# CASE4: warning: '[[FILE]]': the C_STAT symbol at index 1 should not have more than 1 auxiliary entry

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_DWARF' -o %t5
# RUN: llvm-readobj --syms %t5 2>&1 | FileCheck %s -DFILE=%t5 --check-prefix=CASE5

# CASE5: warning: '[[FILE]]': the C_DWARF symbol at index 1 should not have more than 1 auxiliary entry

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_BLOCK' -o %t6
# RUN: llvm-readobj --syms %t6 2>&1 | FileCheck %s -DFILE=%t6 --check-prefix=CASE6

# CASE6: warning: '[[FILE]]': the C_BLOCK symbol at index 1 should not have more than 1 auxiliary entry

# RUN: yaml2obj %s --docnum=1 -DSTORAGECLASS='C_FCN' -o %t7
# RUN: llvm-readobj --syms %t7 2>&1 | FileCheck %s -DFILE=%t7 --check-prefix=CASE7

# CASE7: warning: '[[FILE]]': the C_FCN symbol at index 1 should not have more than 1 auxiliary entry

## This case tests the raw data output ability when a file auxiliary entry does
## not have the matching auxiliary type.
# RUN: yaml2obj %s --docnum=2 -o %t8
# RUN: llvm-readobj --syms %t8 | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=CASE8

#      CASE8:Symbols [
# CASE8-NEXT:  Symbol {
# CASE8-NEXT:    Index: 0
# CASE8-NEXT:    Name: .fun
# CASE8-NEXT:    Value (SymbolTableIndex): 0x0
# CASE8-NEXT:    Section: N_UNDEF
# CASE8-NEXT:    Source Language ID: TB_C (0x0)
# CASE8-NEXT:    CPU Version ID: 0x0
# CASE8-NEXT:    StorageClass: C_FILE (0x67)
# CASE8-NEXT:    NumberOfAuxEntries: 1
# CASE8-NEXT:    !Unexpected raw auxiliary entry data:
# CASE8-NEXT:    00000000 00000001 00020300 00000000 00fb
# CASE8-NEXT:  }
# CASE8-NEXT:]

--- !XCOFF
FileHeader:
  MagicNumber: 0x1F7
Symbols:
  - Name:         .fun
    StorageClass: C_FILE
    AuxEntries:
      - Type:                   AUX_CSECT
        ParameterHashIndex:     1
        TypeChkSectNum:         2
        SymbolAlignmentAndType: 3
        StorageMappingClass:    XMC_PR