summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/yaml2obj/empty-or-invalid-doc.yaml4
-rw-r--r--llvm/test/tools/yaml2obj/invalid-docnum.test22
-rw-r--r--llvm/test/tools/yaml2obj/missing_document_tag.yaml2
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!
OpenPOWER on IntegriCloud