xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/2004-09-27-DidntEmitTemplate.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
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 
6 // CHECK-NOT: declare{{.*}}callDefaultCtor
7 struct Pass {};
8 
9 template<typename PassName>
callDefaultCtor()10 Pass *callDefaultCtor() { return new Pass(); }
11 
12 void foo(Pass *(*C)());
13 
14 struct basic_string {
emptybasic_string15   bool empty() const { return true; }
16 };
17 
18 
foo2(basic_string & X)19 bool foo2(basic_string &X) {
20   return X.empty();
21 }
baz()22 void baz() { foo(callDefaultCtor<Pass>); }
23