brintos

brintos / llvm-project-archived public Read only

0
0
Text · 796 B · 079d816 Raw
44 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 -fsyntax-only -verify7 8// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm -DREDUCED9// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify10 11//--- a.h12namespace n {13 14struct s { };15 16void operator+(s, int) {17}18 19} // namespace n20 21//--- a.cppm22module;23#include "a.h"24export module a;25 26export template<typename T>27void a(T x) {28	n::s() + x;29}30 31#ifdef REDUCED32// Use it to make sure it is not optimized out in reduced BMI.33using n::operator+;34#endif35 36//--- b.cppm37// expected-no-diagnostics38export module b;39import a;40 41void b() {42	a(0);43}44