xref: /llvm-project/clang/test/Modules/pcm-with-errors.cpp (revision c1ecc0d168ad122d858dd5fec475da391f97e959)
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
4 
5 // RUN: %clang_cc1 -std=c++23 m.cppm -emit-module-interface -o m.pcm -fallow-pcm-with-compiler-errors -verify
6 // RUN: %clang_cc1 -std=c++23 main.cpp -fmodule-file=m=m.pcm -verify -fallow-pcm-with-compiler-errors -verify
7 
8 // RUN: %clang_cc1 -std=c++23 m.cppm -fmodules-reduced-bmi -emit-module-interface -o m.pcm -fallow-pcm-with-compiler-errors -verify
9 // RUN: %clang_cc1 -std=c++23 main.cpp -fmodule-file=m=m.pcm -verify -fallow-pcm-with-compiler-errors -verify
10 
11 //--- m.cppm
12 export module m;
13 
14 export int f() {
15   return 0;
16 }
17 
18 export struct Foo {
19   __Int bar; // expected-error {{unknown type name '__Int'}}
20 };
21 
22 //--- main.cpp
23 // expected-no-diagnostics
24 import m; // ok
25 
26 static_assert(__is_same(decltype(f), int())); // ok
27