Reid Spencer | 358f327 | 2007-04-15 20:41:31 +0000 | [diff] [blame] | 1 | // RUN: %llvmgxx -xc++ %s -c -o - | llvm-dis | grep callDefaultCtor | \ |
| 2 | // RUN: not grep declare |
Chris Lattner | d616597 | 2004-11-30 18:25:12 +0000 | [diff] [blame] | 3 | |
| 4 | // This is a testcase for LLVM PR445, which was a problem where the |
| 5 | // instantiation of callDefaultCtor was not being emitted correctly. |
| 6 | |
| 7 | struct Pass {}; |
| 8 | |
| 9 | template<typename PassName> |
| 10 | Pass *callDefaultCtor() { return new Pass(); } |
| 11 | |
| 12 | void foo(Pass *(*C)()); |
| 13 | |
| 14 | struct basic_string { |
| 15 | bool empty() const { return true; } |
| 16 | }; |
| 17 | |
| 18 | |
| 19 | bool foo2(basic_string &X) { |
| 20 | return X.empty(); |
| 21 | } |
| 22 | void baz() { foo(callDefaultCtor<Pass>); } |
| 23 | |