Richard Smith | 0f99d6a | 2015-08-09 08:48:41 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir %t |
| 3 | // RUN: echo 'extern int a;' > %t/a.h |
| 4 | // RUN: echo 'extern int b;' > %t/b.h |
| 5 | // RUN: echo 'module a { header "a.h" header "b.h" }' > %t/modulemap |
| 6 | |
| 7 | // We lazily check that the files referenced by an explicitly-specified .pcm |
| 8 | // file exist. Test this by removing files and ensuring that the compilation |
| 9 | // still succeeds. |
| 10 | // |
| 11 | // RUN: %clang_cc1 -fmodules -I %t -emit-module -fmodule-name=a -x c++ %t/modulemap -o %t/a.pcm |
| 12 | // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s |
| 13 | // RUN: rm %t/modulemap |
| 14 | // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s |
| 15 | // RUN: rm %t/b.h |
| 16 | // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s |
| 17 | // RUN: rm %t/a.h |
| 18 | // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -verify |
| 19 | |
| 20 | #include "a.h" // expected-error {{file not found}} |
| 21 | int x = b; |