1 // RUN: rm -rf %t
2 // RUN: mkdir %t
3 // RUN: cd %t
4 
5 // ----------------------
6 // Build modules A and B.
7 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
8 // RUN:            -fmodule-name=a -emit-module %S/Inputs/explicit-build/module.modulemap -o a.pcm
9 //
10 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
11 // RUN:            -fmodule-file=a.pcm \
12 // RUN:            -fmodule-name=b -emit-module %S/Inputs/explicit-build/module.modulemap -o b-rel.pcm
13 //
14 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
15 // RUN:            -fmodule-file=%t/a.pcm \
16 // RUN:            -fmodule-name=b -emit-module %S/Inputs/explicit-build/module.modulemap -o b-abs.pcm
17 
18 // ------------------------------------------
19 // Mix and match relative and absolute paths.
20 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
21 // RUN:            -I%S/Inputs/explicit-build \
22 // RUN:            -fmodule-file=%t/a.pcm \
23 // RUN:            -fmodule-file=a.pcm \
24 // RUN:            -verify %s
25 //
26 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
27 // RUN:            -I%S/Inputs/explicit-build \
28 // RUN:            -fmodule-file=%t/a.pcm \
29 // RUN:            -fmodule-file=b-rel.pcm \
30 // RUN:            -verify %s
31 //
32 // RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
33 // RUN:            -I%S/Inputs/explicit-build \
34 // RUN:            -fmodule-file=a.pcm \
35 // RUN:            -fmodule-file=b-abs.pcm \
36 // RUN:            -verify %s
37 //
38 // RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
39 // RUN:            -I%S/Inputs/explicit-build \
40 // RUN:            -fmodule-file=b-rel.pcm \
41 // RUN:            -fmodule-file=b-abs.pcm \
42 // RUN:            -verify %s 2>&1 | FileCheck %s
43 // CHECK: module 'b' is defined in both '{{.*}}b-rel.pcm' and '{{.*}}b-abs.pcm'
44 
45 #include "a.h"
46 static_assert(a == 1, "");
47 // expected-no-diagnostics
48