Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-alias.cpp
blob3d3f87ed1f6fa8835c099be0f44fb789c2e87bda
1 // RUN: %clang -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
3 template<typename T>
4 struct foo {
5 };
7 template<typename T, typename T2 = int>
8 struct baz {
9 };
11 namespace x {
12 // splitting these over multiple lines to make sure the right token is used for
13 // the location
14 template<typename T>
15 using
16 # 42
17 bar
18 = foo<T*>;
21 // CHECK: !DIGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]]
22 x::bar<int> bi;
23 // CHECK: !DIGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]]
24 // CHECK: [[BFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<float>"
25 x::bar<float> bf;
26 // CHECK: !DIGlobalVariable(name: "bz",{{.*}} type: [[BBAZ:![0-9]+]]
27 // CHECK: [[BBAZ]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<baz<int> >"
28 x::bar<baz<int>> bz;
30 using
31 // CHECK: !DIGlobalVariable(name: "n",{{.*}} type: [[NARF:![0-9]+]]
32 # 142
33 narf // CHECK: [[NARF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "narf"
34 // CHECK-SAME: line: 142
35 = int;
36 narf n;
38 template <typename T>
39 using tv = void;
40 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "tv<int>"
41 tv<int> *tvp;
43 using v = void;
44 // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "v"
45 v *vp;
47 // CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>"
48 // CHECK-SAME: line: 42,