blob: 2354a1a51250ff95d734f10090583de33cbe39b2 [file] [log] [blame]
Eric Christopher947bb5a2012-03-13 23:40:48 +00001// RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s
2
David Blaikiefd07c602013-08-09 17:20:05 +00003struct MyClass {
4 template <int i> int add(int j) {
5 return i + j;
6 }
Eric Christopher947bb5a2012-03-13 23:40:48 +00007};
8
David Blaikiefd07c602013-08-09 17:20:05 +00009int add2(int x) {
10 return MyClass().add<2>(x);
11}
Eric Christopher947bb5a2012-03-13 23:40:48 +000012
David Blaikiefd07c602013-08-09 17:20:05 +000013inline int add3(int x) {
14 return MyClass().add<3>(x); // even though add<3> is ODR used, don't emit it since we don't codegen it
15}
16
17// CHECK: metadata [[C_MEM:![0-9]*]], i32 0, null, null} ; [ DW_TAG_structure_type ] [MyClass]
18// CHECK: [[C_MEM]] = metadata !{metadata [[C_TEMP:![0-9]*]]}
19// CHECK: [[C_TEMP]] = {{.*}} ; [ DW_TAG_subprogram ] [line 4] [add<2>]