49 lines · cpp
1// RUN: %clang -g -gno-template-alias -std=c++11 -S -emit-llvm %s -o - | FileCheck %s2 3template<typename T>4struct foo {5};6 7template<typename T, typename T2 = int>8struct baz {9};10 11namespace x {12// splitting these over multiple lines to make sure the right token is used for13// the location14template<typename T>15using16# 4217bar18= foo<T*>;19}20 21// CHECK: !DIGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]]22x::bar<int> bi;23// CHECK: !DIGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]]24// CHECK: [[BFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<float>"25x::bar<float> bf;26// CHECK: !DIGlobalVariable(name: "bz",{{.*}} type: [[BBAZ:![0-9]+]]27// CHECK: [[BBAZ]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<baz<int,{{ *}}int> >"28x::bar<baz<int>> bz;29 30using31// CHECK: !DIGlobalVariable(name: "n",{{.*}} type: [[NARF:![0-9]+]]32# 14233narf // CHECK: [[NARF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "narf"34// CHECK-SAME: line: 14235= int;36narf n;37 38template <typename T>39using tv = void;40// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "tv<int>"41tv<int> *tvp;42 43using v = void;44// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "v"45v *vp;46 47// CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>"48// CHECK-SAME: line: 42,49