blob: 21f4ac854fafd8f2378236f659549986a370d758 [file] [log] [blame]
Chris Lattnerd6165972004-11-30 18:25:12 +00001// RUN: llvmgcc -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | not grep declare
2
3// This is a testcase for LLVM PR445, which was a problem where the
4// instantiation of callDefaultCtor was not being emitted correctly.
5
6struct Pass {};
7
8template<typename PassName>
9Pass *callDefaultCtor() { return new Pass(); }
10
11void foo(Pass *(*C)());
12
13struct basic_string {
14 bool empty() const { return true; }
15};
16
17
18bool foo2(basic_string &X) {
19 return X.empty();
20}
21void baz() { foo(callDefaultCtor<Pass>); }
22