Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | |
| 3 | // Build PCH using A from path 1 |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path1/A -emit-pch -o %t-A.pch %s |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 5 | |
| 6 | // Use the PCH with the same header search options; should be fine |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 7 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path1/A -include-pch %t-A.pch %s -fsyntax-only -Werror |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 8 | |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 9 | // Different -W options are ok |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 10 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path1/A -include-pch %t-A.pch %s -fsyntax-only -Werror -Wauto-import |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 11 | |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 12 | // Use the PCH with no way to resolve DependsOnA |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 13 | // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-NODOA %s |
Richard Smith | e842a47 | 2014-10-22 02:05:46 +0000 | [diff] [blame] | 14 | // CHECK-NODOA: module 'DependsOnA' in AST file '{{.*DependsOnA.*pcm}}' (imported by AST file '{{.*A.pch}}') is not defined in any loaded module map |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 15 | |
| 16 | // Use the PCH with no way to resolve A |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 17 | // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-NOA %s |
Richard Smith | e842a47 | 2014-10-22 02:05:46 +0000 | [diff] [blame] | 18 | // CHECK-NOA: module 'A' in AST file '{{.*A.*pcm}}' (imported by AST file '{{.*DependsOnA.*pcm}}') is not defined in any loaded module map |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 19 | |
Richard Smith | 223d3f2 | 2014-12-06 03:21:08 +0000 | [diff] [blame] | 20 | // Use the PCH and have it resolve to the other A |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 21 | // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path2/A -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-WRONGA %s |
Richard Smith | 223d3f2 | 2014-12-06 03:21:08 +0000 | [diff] [blame] | 22 | // CHECK-WRONGA: module 'A' was built in directory '{{.*Inputs.modules-with-same-name.path1.A}}' but now resides in directory '{{.*Inputs.modules-with-same-name.path2.A}}' |
Ben Langmuir | beee15e | 2014-04-14 18:00:01 +0000 | [diff] [blame] | 23 | |
| 24 | #ifndef HEADER |
| 25 | #define HEADER |
| 26 | @import DependsOnA; |
| 27 | #endif |