diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-28 17:26:03 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-05-28 17:26:03 +0000 |
| commit | bcc47419d9a88e6b58a9e2a7c0ee4c7bf43e91b4 (patch) | |
| tree | 9882cd837b184dd2c913b6080591860958f7dd5d /llvm/test | |
| parent | 9c3eb5960ad8c225cf577c38423f435f6a7184e3 (diff) | |
| download | bcm5719-llvm-bcc47419d9a88e6b58a9e2a7c0ee4c7bf43e91b4.tar.gz bcm5719-llvm-bcc47419d9a88e6b58a9e2a7c0ee4c7bf43e91b4.zip | |
ValueMapper: fix assertion when null-mapping a constant for linking metadata
Summary:
When RF_NullMapMissingGlobalValues is set, mapValue can return null
for GlobalValue. When mapping the operands of a constant that is
referenced from metadata, we need to handle this case and actually
return null instead of mapping this constant.
Reviewers: dexonsmith, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D20713
llvm-svn: 271129
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Linker/null_mapping_constant.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Linker/null_mapping_constant.ll b/llvm/test/Linker/null_mapping_constant.ll new file mode 100644 index 00000000000..a7e7770dd27 --- /dev/null +++ b/llvm/test/Linker/null_mapping_constant.ll @@ -0,0 +1,11 @@ +; RUN: llvm-link %s -S -o - | FileCheck %s +; Check that the constant is not linked and the metadata is correctly referencing a nullptr +; CHECK: !0 = !{!"foo", null, i64 16} + + + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.12.0" +@foo = external unnamed_addr constant { [4 x i8*], [32 x i8] }, align 32 +!llvm.bitsets = !{!0} +!0 = !{!"foo", [4 x i8*]* getelementptr inbounds ({ [4 x i8*], [32 x i8] }, { [4 x i8*], [32 x i8] }* @foo, i32 0, i32 0), i64 16} |

