blob: 6e6131e00010159b301923e0bf14afbf41fac8a2 [file] [log] [blame]
Argyrios Kyrtzidisdc9fdaf2013-05-24 05:44:08 +00001// RUN: rm -rf %t
2// RUN: mkdir %t
3// RUN: touch %t/Module.pcm
Richard Smith47972af2015-06-16 00:08:24 +00004// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -verify
5// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -DIMPLICIT -verify
Argyrios Kyrtzidisdc9fdaf2013-05-24 05:44:08 +00006
7// This tests that after a fatal module loader error, we do not continue parsing.
8
9#ifdef IMPLICIT
10
Richard Smith0f99d6a2015-08-09 08:48:41 +000011// expected-error@+1{{Module.pcm' is not a valid precompiled module file}}
Argyrios Kyrtzidisdc9fdaf2013-05-24 05:44:08 +000012#import <Module/Module.h>
13#pragma clang __debug crash;
14
15#else
16
Richard Smith0f99d6a2015-08-09 08:48:41 +000017// expected-error@+1{{Module.pcm' is not a valid precompiled module file}}
Argyrios Kyrtzidisdc9fdaf2013-05-24 05:44:08 +000018@import Module;
19#pragma clang __debug crash;
20
21#endif
22
23// Also check that libclang does not create a PCH with such an error.
Richard Smith47972af2015-06-16 00:08:24 +000024// RUN: not c-index-test -write-pch %t.pch -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
Rafael Espindola925213b2013-07-04 16:16:58 +000025// RUN: %s -Xclang -fdisable-module-hash -F %S/Inputs 2>&1 | FileCheck %s
Dmitri Gribenkoea4d1c32014-02-12 19:12:37 +000026// CHECK: {{^}}Failure: AST deserialization error occurred{{$}}