Skip to content

Commit 2cc1297

Browse files
committed
fixup! add test for function local structors
1 parent 522f021 commit 2cc1297

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Tests that we emit don't emit unified constructor/destructor linkage names
2+
// for function-local constructors.
3+
4+
// Check with -gstructor-decl-linkage-names.
5+
// RUN: %clang_cc1 -triple aarch64-apple-macosx -emit-llvm -debug-info-kind=standalone \
6+
// RUN: -gstructor-decl-linkage-names %s -o - | FileCheck %s --check-prefixes=CHECK
7+
//
8+
// Check with -gno-structor-decl-linkage-names.
9+
// RUN: %clang_cc1 -triple aarch64-apple-macosx -emit-llvm -debug-info-kind=standalone \
10+
// RUN: -gno-structor-decl-linkage-names %s -o - | FileCheck %s --check-prefixes=CHECK
11+
12+
struct HasNestedCtor {
13+
HasNestedCtor();
14+
};
15+
16+
HasNestedCtor::HasNestedCtor() {
17+
struct Local {
18+
Local() {}
19+
~Local() {}
20+
} l;
21+
}
22+
23+
// CHECK: !DISubprogram(name: "Local"
24+
// CHECK-NOT: linkageName
25+
// CHECK-SAME: )
26+
27+
// CHECK: !DISubprogram(name: "~Local"
28+
// CHECK-NOT: linkageName
29+
// CHECK-SAME: )

0 commit comments

Comments
 (0)