Bruno Cardoso Lopes | 29729919 | 2017-12-22 02:53:30 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // Build PCH using A, with adjacent private module APrivate, which winds up being implicitly referenced |
| 3 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -emit-pch -o %t-A.pch %s -Wprivate-module -DNO_AT_IMPORT |
| 4 | // Use the PCH with no explicit way to resolve APrivate, still pick it up by automatic second-chance search for "A" with "Private" appended |
| 5 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -include-pch %t-A.pch %s -fsyntax-only -Wprivate-module -DNO_AT_IMPORT |
| 6 | |
| 7 | // RUN: rm -rf %t |
| 8 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -emit-pch -o %t-A.pch %s -Wprivate-module -DUSE_AT_IMPORT_PRIV |
| 9 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -include-pch %t-A.pch %s -fsyntax-only -Wprivate-module -DUSE_AT_IMPORT_PRIV |
| 10 | |
| 11 | // RUN: rm -rf %t |
| 12 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -emit-pch -o %t-A.pch %s -Wprivate-module -DUSE_AT_IMPORT_BOTH |
| 13 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-canonical -include-pch %t-A.pch %s -fsyntax-only -Wprivate-module -DUSE_AT_IMPORT_BOTH |
| 14 | |
| 15 | // expected-no-diagnostics |
| 16 | |
| 17 | #ifndef HEADER |
| 18 | #define HEADER |
| 19 | |
| 20 | #ifdef NO_AT_IMPORT |
| 21 | #import "A/aprivate.h" |
| 22 | #endif |
| 23 | |
| 24 | #ifdef USE_AT_IMPORT_PRIV |
| 25 | @import A_Private; |
| 26 | #endif |
| 27 | |
| 28 | #ifdef USE_AT_IMPORT_BOTH |
| 29 | @import A; |
| 30 | @import A_Private; |
| 31 | #endif |
| 32 | |
| 33 | const int *y = &APRIVATE; |
| 34 | |
| 35 | #endif |