xref: /llvm-project/clang/test/CodeGenCXX/implicit-instantiation-1.cpp (revision c9bd88e6811fb622cde644a82eac41c0b02c00ee)
1*c9bd88e6SHans Wennborg // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o %t
277b50e11SDouglas Gregor 
377b50e11SDouglas Gregor template<typename T>
477b50e11SDouglas Gregor struct X {
fX577b50e11SDouglas Gregor   void f(T) { }
fX677b50e11SDouglas Gregor   void f(char) { }
777b50e11SDouglas Gregor 
gX877b50e11SDouglas Gregor   void g(T) { }
977b50e11SDouglas Gregor 
hX1077b50e11SDouglas Gregor   void h(T) { }
1177b50e11SDouglas Gregor };
1277b50e11SDouglas Gregor 
foo(X<int> & xi,X<float> * xfp,int i,float f)1377b50e11SDouglas Gregor void foo(X<int> &xi, X<float> *xfp, int i, float f) {
148b576979SDaniel Dunbar   // RUN: grep "linkonce_odr.*_ZN1XIiE1fEi" %t | count 1
1577b50e11SDouglas Gregor   xi.f(i);
1677b50e11SDouglas Gregor 
178b576979SDaniel Dunbar   // RUN: grep "linkonce_odr.*_ZN1XIiE1gEi" %t | count 1
1877b50e11SDouglas Gregor   xi.g(f);
1977b50e11SDouglas Gregor 
208b576979SDaniel Dunbar   // RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1
2177b50e11SDouglas Gregor   xfp->f(f);
2277b50e11SDouglas Gregor 
23be8a91b7SRafael Espindola   // RUN: not grep "linkonce_odr.*_ZN1XIfE1hEf" %t
2477b50e11SDouglas Gregor 
2577b50e11SDouglas Gregor }
2677b50e11SDouglas Gregor 
2777b50e11SDouglas Gregor 
2877b50e11SDouglas Gregor 
29