Ben Langmuir | d066d4c | 2014-02-28 21:16:07 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Ben Langmuir | 801272a | 2014-02-25 18:23:47 +0000 | [diff] [blame] | 2 | // RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay.yaml > %t.yaml |
Richard Smith | 3d8fcea | 2015-06-16 00:19:29 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t.yaml -I %t -fsyntax-only %s |
Ben Langmuir | 801272a | 2014-02-25 18:23:47 +0000 | [diff] [blame] | 4 | // REQUIRES: shell |
| 5 | |
| 6 | @import not_real; |
| 7 | |
| 8 | void foo() { |
| 9 | bar(); |
| 10 | } |
Ben Langmuir | f9a6ac2 | 2014-04-04 16:42:53 +0000 | [diff] [blame] | 11 | |
| 12 | // Import a submodule that is defined in actual_module2.map, which is only |
| 13 | // mapped in vfsoverlay2.yaml. |
| 14 | #ifdef IMPORT2 |
| 15 | @import not_real.from_second_module; |
| 16 | // CHECK-VFS2: error: no submodule |
| 17 | #endif |
| 18 | |
| 19 | // Override the module map (vfsoverlay2 on top) |
| 20 | // RUN: sed -e "s:INPUT_DIR:%S/Inputs:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay2.yaml > %t2.yaml |
Richard Smith | 3d8fcea | 2015-06-16 00:19:29 +0000 | [diff] [blame] | 21 | // RUN: %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t.yaml -ivfsoverlay %t2.yaml -I %t -fsyntax-only %s |
Ben Langmuir | f9a6ac2 | 2014-04-04 16:42:53 +0000 | [diff] [blame] | 22 | |
| 23 | // vfsoverlay2 not present |
Richard Smith | 3d8fcea | 2015-06-16 00:19:29 +0000 | [diff] [blame] | 24 | // RUN: not %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t.yaml -I %t -fsyntax-only %s -DIMPORT2 2>&1 | FileCheck -check-prefix=CHECK-VFS2 %s |
Ben Langmuir | f9a6ac2 | 2014-04-04 16:42:53 +0000 | [diff] [blame] | 25 | |
| 26 | // vfsoverlay2 on the bottom |
Richard Smith | 3d8fcea | 2015-06-16 00:19:29 +0000 | [diff] [blame] | 27 | // RUN: not %clang_cc1 -Werror -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -ivfsoverlay %t2.yaml -ivfsoverlay %t.yaml -I %t -fsyntax-only %s -DIMPORT2 2>&1 | FileCheck -check-prefix=CHECK-VFS2 %s |