Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -g %s -o - | FileCheck %s
      2 
      3 // Multiple references to the same constant should result in only one entry in
      4 // the globals list.
      5 
      6 namespace ns {
      7 const int cnst = 42;
      8 }
      9 int f1() {
     10   return ns::cnst + ns::cnst;
     11 }
     12 
     13 // CHECK: !MDCompileUnit(
     14 // CHECK-SAME:           globals: [[GLOBALS:![0-9]*]]
     15 
     16 // CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}
     17 
     18 // CHECK: [[CNST]] = !MDGlobalVariable(name: "cnst",
     19 // CHECK-SAME:                         scope: [[NS:![0-9]*]]
     20 // CHECK: [[NS]] = !MDNamespace(name: "ns"
     21 
     22