brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 7c5395e Raw
67 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module1.cppm -o %t/module1.pcm6// RUN: %clang_cc1 -std=c++20 -emit-module-interface -I%t %t/module2.cppm -o %t/module2.pcm7// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/merge.cpp -verify -fsyntax-only8 9// Test again with reduced BMI.10// RUN: rm -rf %t11// RUN: mkdir %t12// RUN: split-file %s %t13//14// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -I%t %t/module1.cppm -o %t/module1.pcm15// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -I%t %t/module2.cppm -o %t/module2.pcm16// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/merge.cpp -verify -fsyntax-only17 18 19//--- header.h20namespace NS {21template <int I>22class A {23};24 25template <template <int I_> class T>26class B {27};28}29 30//--- module1.h31namespace NS {32using C = B<A>;33}34struct D : NS::C {35    using Type = NS::C;36};37 38//--- module1.cppm39// inside NS, using C = B<A>40module;41#include "header.h"42#include "module1.h"43export module module1;44export using ::D;45 46//--- module2.h47namespace NS {48using C = B<NS::A>;49}50struct D : NS::C {51    using Type = NS::C;52};53 54//--- module2.cppm55// inside NS, using C = B<NS::A>56module;57#include "header.h"58#include "module2.h"59export module module2;60export using ::D;61 62//--- merge.cpp63// expected-no-diagnostics64import module1;65import module2;66D d;67