Debian Codegraph @

clang/test/CXX/module/dcl.dcl/dcl.module/p1.cpp

raw
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3
4 // RUN: %clang_cc1 -std=c++20 -verify %t/A.cppm
5 // RUN: %clang_cc1 -std=c++20 -verify %t/B.cppm
6 // RUN: %clang_cc1 -std=c++20 %t/C.cppm -emit-module-interface -o %t/C.pcm
7 // RUN: %clang_cc1 -std=c++20 %t/D.cppm -fmodule-file=foo=%t/C.pcm
8 // RUN: %clang_cc1 -std=c++20 %t/E.cppm -fmodule-file=foo=%t/C.pcm
9 // RUN: %clang_cc1 -std=c++20 -verify %t/F.cppm -fmodule-file=foo=%t/C.pcm
10
11 //--- A.cppm
12 export module foo; // expected-note {{previous module declaration is here}}
13 export module bar; // expected-error {{translation unit contains multiple module declarations}}
14
15 //--- B.cppm
16 export module foo; // expected-note {{previous module declaration is here}}
17 module bar; // expected-error {{translation unit contains multiple module declarations}}
18
19 //--- C.cppm
20 export module foo;
21
22 //--- D.cppm
23 module foo;
24
25 //--- E.cppm
26 export module bar;
27
28 //--- F.cppm
29 module foo; // expected-note {{previous module declaration is here}}
30 export module bar; // expected-error {{translation unit contains multiple module declarations}}