IR: Add missing tests for function-local metadata
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 7 Dec 2014 17:56:16 +0000 (17:56 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 7 Dec 2014 17:56:16 +0000 (17:56 +0000)
commit545a9b0f51d105041b472f8649a8179550576c72
tree571cfd5a6080e245379ddeef481e2d3927653456
parentfa58e5e111d97c63886df3ca1d5a0af3f221e45e
IR: Add missing tests for function-local metadata

Add assembly and bitcode tests that I neglected to add in r223564 (IR:
Disallow complicated function-local metadata) and r223574 (IR: Disallow
function-local metadata attachments).

Found a couple of bugs:

  - The error message for function-local attachments gave the wrong line
    number -- it indicated the next token (typically on the next line)
    instead of the token that started the attachment.  Fixed.

  - Metadata arguments of the form `!{i32 0, i32 %v}` (or with the
    arguments reversed) fired an assertion in `ValueEnumerator` in LLVM
    v3.5, so I suppose this never really worked.  I suppose this was
    "fixed" by r223564.

(Thanks to dblaikie for pointing out my omission.)

Part of PR21532.

llvm-svn: 223616
llvm/lib/AsmParser/LLParser.cpp
llvm/test/Assembler/functionlocal-metadata-attachments.ll [new file with mode: 0644]
llvm/test/Assembler/functionlocal-metadata-complex-1.ll [new file with mode: 0644]
llvm/test/Assembler/functionlocal-metadata-complex-2.ll [new file with mode: 0644]
llvm/test/Assembler/functionlocal-metadata-complex-3.ll [new file with mode: 0644]
llvm/test/Bitcode/function-local-metadata.ll [new file with mode: 0644]
llvm/test/Bitcode/function-local-metadata.ll.bc [new file with mode: 0644]