1f1b382e8SDavid Blaikie // RUN: %clang -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
2f1b382e8SDavid Blaikie 
3f1b382e8SDavid Blaikie template<typename T>
4f1b382e8SDavid Blaikie struct foo {
5f1b382e8SDavid Blaikie };
6f1b382e8SDavid Blaikie namespace x {
7f1b382e8SDavid Blaikie // splitting these over multiple lines to make sure the right token is used for
8f1b382e8SDavid Blaikie // the location
9f1b382e8SDavid Blaikie template<typename T>
10f1b382e8SDavid Blaikie using
11f1b382e8SDavid Blaikie # 42
12f1b382e8SDavid Blaikie bar
13f1b382e8SDavid Blaikie = foo<T*>;
14f1b382e8SDavid Blaikie }
15f1b382e8SDavid Blaikie 
169dd4e4e6SDuncan P. N. Exon Smith // CHECK: !DIGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]]
17f1b382e8SDavid Blaikie x::bar<int> bi;
189dd4e4e6SDuncan P. N. Exon Smith // CHECK: !DIGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]]
199dd4e4e6SDuncan P. N. Exon Smith // CHECK: [[BFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<float>"
20f1b382e8SDavid Blaikie x::bar<float> bf;
21f1b382e8SDavid Blaikie 
22f1b382e8SDavid Blaikie using
239dd4e4e6SDuncan P. N. Exon Smith // CHECK: !DIGlobalVariable(name: "n",{{.*}} type: [[NARF:![0-9]+]]
2480bec83dSDavid Blaikie # 142
259dd4e4e6SDuncan P. N. Exon Smith narf // CHECK: [[NARF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "narf"
26f04be1fbSDuncan P. N. Exon Smith // CHECK-SAME:                           line: 142
27f1b382e8SDavid Blaikie = int;
28f1b382e8SDavid Blaikie narf n;
29f1b382e8SDavid Blaikie 
301c286f6dSDavid Blaikie template <typename T>
311c286f6dSDavid Blaikie using tv = void;
329dd4e4e6SDuncan P. N. Exon Smith // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "tv<int>"
331c286f6dSDavid Blaikie tv<int> *tvp;
341c286f6dSDavid Blaikie 
351c286f6dSDavid Blaikie using v = void;
369dd4e4e6SDuncan P. N. Exon Smith // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "v"
371c286f6dSDavid Blaikie v *vp;
38*eeb56abeSPeter Collingbourne 
39*eeb56abeSPeter Collingbourne // CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>"
40*eeb56abeSPeter Collingbourne // CHECK-SAME:                      line: 42,
41