blob: 57ffb560ab540a86d21ab7f759797762b45f26f3 [file] [log] [blame]
Chuanqi Xue9a78762023-10-27 16:32:09 +08001// 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
Chuanqi Xuda00c602024-03-08 10:12:51 +080011//
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
Chuanqi Xue9a78762023-10-27 16:32:09 +080015
16//--- a.cppm
17export module a;
18export int a();
19
20//--- u.cpp
21// expected-no-diagnostics
22import a;
23int u() {
24 return a();
25}