brintos

brintos / llvm-project-archived public Read only

0
0
Text · 670 B · 5abc050 Raw
23 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s2 3// Multiple references to the same constant should result in only one entry in4// the globals list.5 6namespace ns {7const int cnst = 42;8}9int f1() {10  return ns::cnst + ns::cnst;11}12 13// CHECK: !DICompileUnit(14// CHECK-SAME:           globals: [[GLOBALS:![0-9]*]]15 16// CHECK: [[GLOBALS]] = !{[[CNST:![0-9]*]]}17 18// CHECK: [[CNST]] = !DIGlobalVariableExpression(var: [[CNSTV:.*]], expr:19// CHECK: [[CNSTV]] = distinct !DIGlobalVariable(name: "cnst",20// CHECK-SAME:                                   scope: [[NS:![0-9]*]]21// CHECK: [[NS]] = !DINamespace(name: "ns"22 23