diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-06 02:06:40 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-06 02:06:40 +0000 |
| commit | 29883866a40279a1e8328b06f0b443493d06a95b (patch) | |
| tree | ca47cff3aeb7b42ef03e9ca07652a752771a089b /llvm/test | |
| parent | 2e5973ef74efb0c74815c4f5129cadcac2905b97 (diff) | |
| download | bcm5719-llvm-29883866a40279a1e8328b06f0b443493d06a95b.tar.gz bcm5719-llvm-29883866a40279a1e8328b06f0b443493d06a95b.zip | |
AsmParser: Don't crash on unresolved !tbaa
Instead of crashing, give a nice error. As a drive-by, fix the location
associated with the errors for unresolved metadata (the location was off
by one token).
llvm-svn: 265507
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Assembler/invalid-mdnode-badref.ll | 2 | ||||
| -rw-r--r-- | llvm/test/Assembler/missing-tbaa.ll | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/llvm/test/Assembler/invalid-mdnode-badref.ll b/llvm/test/Assembler/invalid-mdnode-badref.ll index cfa03e0b3c6..5c28ef05493 100644 --- a/llvm/test/Assembler/invalid-mdnode-badref.ll +++ b/llvm/test/Assembler/invalid-mdnode-badref.ll @@ -1,5 +1,5 @@ ; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s !named = !{!0} -; CHECK: [[@LINE+1]]:14: error: use of undefined metadata '!1' +; CHECK: [[@LINE+1]]:13: error: use of undefined metadata '!1' !0 = !{!0, !1} diff --git a/llvm/test/Assembler/missing-tbaa.ll b/llvm/test/Assembler/missing-tbaa.ll new file mode 100644 index 00000000000..38fe754b603 --- /dev/null +++ b/llvm/test/Assembler/missing-tbaa.ll @@ -0,0 +1,11 @@ +; RUN: not llvm-as < %s 2>&1 | FileCheck %s +; Check that !tbaa upgrade doesn't crash on undefined metadata (it should give +; an error). + +define void @foo() { +entry: + store i8 undef, i8* undef, +; CHECK: :[[@LINE+1]]:10: error: use of undefined metadata '!1' + !tbaa !1 + unreachable +} |

