Chuanqi Xu | e9a7876 | 2023-10-27 16:32:09 +0800 | [diff] [blame] | 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 |
Chuanqi Xu | da00c60 | 2024-03-08 10:12:51 +0800 | [diff] [blame] | 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 |
Chuanqi Xu | e9a7876 | 2023-10-27 16:32:09 +0800 | [diff] [blame] | 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 | } |