diff options
| author | Alex Brachet <alexbrachetmialot@gmail.com> | 2019-08-07 02:44:49 +0000 |
|---|---|---|
| committer | Alex Brachet <alexbrachetmialot@gmail.com> | 2019-08-07 02:44:49 +0000 |
| commit | c22d9666fc3e132de3ed121eaf42c3e7e00c7440 (patch) | |
| tree | cc49de623eca66937ec84e6f43edb64f3081514d /llvm/test/tools | |
| parent | 6cebeafac31ceb500494bb301e365363c3d5992a (diff) | |
| download | bcm5719-llvm-c22d9666fc3e132de3ed121eaf42c3e7e00c7440.tar.gz bcm5719-llvm-c22d9666fc3e132de3ed121eaf42c3e7e00c7440.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: gribozavr, mgrang, seiya, mgorny, sbc100, hiraditya, aheejin, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65255
llvm-svn: 368119
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 | ||||
| -rw-r--r-- | llvm/test/tools/yaml2obj/multi-doc.test | 2 | ||||
| -rw-r--r-- | llvm/test/tools/yaml2obj/section-size-content.yaml | 2 |
5 files changed, 27 insertions, 5 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! diff --git a/llvm/test/tools/yaml2obj/multi-doc.test b/llvm/test/tools/yaml2obj/multi-doc.test index 30e7c1e430d..9d3762b0291 100644 --- a/llvm/test/tools/yaml2obj/multi-doc.test +++ b/llvm/test/tools/yaml2obj/multi-doc.test @@ -16,7 +16,7 @@ # DOC2: Name: _sym2 # DOC3: Name: _sym3 # DOC4: Name: _sym4 -# DOC5: yaml2obj: Cannot find the 5th document +# DOC5: yaml2obj: error: Cannot find the 5th document --- !ELF FileHeader: !FileHeader diff --git a/llvm/test/tools/yaml2obj/section-size-content.yaml b/llvm/test/tools/yaml2obj/section-size-content.yaml index 1c9c00d2e50..b57526abe71 100644 --- a/llvm/test/tools/yaml2obj/section-size-content.yaml +++ b/llvm/test/tools/yaml2obj/section-size-content.yaml @@ -175,4 +175,4 @@ Sections: # ERR2: error: Section size must be greater than or equal to the content size # ERR2-NEXT: - Name: .data # ERR2-NEXT: ^ -# ERR2-NEXT: yaml2obj: Failed to parse YAML file! +# ERR2-NEXT: yaml2obj: error: Failed to parse YAML input! |

