62 lines · plain
1## Show that llvm-strings can handle the -t/--radix switch properly.2 3RUN: split-file --no-leading-lines %s %t4#--- a.txt5one6two7three8four9five10six11seven12eight13nine14ten15#--- end16 17RUN: llvm-strings %t/a.txt | FileCheck %s -check-prefix CHECK-NONE --implicit-check-not={{.}}18RUN: llvm-strings -t d %t/a.txt | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace --implicit-check-not={{.}}19RUN: llvm-strings -t o %t/a.txt | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace --implicit-check-not={{.}}20RUN: llvm-strings -t x %t/a.txt | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace --implicit-check-not={{.}}21 22## Show --radix works too.23RUN: llvm-strings --radix d %t/a.txt | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace24RUN: llvm-strings --radix o %t/a.txt | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace25RUN: llvm-strings --radix x %t/a.txt | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace26 27## Show different syntaxes work.28RUN: llvm-strings --radix=d %t/a.txt | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace29RUN: llvm-strings -t d %t/a.txt | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace30 31CHECK-NONE: {{^}}three32CHECK-NONE: {{^}}four33CHECK-NONE: {{^}}five34CHECK-NONE: {{^}}seven35CHECK-NONE: {{^}}eight36CHECK-NONE: {{^}}nine37 38CHECK-DEC: {{^}} 8 three39CHECK-DEC: {{^}} 14 four40CHECK-DEC: {{^}} 19 five41CHECK-DEC: {{^}} 28 seven42CHECK-DEC: {{^}} 34 eight43CHECK-DEC: {{^}} 40 nine44 45CHECK-OCT: {{^}} 10 three46CHECK-OCT: {{^}} 16 four47CHECK-OCT: {{^}} 23 five48CHECK-OCT: {{^}} 34 seven49CHECK-OCT: {{^}} 42 eight50CHECK-OCT: {{^}} 50 nine51 52CHECK-HEX: {{^}} 8 three53CHECK-HEX: {{^}} e four54CHECK-HEX: {{^}} 13 five55CHECK-HEX: {{^}} 1c seven56CHECK-HEX: {{^}} 22 eight57CHECK-HEX: {{^}} 28 nine58 59## Show that an invalid value is rejected.60RUN: not llvm-strings --radix z %t/a.txt 2>&1 | FileCheck %s --check-prefix=INVALID61INVALID: error: --radix value should be one of: '' (no offset), 'o' (octal), 'd' (decimal), 'x' (hexadecimal)62