51 lines · plain
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: cd %t4//5// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm6// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -emit-module-interface -o %t/b.pcm7// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm -fsyntax-only -verify8 9// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm10// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -emit-reduced-module-interface -o %t/b.pcm -DREDUCED11// RUN: %clang_cc1 -std=c++20 %t/c.cppm -fmodule-file=a=%t/a.pcm -fmodule-file=b=%t/b.pcm -fsyntax-only -verify12 13//--- a.cppm14export module a;15 16export template<typename T>17void a(T x) {18 +x;19}20 21//--- b.h22struct s {23};24void operator+(s) {25}26 27//--- b.cppm28module;29#include "b.h"30export module b;31import a;32 33export template<typename T>34void b() {35 a(s());36}37 38#ifdef REDUCED39// Mention it to avoid the compiler optimizing it out.40using ::operator+;41#endif42 43//--- c.cppm44// expected-no-diagnostics45export module c;46import b;47 48void c() {49 b<int>();50}51