diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/Modules/fatal-module-loader-error.m | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Modules/fatal-module-loader-error.m')
-rw-r--r-- | test/Modules/fatal-module-loader-error.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Modules/fatal-module-loader-error.m b/test/Modules/fatal-module-loader-error.m new file mode 100644 index 0000000..6af3b4c --- /dev/null +++ b/test/Modules/fatal-module-loader-error.m @@ -0,0 +1,26 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: touch %t/Module.pcm +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -verify +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t %s -fdisable-module-hash -F %S/Inputs -DIMPLICIT -verify + +// This tests that after a fatal module loader error, we do not continue parsing. + +#ifdef IMPLICIT + +// expected-error@+1{{does not appear to be}} +#import <Module/Module.h> +#pragma clang __debug crash; + +#else + +// expected-error@+1{{does not appear to be}} +@import Module; +#pragma clang __debug crash; + +#endif + +// Also check that libclang does not create a PCH with such an error. +// RUN: not c-index-test -write-pch %t.pch -fmodules -fmodules-cache-path=%t \ +// RUN: %s -Xclang -fdisable-module-hash -F %S/Inputs 2>&1 | FileCheck %s +// CHECK: Unable to write PCH file |