Clang Project

clang_source_code/test/CodeGenCXX/debug-info-dllimport-base-class.cpp
1// RUN: %clang_cc1 -triple i386-pc-windows -emit-llvm -gcodeview -debug-info-kind=limited -fms-compatibility %s -x c++ -o - | FileCheck %s
2
3// Ensure we emit debug info for the full definition of base classes that will
4// be imported from a DLL.  Otherwise, the debugger wouldn't be able to show the
5// members.
6
7// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ImportedAfterCompletion",
8// CHECK-NOT:              DIFlagFwdDecl
9// CHECK-SAME:             ){{$}}
10
11// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OutOfLineCtor",
12// CHECK-SAME:             DIFlagFwdDecl
13// CHECK-SAME:             ){{$}}
14
15// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ImportedBase",
16// CHECK-NOT:              DIFlagFwdDecl
17// CHECK-SAME:             ){{$}}
18
19// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ImportedMethod",
20// CHECK-NOT:              DIFlagFwdDecl
21// CHECK-SAME:             ){{$}}
22
23
24struct ImportedAfterCompletion;
25ImportedAfterCompletion *force_fwd_decl;
26struct __declspec(dllimport) ImportedAfterCompletion {
27  virtual ~ImportedAfterCompletion();
28};
29
30struct OutOfLineCtor {
31  OutOfLineCtor();
32  virtual void Foo();
33};
34
35struct __declspec(dllimport) ImportedBase {
36  ImportedBase();
37  virtual void Foo();
38};
39
40struct DerivedFromImported : public ImportedBase {};
41
42struct ImportedMethod {
43  ImportedMethod();
44  virtual void Foo();
45  static void __declspec(dllimport) create();
46};
47
48int main() {
49  ImportedAfterCompletion c;
50  OutOfLineCtor o;
51  DerivedFromImported d;
52  ImportedMethod m;
53}
54