Skip to content

Commit 4410041

Browse files
Michael137zeroomega
authored andcommitted
fixup! fix tests
* `debug-info-static-member.cpp`: * We added the check for `const_b` as part of the patch series in `638a8393615e911b729d5662096f60ef49f1c65e`. The new check `isUsableAsConstantExpression` doesn't support constant inline floats (since they are neither constexpr nor integrals). This isn't a regression since before said patch series we wouldn't ever emit the definition for `const_b` anyway. Now we just don't do it for `const float`s. This is consistent with GCC's behaviour starting with C++11. * `debug-info-static-inline-member`: * This was just a bug which is now fixed. We shouldn't emit a `DW_AT_const_value` for a non-const static.
1 parent f7bc210 commit 4410041

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

clang/test/CodeGenCXX/debug-info-static-inline-member.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ int main() {
6767
// CHECK-SAME: flags: DIFlagStaticMember
6868
// CHECK-NOT: extraData:
6969

70-
// CHECK: ![[IENUM_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "inline_enum",
71-
// CHECK-SAME: flags: DIFlagStaticMember
72-
// CHECK-NOT: extraData:
73-
7470
// CHECK: ![[EMPTY_TEMPLATED_DECL:[0-9]+]] = !DIDerivedType(tag: DW_TAG_member, name: "empty_templated",
7571
// CHECK-SAME: flags: DIFlagStaticMember
7672
// CHECK-NOT: extraData:
@@ -98,11 +94,6 @@ int main() {
9894
// CHECK-NOT: linkageName:
9995
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[ENUM_DECL]])
10096

101-
// CHECK: !DIGlobalVariableExpression(var: ![[IENUM_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
102-
// CHECK: ![[IENUM_VAR]] = distinct !DIGlobalVariable(name: "inline_enum"
103-
// CHECK-NOT: linkageName:
104-
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[IENUM_DECL]])
105-
10697
// CHECK: !DIGlobalVariableExpression(var: ![[EMPTY_TEMPLATED_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
10798
// CHECK: ![[EMPTY_TEMPLATED_VAR]] = distinct !DIGlobalVariable(name: "empty_templated"
10899
// CHECK-NOT: linkageName:

clang/test/CodeGenCXX/debug-info-static-member.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-4 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,NOT-MS %s
1+
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-4 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,CPP11,NOT-MS %s
22
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-4 -std=c++98 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,NOT-MS %s
3-
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-4 -std=c++11 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,NOT-MS %s
4-
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-5 -std=c++11 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF5 %s
5-
// RUN: %clangxx -target x86_64-windows-msvc -g -gdwarf-4 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4 %s
3+
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-4 -std=c++11 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,CPP11,NOT-MS %s
4+
// RUN: %clangxx -target x86_64-unknown-unknown -g -gdwarf-5 -std=c++11 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF5,CPP11 %s
5+
// RUN: %clangxx -target x86_64-windows-msvc -g -gdwarf-4 %s -emit-llvm -S -o - | FileCheck --check-prefixes=CHECK,DWARF4,CPP11 %s
66
// PR14471
77

88
// CHECK: @{{.*}}a{{.*}} = dso_local global i32 4, align 4, !dbg [[A:![0-9]+]]
@@ -171,9 +171,9 @@ int y::z;
171171
// CHECK: ![[CONST_A_VAR]] = distinct !DIGlobalVariable(name: "const_a"
172172
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_A_DECL]])
173173

174-
// CHECK: !DIGlobalVariableExpression(var: ![[CONST_B_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
175-
// CHECK: ![[CONST_B_VAR]] = distinct !DIGlobalVariable(name: "const_b"
176-
// CHECK-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_B_DECL]])
174+
// CPP11: !DIGlobalVariableExpression(var: ![[CONST_B_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, {{.*}}, DW_OP_stack_value))
175+
// CPP11: ![[CONST_B_VAR]] = distinct !DIGlobalVariable(name: "const_b"
176+
// CPP11-SAME: isLocal: true, isDefinition: true, declaration: ![[CONST_B_DECL]])
177177

178178
// CHECK: !DIGlobalVariableExpression(var: ![[CONST_C_VAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 18, DW_OP_stack_value))
179179
// CHECK: ![[CONST_C_VAR]] = distinct !DIGlobalVariable(name: "const_c"

0 commit comments

Comments
 (0)