xref: /llvm-project/lldb/test/Shell/SymbolFile/NativePDB/missing-type.s (revision 5c9f3ec4ad5d930f38c5682345a589ce57a5d602)
1# clang-format off
2# REQUIRES: lld, x86
3
4# Test when type index is missing in FieldList.
5# RUN: llvm-mc -triple=x86_64-windows-msvc --filetype=obj %s > %t.obj
6# RUN: lld-link /debug:full /nodefaultlib /entry:main %t.obj /out:%t.exe /base:0x140000000
7# RUN: lldb-test symbols --find=type --name=S %t.exe | FileCheck %s
8
9# CHECK:      name = "S", size = 4, compiler_type = {{.*}} struct S {
10# CHECK-NEXT: }
11
12
13
14	.text
15	.def	@feat.00;
16	.scl	3;
17	.type	0;
18	.endef
19	.globl	@feat.00
20.set @feat.00, 0
21	.intel_syntax noprefix
22	.file	"a.cpp"
23	.def	main;
24	.scl	2;
25	.type	32;
26	.endef
27	.globl	main                            # -- Begin function main
28	.p2align	4, 0x90
29main:                                   # @main
30.seh_proc main
31# %bb.0:                                # %entry
32	sub	rsp, 24
33	.seh_stackalloc 24
34	.seh_endprologue
35	mov	dword ptr [rsp + 20], 0
36	mov	qword ptr [rsp + 8], rdx
37	mov	dword ptr [rsp + 4], ecx
38.Ltmp0:
39	mov	eax, dword ptr [rsp]
40	add	rsp, 24
41	ret
42.Ltmp1:
43.Lfunc_end0:
44	.seh_endproc
45                                        # -- End function
46	.section	.drectve,"yn"
47.Ltmp25:
48	.section	.debug$T,"dr"
49	.p2align	2
50	.long	4                               # Debug section magic
51	# Pointer (0x1000)
52	.short	0xa                             # Record length
53	.short	0x1002                          # Record kind: LF_POINTER
54	.long	0x670                           # PointeeType: char*
55	.long	0x1000c                         # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
56	# ArgList (0x1001)
57	.short	0xe                             # Record length
58	.short	0x1201                          # Record kind: LF_ARGLIST
59	.long	0x2                             # NumArgs
60	.long	0x74                            # Argument: int
61	.long	0x1000                          # Argument: char**
62	# Procedure (0x1002)
63	.short	0xe                             # Record length
64	.short	0x1008                          # Record kind: LF_PROCEDURE
65	.long	0x74                            # ReturnType: int
66	.byte	0x0                             # CallingConvention: NearC
67	.byte	0x0                             # FunctionOptions
68	.short	0x2                             # NumParameters
69	.long	0x1001                          # ArgListType: (int, char**)
70	# FuncId (0x1003)
71	.short	0x12                            # Record length
72	.short	0x1601                          # Record kind: LF_FUNC_ID
73	.long	0x0                             # ParentScope
74	.long	0x1002                          # FunctionType: int (int, char**)
75	.asciz	"main"                          # Name
76	.byte	243
77	.byte	242
78	.byte	241
79	# Struct (0x1004)
80	.short	0x1e                            # Record length
81	.short	0x1505                          # Record kind: LF_STRUCTURE
82	.short	0x0                             # MemberCount
83	.short	0x280                           # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
84	.long	0x0                             # FieldList
85	.long	0x0                             # DerivedFrom
86	.long	0x0                             # VShape
87	.short	0x0                             # SizeOf
88	.asciz	"S"                             # Name
89	.asciz	".?AUS@@"                       # LinkageName
90	# FieldList (0x1005)
91	.short	0xe                             # Record length
92	.short	0x1203                          # Record kind: LF_FIELDLIST
93	.short	0x150d                          # Member kind: DataMember ( LF_MEMBER )
94	.short	0x3                             # Attrs: Public
95	.long	0                               # Type. It's intentionally written as 0 for testing.
96	.short	0x0                             # FieldOffset
97	.asciz	"x"                             # Name
98	# Struct (0x1006)
99	.short	0x1e                            # Record length
100	.short	0x1505                          # Record kind: LF_STRUCTURE
101	.short	0x1                             # MemberCount
102	.short	0x200                           # Properties ( HasUniqueName (0x200) )
103	.long	0x1005                          # FieldList: <field list>
104	.long	0x0                             # DerivedFrom
105	.long	0x0                             # VShape
106	.short	0x4                             # SizeOf
107	.asciz	"S"                             # Name
108	.asciz	".?AUS@@"                       # LinkageName
109