mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-03 15:06:08 +00:00

LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. llvm-svn: 236121
22 lines
554 B
C++
22 lines
554 B
C++
// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -g %s -o - | FileCheck %s
|
|
|
|
// Multiple references to the same constant should result in only one entry in
|
|
// the globals list.
|
|
|
|
namespace ns {
|
|
const int cnst = 42;
|
|
}
|
|
int f1() {
|
|
return ns::cnst + ns::cnst;
|
|
}
|
|
|
|
// CHECK: !DICompileUnit(
|
|
// CHECK-SAME: globals: [[GLOBALS:![0-9]*]]
|
|
|
|
// CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}
|
|
|
|
// CHECK: [[CNST]] = !DIGlobalVariable(name: "cnst",
|
|
// CHECK-SAME: scope: [[NS:![0-9]*]]
|
|
// CHECK: [[NS]] = !DINamespace(name: "ns"
|
|
|