xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/pr13396.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i686-pc-linux-gnu %s -emit-llvm -o - | FileCheck %s
2f4a2713aSLionel Sambuc struct foo {
3f4a2713aSLionel Sambuc   template<typename T>
foofoo4f4a2713aSLionel Sambuc   __attribute__ ((regparm (3))) foo(T x) {}
5f4a2713aSLionel Sambuc   __attribute__ ((regparm (3))) foo();
6f4a2713aSLionel Sambuc   __attribute__ ((regparm (3))) ~foo();
7f4a2713aSLionel Sambuc };
8f4a2713aSLionel Sambuc 
foo()9f4a2713aSLionel Sambuc foo::foo() {
10f4a2713aSLionel Sambuc   // CHECK-LABEL: define void @_ZN3fooC2Ev(%struct.foo* inreg %this)
11*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: define void @_ZN3fooC1Ev(%struct.foo* inreg %this)
12f4a2713aSLionel Sambuc }
13f4a2713aSLionel Sambuc 
~foo()14f4a2713aSLionel Sambuc foo::~foo() {
15f4a2713aSLionel Sambuc   // CHECK-LABEL: define void @_ZN3fooD2Ev(%struct.foo* inreg %this)
16*0a6a1f1dSLionel Sambuc   // CHECK-LABEL: define void @_ZN3fooD1Ev(%struct.foo* inreg %this)
17f4a2713aSLionel Sambuc }
18f4a2713aSLionel Sambuc 
dummy()19f4a2713aSLionel Sambuc void dummy() {
20f4a2713aSLionel Sambuc   // FIXME: how can we explicitly instantiate a template constructor? Gcc and
21f4a2713aSLionel Sambuc   // older clangs accept:
22f4a2713aSLionel Sambuc   // template foo::foo(int x);
23f4a2713aSLionel Sambuc   foo x(10);
24f4a2713aSLionel Sambuc   // CHECK-LABEL: define linkonce_odr void @_ZN3fooC1IiEET_(%struct.foo* inreg %this, i32 inreg %x)
25f4a2713aSLionel Sambuc   // CHECK-LABEL: define linkonce_odr void @_ZN3fooC2IiEET_(%struct.foo* inreg %this, i32 inreg %x)
26f4a2713aSLionel Sambuc }
27