brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 6f363ed Raw
58 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-module-interface -o %t/Templ.pcm6// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/Use.pcm7// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cpp -verify -fsyntax-only8 9// RUN: %clang_cc1 -std=c++20 %t/Templ.cppm -emit-reduced-module-interface -o %t/Templ.pcm10// RUN: %clang_cc1 -std=c++20 %t/Use.cppm -fprebuilt-module-path=%t -emit-reduced-module-interface -o %t/Use.pcm11// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cpp -verify -fsyntax-only12//13//--- Templ.h14#ifndef TEMPL_H15#define TEMPL_H16template <class T>17class Wrapper {18public:19  T value;20};21#endif22 23//--- Templ.cppm24export module Templ;25export template <class T>26class Wrapper2 {27public:28  T value;29};30 31//--- Use.cppm32module;33#include "Templ.h"34export module Use;35import Templ;36 37export template <class T>38class Use {39public:40  Wrapper<T> value;41  Wrapper2<T> value2;42};43 44export template <class T>45Wrapper<T> wrapper;46 47//--- Use.cpp48// expected-no-diagnostics49module;50#include "Templ.h"51export module User;52 53export template <class T>54class User {55public:56  Wrapper<T> value;57};58