2014-04-05 15:23:17 +08:00
|
|
|
// 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.
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2014-12-16 03:10:08 +08:00
|
|
|
// CHECK: !"0x11\00{{.*}}"{{.*}}, [[GLOBALS:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_compile_unit ]
|
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
|
|
|
|
2014-12-16 03:10:08 +08:00
|
|
|
// CHECK: [[CNST]] = !{!"0x34\00cnst\00{{.*}}", [[NS:![0-9]*]], {{[^,]+, [^,]+, [^,]+, [^,]+}}} ; [ DW_TAG_variable ] [cnst]
|
2014-04-05 15:46:57 +08:00
|
|
|
// CHECK: [[NS]] = {{.*}}; [ DW_TAG_namespace ] [ns]
|
|
|
|
|