diff options
author | Alex Brachet <alexbrachetmialot@gmail.com> | 2019-08-06 12:15:18 +0000 |
---|---|---|
committer | Alex Brachet <alexbrachetmialot@gmail.com> | 2019-08-06 12:15:18 +0000 |
commit | 3cfeaa4d2c17ff3f9285c475cd706167b0c172fe (patch) | |
tree | ea83d1e4854a89772c24d1e1e575b2b1eb1e7fc7 /llvm/test/tools | |
parent | 4e79097dc7c30ea8e1a7e96b740113e7cd9e635d (diff) | |
download | bcm5719-llvm-3cfeaa4d2c17ff3f9285c475cd706167b0c172fe.tar.gz bcm5719-llvm-3cfeaa4d2c17ff3f9285c475cd706167b0c172fe.zip |
[yaml2obj] Move core yaml2obj code into lib and include for use in unit tests
Reviewers: jhenderson, rupprecht, MaskRay, grimar, labath
Reviewed By: rupprecht
Subscribers: seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65255
llvm-svn: 368021
Diffstat (limited to 'llvm/test/tools')
-rw-r--r-- | llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml | 4 | ||||
-rw-r--r-- | llvm/test/tools/yaml2obj/invalid-docnum.test | 22 | ||||
-rw-r--r-- | llvm/test/tools/yaml2obj/missing_document_tag.yaml | 2 |
3 files changed, 25 insertions, 3 deletions
diff --git a/llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml b/llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml index 450f2f7f380..de79f4162e3 100644 --- a/llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml +++ b/llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml @@ -2,7 +2,7 @@ # RUN: echo -n "" | not yaml2obj 2>&1 | FileCheck %s # RUN: echo " " | not yaml2obj 2>&1 | FileCheck %s # RUN: echo " " | not yaml2obj 2>&1 | FileCheck %s -# CHECK: yaml2obj: Unknown document type! +# CHECK: yaml2obj: error: Unknown document type! # RUN: echo -e -n "\xff" | not yaml2obj 2>&1 | FileCheck %s --check-prefix=INVALID -# INVALID: yaml2obj: Failed to parse YAML file! +# INVALID: yaml2obj: error: Failed to parse YAML input! diff --git a/llvm/test/tools/yaml2obj/invalid-docnum.test b/llvm/test/tools/yaml2obj/invalid-docnum.test new file mode 100644 index 00000000000..0f796024c62 --- /dev/null +++ b/llvm/test/tools/yaml2obj/invalid-docnum.test @@ -0,0 +1,22 @@ +## Test that an error is reported when a docnum is specified, which is +## greater than the number of YAML inputs in the file. + +# RUN: not yaml2obj %s --docnum=3 2>&1 | FileCheck %s +# CHECK: yaml2obj: error: Cannot find the 3rd document + +# RUN: not yaml2obj %s --docnum=76768677 2>&1 | FileCheck %s --check-prefix=TWO +# TWO: yaml2obj: error: Cannot find the 76768677th document + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 diff --git a/llvm/test/tools/yaml2obj/missing_document_tag.yaml b/llvm/test/tools/yaml2obj/missing_document_tag.yaml index 8cfd9a16700..d41e7991bb8 100644 --- a/llvm/test/tools/yaml2obj/missing_document_tag.yaml +++ b/llvm/test/tools/yaml2obj/missing_document_tag.yaml @@ -6,4 +6,4 @@ DummyData: ... # CHECK: YAML:4:1: error: YAML Object File missing document type tag! -# CHECK: yaml2obj: Failed to parse YAML file! +# CHECK: yaml2obj: error: Failed to parse YAML input! |