Rafael Espindola | b48280b | 2012-07-31 02:44:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i686-pc-linux-gnu %s -emit-llvm -o - | FileCheck %s |
Rafael Espindola | a78a640 | 2012-07-31 01:54:04 +0000 | [diff] [blame] | 2 | struct foo { |
| 3 | template<typename T> |
| 4 | __attribute__ ((regparm (3))) foo(T x) {} |
| 5 | __attribute__ ((regparm (3))) foo(); |
| 6 | __attribute__ ((regparm (3))) ~foo(); |
| 7 | }; |
| 8 | |
| 9 | foo::foo() { |
Stephen Lin | 93ab6bf | 2013-08-15 06:47:53 +0000 | [diff] [blame] | 10 | // CHECK-LABEL: define void @_ZN3fooC2Ev(%struct.foo* inreg %this) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 11 | // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this) |
Rafael Espindola | a78a640 | 2012-07-31 01:54:04 +0000 | [diff] [blame] | 12 | } |
| 13 | |
| 14 | foo::~foo() { |
Stephen Lin | 93ab6bf | 2013-08-15 06:47:53 +0000 | [diff] [blame] | 15 | // CHECK-LABEL: define void @_ZN3fooD2Ev(%struct.foo* inreg %this) |
Stephen Hines | 651f13c | 2014-04-23 16:59:28 -0700 | [diff] [blame] | 16 | // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this) |
Rafael Espindola | a78a640 | 2012-07-31 01:54:04 +0000 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | void dummy() { |
| 20 | // FIXME: how can we explicitly instantiate a template constructor? Gcc and |
| 21 | // older clangs accept: |
| 22 | // template foo::foo(int x); |
| 23 | foo x(10); |
Stephen Lin | 93ab6bf | 2013-08-15 06:47:53 +0000 | [diff] [blame] | 24 | // CHECK-LABEL: define linkonce_odr void @_ZN3fooC1IiEET_(%struct.foo* inreg %this, i32 inreg %x) |
| 25 | // CHECK-LABEL: define linkonce_odr void @_ZN3fooC2IiEET_(%struct.foo* inreg %this, i32 inreg %x) |
Rafael Espindola | a78a640 | 2012-07-31 01:54:04 +0000 | [diff] [blame] | 26 | } |