blob: a69014c6ae7d103424c539cccf8ed2e0d135c7d5 [file] [log] [blame]
Ben Langmuirbeee15e2014-04-14 18:00:01 +00001// RUN: rm -rf %t
2
3// Build PCH using A from path 1
4// 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
5
6// Use the PCH with the same header search options; should be fine
7// 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
8
9// Use the PCH with no way to resolve DependsOnA
10// 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
11// CHECK-NODOA: module 'DependsOnA' imported by AST file '{{.*A.pch}}' not found
12
13// Use the PCH with no way to resolve A
14// 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
15// CHECK-NOA: module 'A' imported by AST file '{{.*DependsOnA.*pcm}}' not found
16
17// Use the PCH and have it resolve the the other A
18// 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
19// CHECK-WRONGA: module 'A' imported by AST file '{{.*DependsOnA.*pcm}}' found in a different module map file ({{.*path2.*}}) than when the importing AST file was built ({{.*path1.*}})
20
21#ifndef HEADER
22#define HEADER
23@import DependsOnA;
24#endif