brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · a814e6f Raw
55 lines · cpp
1// RUN: %clang_cc1 -DSETATTR=0 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=DEBUG2// RUN: %clang_cc1 -DSETATTR=1 -triple x86_64-unknown-linux-gnu -emit-llvm -debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=WITHATTR3// Use -debug-info-kind=constructor because it includes all the optimizations.4 5#if SETATTR6#define STANDALONEDEBUGATTR __attribute__((standalone_debug))7#else8#define STANDALONEDEBUGATTR9#endif10 11struct STANDALONEDEBUGATTR StructWithConstructor {12  StructWithConstructor() {}13};14void f(StructWithConstructor s) {}15// DEBUG:  !DICompositeType({{.*}}name: "StructWithConstructor"16// DEBUG-SAME:              flags: {{.*}}DIFlagFwdDecl17// WITHATTR: !DICompositeType({{.*}}name: "StructWithConstructor"18// WITHATTR-NOT: DIFlagFwdDecl19 20union STANDALONEDEBUGATTR UnionWithConstructor {21  UnionWithConstructor() {}22};23void f(UnionWithConstructor u) {}24// DEBUG:  !DICompositeType({{.*}}name: "UnionWithConstructor"25// DEBUG-SAME:              flags: {{.*}}DIFlagFwdDecl26// WITHATTR: !DICompositeType({{.*}}name: "UnionWithConstructor"27// WITHATTR-NOT: DIFlagFwdDecl28 29template <typename T> struct ExternTemplate {30  ExternTemplate() {}31  T x;32};33extern template struct STANDALONEDEBUGATTR ExternTemplate<int>;34void f(ExternTemplate<int> s) {}35// DEBUG: !DICompositeType({{.*}}name: "ExternTemplate<int>"36// DEBUG-SAME:             flags: {{.*}}DIFlagFwdDecl37// WITHATTR: !DICompositeType({{.*}}name: "ExternTemplate<int>"38// WITHATTR-NOT: DIFlagFwdDecl39 40struct STANDALONEDEBUGATTR CompleteTypeRequired {};41void f(CompleteTypeRequired &s) {}42// DEBUG: !DICompositeType({{.*}}name: "CompleteTypeRequired"43// DEBUG-SAME:             flags: {{.*}}DIFlagFwdDecl44// WITHATTR: !DICompositeType({{.*}}name: "CompleteTypeRequired"45// WITHATTR-NOT: DIFlagFwdDecl46 47struct STANDALONEDEBUGATTR Redecl;48struct Redecl {};49void f(Redecl &s) {}50// DEBUG: !DICompositeType({{.*}}name: "Redecl"51// DEBUG-SAME:             flags: {{.*}}DIFlagFwdDecl52// WITHATTR: !DICompositeType({{.*}}name: "Redecl"53// WITHATTR-NOT: DIFlagFwdDecl54 55