1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -g %s -o - | FileCheck %s
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc // Multiple references to the same constant should result in only one entry in
4*0a6a1f1dSLionel Sambuc // the globals list.
5*0a6a1f1dSLionel Sambuc
6*0a6a1f1dSLionel Sambuc namespace ns {
7*0a6a1f1dSLionel Sambuc const int cnst = 42;
8*0a6a1f1dSLionel Sambuc }
f1()9*0a6a1f1dSLionel Sambuc int f1() {
10*0a6a1f1dSLionel Sambuc return ns::cnst + ns::cnst;
11*0a6a1f1dSLionel Sambuc }
12*0a6a1f1dSLionel Sambuc
13*0a6a1f1dSLionel Sambuc // CHECK: !"0x11\00{{.*}}"{{.*}}, [[GLOBALS:![0-9]*]], {{![0-9]*}}} ; [ DW_TAG_compile_unit ]
14*0a6a1f1dSLionel Sambuc
15*0a6a1f1dSLionel Sambuc // CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}
16*0a6a1f1dSLionel Sambuc
17*0a6a1f1dSLionel Sambuc // CHECK: [[CNST]] = !{!"0x34\00cnst\00{{.*}}", [[NS:![0-9]*]], {{[^,]+, [^,]+, [^,]+, [^,]+}}} ; [ DW_TAG_variable ] [cnst]
18*0a6a1f1dSLionel Sambuc // CHECK: [[NS]] = {{.*}}; [ DW_TAG_namespace ] [ns]
19*0a6a1f1dSLionel Sambuc
20