2014-04-15 02:00:01 +08:00
|
|
|
// RUN: rm -rf %t
|
|
|
|
|
|
|
|
// Build PCH using A from path 1
|
|
|
|
// RUN: %clang_cc1 -fmodules -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
|
|
|
|
|
|
|
|
// Use the PCH with the same header search options; should be fine
|
|
|
|
// RUN: %clang_cc1 -fmodules -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
|
|
|
|
|
2014-04-30 00:25:26 +08:00
|
|
|
// Different -W options are ok
|
|
|
|
// RUN: %clang_cc1 -fmodules -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
|
|
|
|
|
2014-04-15 02:00:01 +08:00
|
|
|
// Use the PCH with no way to resolve DependsOnA
|
|
|
|
// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-NODOA %s
|
2014-10-22 10:05:46 +08:00
|
|
|
// CHECK-NODOA: module 'DependsOnA' in AST file '{{.*DependsOnA.*pcm}}' (imported by AST file '{{.*A.pch}}') is not defined in any loaded module map
|
2014-04-15 02:00:01 +08:00
|
|
|
|
|
|
|
// Use the PCH with no way to resolve A
|
|
|
|
// RUN: not %clang_cc1 -fmodules -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
|
2014-10-22 10:05:46 +08:00
|
|
|
// CHECK-NOA: module 'A' in AST file '{{.*A.*pcm}}' (imported by AST file '{{.*DependsOnA.*pcm}}') is not defined in any loaded module map
|
2014-04-15 02:00:01 +08:00
|
|
|
|
2014-12-06 11:21:08 +08:00
|
|
|
// Use the PCH and have it resolve to the other A
|
2014-04-15 02:00:01 +08:00
|
|
|
// RUN: not %clang_cc1 -fmodules -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
|
2014-12-06 11:21:08 +08:00
|
|
|
// 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}}'
|
2014-04-15 02:00:01 +08:00
|
|
|
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
@import DependsOnA;
|
|
|
|
#endif
|