2016-11-09 08:42:03 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone \
|
|
|
|
// RUN: -triple %itanium_abi_triple %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
// Debug info for a global constant whose address is taken should be emitted
|
|
|
|
// exactly once.
|
|
|
|
|
|
|
|
// CHECK: @i = internal constant i32 1, align 4, !dbg ![[I:[0-9]+]]
|
2017-08-24 04:31:27 +08:00
|
|
|
// CHECK: ![[I]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value))
|
2016-12-20 10:10:02 +08:00
|
|
|
// CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "i",
|
2016-11-09 08:42:03 +08:00
|
|
|
// CHECK: !DICompileUnit({{.*}}globals: ![[GLOBALS:[0-9]+]])
|
|
|
|
// CHECK: ![[GLOBALS]] = !{![[I]]}
|
|
|
|
static const int i = 1;
|
|
|
|
|
|
|
|
void g(const int *, int);
|
|
|
|
void f() {
|
|
|
|
g(&i, i);
|
|
|
|
}
|