69 lines · plain
1// From https://github.com/llvm/llvm-project/issues/610652// RUN: rm -rf %t3// RUN: mkdir -p %t4// RUN: split-file %s %t5//6// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm7// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \8// RUN: -fprebuilt-module-path=%t9// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \10// RUN: -fprebuilt-module-path=%t11// RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t12 13// Test again with reduced BMI14// RUN: rm -rf %t15// RUN: mkdir -p %t16// RUN: split-file %s %t17//18// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm19// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm \20// RUN: -fprebuilt-module-path=%t21// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -o %t/c.pcm \22// RUN: -fprebuilt-module-path=%t23// RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t24 25 26//--- a.cppm27export module a;28 29struct base {30 base(int) {}31};32 33export struct a : base {34 using base::base;35};36 37//--- b.cppm38export module b;39 40import a;41 42a b() {43 return a(1);44}45 46//--- c.cppm47export module c;48 49import a;50import b;51 52struct noncopyable {53 noncopyable(noncopyable const &) = delete;54 noncopyable() = default;55};56 57export struct c {58 noncopyable c0;59 a c1 = 43;60 c() = default;61};62 63//--- d.cpp64// expected-no-diagnostics65import c;66void d() {67 c _;68}69