]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/debug-info-global-constant.c
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / CodeGen / debug-info-global-constant.c
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]+]]
8 // CHECK: ![[I]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: ![[EXPR:[0-9]+]])
9 // CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "i",
10 // CHECK: !DICompileUnit({{.*}}globals: ![[GLOBALS:[0-9]+]])
11 // CHECK: ![[GLOBALS]] = !{![[I]]}
12 // CHECK: ![[EXPR]] = !DIExpression(DW_OP_constu, 1, DW_OP_stack_value)
13 static const int i = 1;
14
15 void g(const int *, int);
16 void f() {
17   g(&i, i);
18 }