diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-02-07 21:54:57 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-02-07 21:54:57 +0000 |
commit | 93d08aa2190c39c455d39cd60f83bdd52bad71e1 (patch) | |
tree | f5518d356005da68e7a962566d3e3df629b43cd7 /test/Modules/invalid-pch-module-id.m | |
parent | d1f6c06e804d84732e0dec97c323d55c29c54491 (diff) |
[PCH] Fix a regression when PCH is used with -fmodules
Following up on r291465 after a regression in r276159. When we use
-fmodule-name=X while building a PCH, modular headers in X will be
textually included and the compiler knows that we are not building
module X, so don't serialize such headers in the PCH as being part of a
module, because at this point they are not.
This was causing subtle bugs and malformed AST crashes, for instance,
when using the PCH in subsequent compiler invocation with -fmodules, the
HFI for a modular header would map to the PCH, which would force a
module load of and unexistent module ID.
rdar://problem/30171164
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/invalid-pch-module-id.m')
-rw-r--r-- | test/Modules/invalid-pch-module-id.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Modules/invalid-pch-module-id.m b/test/Modules/invalid-pch-module-id.m new file mode 100644 index 0000000000..34d9995cef --- /dev/null +++ b/test/Modules/invalid-pch-module-id.m @@ -0,0 +1,13 @@ +// RUN: rm -rf %t.cache +// +// RUN: %clang_cc1 -x objective-c-header -fmodules -F%S/Inputs/invalid-module-id \ +// RUN: -fmodule-implementation-of NC -fmodules-cache-path=%t.cache \ +// RUN: -fimplicit-module-maps \ +// RUN: -emit-pch %S/Inputs/invalid-module-id/NC-Prefix.pch -o %t.pch +// +// RUN: %clang_cc1 -x objective-c -fmodules -F%S/Inputs/invalid-module-id \ +// RUN: -fmodule-implementation-of NC -fmodules-cache-path=%t.cache \ +// RUN: -fimplicit-module-maps -include-pch %t.pch %s -fsyntax-only + +#import <NC/NULog.h> +#import <NC/NUGeometry.h> |