27 lines · cpp
1// RUN: %clang_cc1 -triple i686-pc-linux-gnu %s -emit-llvm -o - | FileCheck %s2struct 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() {10 // CHECK-LABEL: define{{.*}} void @_ZN3fooC2Ev(ptr inreg noundef nonnull align 1 dereferenceable(1) %this)11 // CHECK-LABEL: define{{.*}} void @_ZN3fooC1Ev(ptr inreg noundef nonnull align 1 dereferenceable(1) %this)12}13 14foo::~foo() {15 // CHECK-LABEL: define{{.*}} void @_ZN3fooD2Ev(ptr inreg noundef nonnull align 1 dereferenceable(1) %this)16 // CHECK-LABEL: define{{.*}} void @_ZN3fooD1Ev(ptr inreg noundef nonnull align 1 dereferenceable(1) %this)17}18 19void dummy() {20 // FIXME: how can we explicitly instantiate a template constructor? Gcc and21 // older clangs accept:22 // template foo::foo(int x);23 foo x(10);24 // CHECK-LABEL: define linkonce_odr void @_ZN3fooC1IiEET_(ptr inreg noundef nonnull align 1 dereferenceable(1) %this, i32 inreg noundef %x)25 // CHECK-LABEL: define linkonce_odr void @_ZN3fooC2IiEET_(ptr inreg noundef nonnull align 1 dereferenceable(1) %this, i32 inreg noundef %x)26}27