aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Modules/duplicated-module-file-eq-module-name.cppm
blob: 57ffb560ab540a86d21ab7f759797762b45f26f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Tests that we will pick the last `-fmodule-file=<module-name>=<path>` flag
// for <module-name>.

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: cd %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
// RUN:      -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
// RUN:      -fmodule-file=a=%t/a.pcm -verify -fsyntax-only

//--- a.cppm
export module a;
export int a();

//--- u.cpp
// expected-no-diagnostics
import a;
int u() {
    return a();
}