Debian Codegraph @

clang/test/Modules/duplicated-module-file-eq-module-name.cppm

raw
1 // Tests that we will pick the last `-fmodule-file=<module-name>=<path>` flag
2 // for <module-name>.
3
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: cd %t
7 //
8 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
9 // RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
10 // RUN: -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
11 //
12 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
13 // RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
14 // RUN: -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
15
16 //--- a.cppm
17 export module a;
18 export int a();
19
20 //--- u.cpp
21 // expected-no-diagnostics
22 import a;
23 int u() {
24 return a();
25 }