1 // This tests that we can deserialize and reserialize every known type record.
2 // If you need to update the object file, enable the RUNX line below using MSVC
3 // from VS 2012. Newer versions of MSVC emit tons of internal types for
4 // attributes that pollute the test output. When Clang fully supports all these
5 // type records, we can regenerate the test using it instead.
7 // RUNX: cl -GR- -Z7 -c -TP %s -Fo%S/Inputs/codeview-types.obj
8 // RUN: llvm-readobj --codeview %S/Inputs/codeview-types.obj | FileCheck %s
9 // RUN: llvm-readobj --codeview-merged-types %S/Inputs/codeview-types.obj | FileCheck %s
12 // CHECK-DAG: {{^ *Pointer (.*) {$}}
13 // CHECK-DAG: {{^ *Modifier (.*) {$}}
14 // CHECK-DAG: {{^ *Procedure (.*) {$}}
15 // CHECK-DAG: {{^ *MemberFunction (.*) {$}}
16 // CHECK-DAG: {{^ *ArgList (.*) {$}}
17 // CHECK-DAG: {{^ *Array (.*) {$}}
18 // CHECK-DAG: {{^ *Class (.*) {$}}
19 // CHECK-DAG: {{^ *Union (.*) {$}}
20 // CHECK-DAG: {{^ *Enum (.*) {$}}
21 // CHECK-DAG: {{^ *VFTable (.*) {$}}
22 // CHECK-DAG: {{^ *VFTableShape (.*) {$}}
23 // CHECK-DAG: {{^ *FuncId (.*) {$}}
24 // CHECK-DAG: {{^ *MemberFuncId (.*) {$}}
25 // CHECK-DAG: {{^ *BuildInfo (.*) {$}}
26 // CHECK-DAG: {{^ *StringId (.*) {$}}
27 // CHECK-DAG: {{^ *UdtSourceLine (.*) {$}}
28 // CHECK-DAG: {{^ *MethodOverloadList (.*) {$}}
29 // No TypeServer2, since that is used with /Zi
32 // CHECK-DAG: {{^ *BaseClass {$}}
33 // CHECK-DAG: {{^ *VirtualBaseClass {$}}
34 // CHECK-DAG: {{^ *VFPtr {$}}
35 // CHECK-DAG: {{^ *StaticDataMember {$}}
36 // CHECK-DAG: {{^ *OverloadedMethod {$}}
37 // CHECK-DAG: {{^ *DataMember {$}}
38 // CHECK-DAG: {{^ *NestedType {$}}
39 // CHECK-DAG: {{^ *OneMethod {$}}
40 // CHECK-DAG: {{^ *Enumerator {$}}
42 #if !defined(__clang__) && _MSC_VER >= 1800
43 #error "use clang or MSVC 2012 to regenerate the test"
51 const Class *DataMember;
53 static int StaticDataMember;
55 virtual void MemberFunction();
59 friend void FriendFunc() { }
60 void OverloadedMethod();
61 void OverloadedMethod(int);
69 int array[4] = {1, 2, 3, 4};
71 struct Class::Nested {};
73 struct ClassWithBase : Class {
74 virtual void MemberFunction();
75 virtual void NewVirtual();
77 struct VBaseA { int x; };
78 struct VBaseB : virtual VBaseA { int x; };
79 struct VBaseC : virtual VBaseA { int x; };
80 struct VBaseD : VBaseB, VBaseC { int x; };