Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
Anders Carlsson | 1fe598c | 2009-11-24 05:16:24 +0000 | [diff] [blame] | 2 | |
| 3 | // CHECK: ; ModuleID |
| 4 | struct A { |
| 5 | template<typename T> |
| 6 | A(T); |
| 7 | }; |
| 8 | |
| 9 | template<typename T> A::A(T) {} |
Anders Carlsson | 7e12003 | 2009-11-24 05:36:32 +0000 | [diff] [blame] | 10 | |
| 11 | struct B { |
| 12 | template<typename T> |
| 13 | B(T); |
| 14 | }; |
| 15 | |
| 16 | template<typename T> B::B(T) {} |
| 17 | |
Rafael Espindola | 0691a5c | 2011-01-25 19:10:24 +0000 | [diff] [blame] | 18 | // CHECK: define weak_odr void @_ZN1BC1IiEET_(%struct.B* %this, i32) unnamed_addr |
| 19 | // CHECK: define weak_odr void @_ZN1BC2IiEET_(%struct.B* %this, i32) unnamed_addr |
Anders Carlsson | 7e12003 | 2009-11-24 05:36:32 +0000 | [diff] [blame] | 20 | template B::B(int); |
Anders Carlsson | a244dc3 | 2009-11-24 16:52:50 +0000 | [diff] [blame] | 21 | |
| 22 | template<typename T> |
| 23 | struct C { |
| 24 | void f() { |
| 25 | int a[] = { 1, 2, 3 }; |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | void f(C<int>& c) { |
| 30 | c.f(); |
| 31 | } |