Adrian Prantl | 338ef7a | 2016-11-09 00:42:03 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -debug-info-kind=standalone \ |
| 2 | // RUN: -triple %itanium_abi_triple %s -o - | FileCheck %s |
| 3 | |
| 4 | // Debug info for a global constant whose address is taken should be emitted |
| 5 | // exactly once. |
| 6 | |
| 7 | // CHECK: @i = internal constant i32 1, align 4, !dbg ![[I:[0-9]+]] |
Reid Kleckner | 6d35334 | 2017-08-23 20:31:27 +0000 | [diff] [blame] | 8 | // CHECK: ![[I]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value)) |
Adrian Prantl | 5f4740d | 2016-12-20 02:10:02 +0000 | [diff] [blame] | 9 | // CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "i", |
Adrian Prantl | 338ef7a | 2016-11-09 00:42:03 +0000 | [diff] [blame] | 10 | // CHECK: !DICompileUnit({{.*}}globals: ![[GLOBALS:[0-9]+]]) |
| 11 | // CHECK: ![[GLOBALS]] = !{![[I]]} |
Adrian Prantl | 338ef7a | 2016-11-09 00:42:03 +0000 | [diff] [blame] | 12 | static const int i = 1; |
| 13 | |
| 14 | void g(const int *, int); |
| 15 | void f() { |
| 16 | g(&i, i); |
| 17 | } |