1 // RUN: split-file %s %t
3 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-name=A -emit-module %t/a.modulemap -o %t/a.pcm
4 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-name=B -emit-module %t/b.modulemap -o %t/b.pcm
5 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-map-file=%t/a.modulemap -fmodule-map-file=%t/b.modulemap \
6 // RUN: -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm \
7 // RUN: %t/use.cc -verify
11 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-name=A -emit-module %t/a.modulemap -o %t/a.pcm -triple i686-windows
12 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-name=B -emit-module %t/b.modulemap -o %t/b.pcm -triple i686-windows
13 // RUN: %clang_cc1 -std=c++14 -x c++ -fmodules -fmodule-map-file=%t/a.modulemap -fmodule-map-file=%t/b.modulemap \
14 // RUN: -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm \
15 // RUN: %t/use.cc -verify -triple i686-windows
25 template<typename T
> struct ct
{ friend auto operator-(ct
, ct
) { struct X
{}; return X(); } void x(); };
36 template<typename T
> struct ct
{ friend auto operator-(ct
, ct
) { struct X
{}; return X(); } void x(); };
37 inline auto f() { return ct
<float>() - ct
<float>(); }
41 // expected-no-diagnostics
42 // Force the definition of ct in module A to be the primary definition.
44 template<typename T
> void ct
<T
>::x() {}
46 // Attempt to cause the definition of operator- in the ct primary template in
47 // module B to be the primary definition of that function. If that happens,
48 // we'll be left with a class template ct that appears to not contain a
49 // definition of the inline friend function.