2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
|
2014-04-05 15:23:17 +08:00
|
|
|
|
|
|
|
// Multiple references to the same constant should result in only one entry in
|
|
|
|
// the globals list.
|
|
|
|
|
2014-04-05 15:46:57 +08:00
|
|
|
namespace ns {
|
2014-04-05 15:23:17 +08:00
|
|
|
const int cnst = 42;
|
2014-04-05 15:46:57 +08:00
|
|
|
}
|
2014-04-05 15:23:17 +08:00
|
|
|
int f1() {
|
2014-04-05 15:46:57 +08:00
|
|
|
return ns::cnst + ns::cnst;
|
2014-04-05 15:23:17 +08:00
|
|
|
}
|
|
|
|
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DICompileUnit(
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: globals: [[GLOBALS:![0-9]*]]
|
2014-04-05 15:23:17 +08:00
|
|
|
|
2014-12-16 03:10:08 +08:00
|
|
|
// CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}
|
2014-04-05 15:23:17 +08:00
|
|
|
|
2016-12-20 10:10:02 +08:00
|
|
|
// CHECK: [[CNST]] = !DIGlobalVariableExpression(var: [[CNSTV:.*]], expr:
|
|
|
|
// CHECK: [[CNSTV]] = distinct !DIGlobalVariable(name: "cnst",
|
|
|
|
// CHECK-SAME: scope: [[NS:![0-9]*]]
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: [[NS]] = !DINamespace(name: "ns"
|
2014-04-05 15:46:57 +08:00
|
|
|
|