30 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %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 -fprebuilt-module-path=%t -emit-module-interface -o %t/B.pcm7// RUN: %clang_cc1 -fsyntax-only -std=c++20 -fprebuilt-module-path=%t -verify %t/C.cpp8 9//--- foo.h10struct Bar {};11extern "C" void foo(struct Bar);12 13//--- A.cppm14module;15#include "foo.h"16export module A;17export extern "C" using ::foo;18//--- B.cppm19module;20import A;21export module B;22 23//--- C.cpp24// expected-no-diagnostics25import B;26#include "foo.h"27void test() {28 foo(Bar());29}30