Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / module / module.reach / p2.cpp
blob6ccf6ee6d0566d34167009e32e2f7fb4757638b6
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
4 // RUN: %clang_cc1 -std=c++20 %t/impl.cppm -emit-module-interface -o %t/M-impl.pcm
5 // RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-module-interface -fprebuilt-module-path=%t -o %t/M.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/UseStrict.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
8 //--- impl.cppm
9 module M:impl;
10 class A {};
12 //--- M.cppm
13 export module M;
14 import :impl;
15 export A f();
17 //--- UseStrict.cpp
18 import M;
19 void test() {
20 auto a = f(); // expected-error {{definition of 'A' must be imported from module 'M:impl' before it is required}} expected-error{{}}
21 // expected-note@* {{definition here is not reachable}} expected-note@* {{}}