1// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O0 -o - %s | FileCheck %s 2 3// Friend functions defined in classes are emitted. 4// CHECK: define weak_odr dllexport void @"\01?friend1@@YAXXZ"() 5struct FuncFriend1 { 6 friend __declspec(dllexport) void friend1() {} 7}; 8 9// But function templates and functions defined in class templates are not 10// emitted. 11// CHECK-NOT: friend2 12// CHECK-NOT: friend3 13// CHECK-NOT: friend4 14struct FuncFriend2 { 15 template<typename> friend __declspec(dllexport) void friend2() {} 16}; 17template<typename> struct FuncFriend3 { 18 friend __declspec(dllexport) void friend3() {} 19 struct Inner { 20 friend __declspec(dllexport) void friend4() {} 21 }; 22}; 23