Clang Project

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