[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-class-optzns.cpp
blobcf44570bb296ed89e3ad487b3e3bd65b766f8981
1 // RUN: %clang_cc1 -triple x86_64-unknown_unknown -emit-llvm -debug-info-kind=limited %s -O1 -disable-llvm-passes -o - | FileCheck %s
3 // Ensure class definitions are not emitted to debug info just because the
4 // vtable is emitted for optimization purposes (as available_externally). The
5 // class definition debug info should only go where the vtable is actually
6 // emitted into the object file.
8 // CHECK: @_ZTV3foo = available_externally
10 // Verify that this doesn't involve querying for the vtable of types that aren't
11 // dynamic (that would cause an assertion in the case below)
13 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "bar<int>"
14 template <typename> struct bar {};
15 extern template struct bar<int>;
16 bar<int> *p1;
17 bar<int> a;
19 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "foo"
20 // CHECK-SAME: DIFlagFwdDecl
22 struct foo {
23 virtual void f();
26 foo f;