blob: e41dd39fcc6e7095bfb12d8ec0c65ff02cd3966a [file] [log] [blame]
Rafael Espindolab48280b2012-07-31 02:44:24 +00001// RUN: %clang_cc1 -triple i686-pc-linux-gnu %s -emit-llvm -o - | FileCheck %s
Rafael Espindolaa78a6402012-07-31 01:54:04 +00002struct foo {
3 template<typename T>
4 __attribute__ ((regparm (3))) foo(T x) {}
5 __attribute__ ((regparm (3))) foo();
6 __attribute__ ((regparm (3))) ~foo();
7};
8
9foo::foo() {
Stephen Lin93ab6bf2013-08-15 06:47:53 +000010 // CHECK-LABEL: define void @_ZN3fooC2Ev(%struct.foo* inreg %this)
Stephen Hines651f13c2014-04-23 16:59:28 -070011 // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this)
Rafael Espindolaa78a6402012-07-31 01:54:04 +000012}
13
14foo::~foo() {
Stephen Lin93ab6bf2013-08-15 06:47:53 +000015 // CHECK-LABEL: define void @_ZN3fooD2Ev(%struct.foo* inreg %this)
Stephen Hines651f13c2014-04-23 16:59:28 -070016 // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this)
Rafael Espindolaa78a6402012-07-31 01:54:04 +000017}
18
19void 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 Lin93ab6bf2013-08-15 06:47:53 +000024 // 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 Espindolaa78a6402012-07-31 01:54:04 +000026}