summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorMarek Sokolowski <mnbvmar@gmail.com>2017-08-28 21:59:54 +0000
committerMarek Sokolowski <mnbvmar@gmail.com>2017-08-28 21:59:54 +0000
commit72aa937ed8cf9a0478bc9908f80ce51e372e8ef4 (patch)
treec8a04b1e0bc5cb1987b0bfcd87a09ab6e502b04d /llvm/test/tools
parentcbf969eb20c9191cafe8c18cbd7cc13da84cffba (diff)
downloadbcm5719-llvm-72aa937ed8cf9a0478bc9908f80ce51e372e8ef4.tar.gz
bcm5719-llvm-72aa937ed8cf9a0478bc9908f80ce51e372e8ef4.zip
[llvm-rc] Add ICON and HTML parsing ability (parser, pt 2/8).
This extends the current llvm-rc parser by ICON and HTML resources. Moreover, some tests have been slightly rewritten. Thanks for Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D36891 llvm-svn: 311939
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-rc/Inputs/parser-correct-everything.rc3
-rw-r--r--llvm/test/tools/llvm-rc/Inputs/parser-html-bad-string.rc1
-rw-r--r--llvm/test/tools/llvm-rc/Inputs/parser-html-extra-comma.rc1
-rw-r--r--llvm/test/tools/llvm-rc/parser.test39
4 files changed, 26 insertions, 18 deletions
diff --git a/llvm/test/tools/llvm-rc/Inputs/parser-correct-everything.rc b/llvm/test/tools/llvm-rc/Inputs/parser-correct-everything.rc
index 6337a369fe6..37fc1cfe22c 100644
--- a/llvm/test/tools/llvm-rc/Inputs/parser-correct-everything.rc
+++ b/llvm/test/tools/llvm-rc/Inputs/parser-correct-everything.rc
@@ -13,3 +13,6 @@ VERSION 14
2 "world"
}
STRINGTABLE BEGIN END
+
+500 HTML "index.html"
+Name Cursor "hello.ico"
diff --git a/llvm/test/tools/llvm-rc/Inputs/parser-html-bad-string.rc b/llvm/test/tools/llvm-rc/Inputs/parser-html-bad-string.rc
new file mode 100644
index 00000000000..5edab852ce3
--- /dev/null
+++ b/llvm/test/tools/llvm-rc/Inputs/parser-html-bad-string.rc
@@ -0,0 +1 @@
+200 HTML ThisPassesInTheOriginalToolButDocSaysItShouldBeQuoted
diff --git a/llvm/test/tools/llvm-rc/Inputs/parser-html-extra-comma.rc b/llvm/test/tools/llvm-rc/Inputs/parser-html-extra-comma.rc
new file mode 100644
index 00000000000..e80c52c2f65
--- /dev/null
+++ b/llvm/test/tools/llvm-rc/Inputs/parser-html-extra-comma.rc
@@ -0,0 +1 @@
+1 HTML, "index.html"
diff --git a/llvm/test/tools/llvm-rc/parser.test b/llvm/test/tools/llvm-rc/parser.test
index 40b66da88fb..9b990a3c543 100644
--- a/llvm/test/tools/llvm-rc/parser.test
+++ b/llvm/test/tools/llvm-rc/parser.test
@@ -11,57 +11,60 @@
; PGOOD-NEXT: 1 => "hello"
; PGOOD-NEXT: 2 => "world"
; PGOOD-NEXT: StringTable:
+; PGOOD-NEXT: HTML (500): "index.html"
+; PGOOD-NEXT: Cursor (Name): "hello.ico"
-; RUN: not llvm-rc /V %p/Inputs/parser-stringtable-no-string.rc 2> %t2
-; RUN: FileCheck %s --check-prefix PSTRINGTABLE1 --input-file %t2
+; RUN: not llvm-rc /V %p/Inputs/parser-stringtable-no-string.rc 2>&1 | FileCheck %s --check-prefix PSTRINGTABLE1
; PSTRINGTABLE1: llvm-rc: Error parsing file: expected string, got }
-; RUN: not llvm-rc /V %p/Inputs/parser-stringtable-weird-option.rc 2> %t3
-; RUN: FileCheck %s --check-prefix PSTRINGTABLE2 --input-file %t3
+; RUN: not llvm-rc /V %p/Inputs/parser-stringtable-weird-option.rc 2>&1 | FileCheck %s --check-prefix PSTRINGTABLE2
; PSTRINGTABLE2: llvm-rc: Error parsing file: expected optional statement type, BEGIN or '{', got NONSENSETYPE
-; RUN: not llvm-rc /V %p/Inputs/parser-eof.rc 2> %t4
-; RUN: FileCheck %s --check-prefix PEOF --input-file %t4
+; RUN: not llvm-rc /V %p/Inputs/parser-eof.rc 2>&1 | FileCheck %s --check-prefix PEOF
; PEOF: llvm-rc: Error parsing file: expected integer, got <EOF>
-; RUN: not llvm-rc /V %p/Inputs/parser-no-characteristics-arg.rc 2> %t5
-; RUN: FileCheck %s --check-prefix PCHARACTERISTICS1 --input-file %t5
+; RUN: not llvm-rc /V %p/Inputs/parser-no-characteristics-arg.rc 2>&1 | FileCheck %s --check-prefix PCHARACTERISTICS1
; PCHARACTERISTICS1: llvm-rc: Error parsing file: expected integer, got BEGIN
-; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-token.rc 2> %t6
-; RUN: FileCheck %s --check-prefix PNONSENSE1 --input-file %t6
+; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-token.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE1
; PNONSENSE1: llvm-rc: Error parsing file: expected int or identifier, got &
-; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-type.rc 2> %t7
-; RUN: FileCheck %s --check-prefix PNONSENSE2 --input-file %t7
+; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-type.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE2
; PNONSENSE2: llvm-rc: Error parsing file: expected resource type, got WORLD
-; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-type-eof.rc 2> %t8
-; RUN: FileCheck %s --check-prefix PNONSENSE3 --input-file %t8
+; RUN: not llvm-rc /V %p/Inputs/parser-nonsense-type-eof.rc 2>&1 | FileCheck %s --check-prefix PNONSENSE3
; PNONSENSE3: llvm-rc: Error parsing file: expected int or identifier, got <EOF>
-; RUN: not llvm-rc /V %p/Inputs/parser-language-no-comma.rc 2> %t9
-; RUN: FileCheck %s --check-prefix PLANGUAGE1 --input-file %t9
+; RUN: not llvm-rc /V %p/Inputs/parser-language-no-comma.rc 2>&1 | FileCheck %s --check-prefix PLANGUAGE1
; PLANGUAGE1: llvm-rc: Error parsing file: expected ',', got 7
-; RUN: not llvm-rc /V %p/Inputs/parser-language-too-many-commas.rc 2> %t10
-; RUN: FileCheck %s --check-prefix PLANGUAGE2 --input-file %t10
+; RUN: not llvm-rc /V %p/Inputs/parser-language-too-many-commas.rc 2>&1 | FileCheck %s --check-prefix PLANGUAGE2
; PLANGUAGE2: llvm-rc: Error parsing file: expected integer, got ,
+
+
+; RUN: not llvm-rc /V %p/Inputs/parser-html-bad-string.rc 2>&1 | FileCheck %s --check-prefix PHTML1
+
+; PHTML1: llvm-rc: Error parsing file: expected string, got ThisPassesInTheOriginalToolButDocSaysItShouldBeQuoted
+
+
+; RUN: not llvm-rc /V %p/Inputs/parser-html-extra-comma.rc 2>&1 | FileCheck %s --check-prefix PHTML2
+
+; PHTML2: llvm-rc: Error parsing file: expected string, got ,
OpenPOWER on IntegriCloud