File: radix.test

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (58 lines) | stat: -rw-r--r-- 2,085 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
## Show that llvm-strings can handle the -t/--radix switch properly.

RUN: echo one > %t
RUN: echo two >> %t
RUN: echo three >> %t
RUN: echo four >> %t
RUN: echo five >> %t
RUN: echo six >> %t
RUN: echo seven >> %t
RUN: echo eight >> %t
RUN: echo nine >> %t
RUN: echo ten >> %t

RUN: llvm-strings %t | FileCheck %s -check-prefix CHECK-NONE --implicit-check-not={{.}}
RUN: llvm-strings -t d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace --implicit-check-not={{.}}
RUN: llvm-strings -t o %t | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace --implicit-check-not={{.}}
RUN: llvm-strings -t x %t | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace --implicit-check-not={{.}}

## Show --radix works too.
RUN: llvm-strings --radix d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace
RUN: llvm-strings --radix o %t | FileCheck %s -check-prefix CHECK-OCT --strict-whitespace
RUN: llvm-strings --radix x %t | FileCheck %s -check-prefix CHECK-HEX --strict-whitespace

## Show different syntaxes work.
RUN: llvm-strings --radix=d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace
RUN: llvm-strings -t=d %t | FileCheck %s -check-prefix CHECK-DEC --strict-whitespace

CHECK-NONE: {{^}}three
CHECK-NONE: {{^}}four
CHECK-NONE: {{^}}five
CHECK-NONE: {{^}}seven
CHECK-NONE: {{^}}eight
CHECK-NONE: {{^}}nine

CHECK-DEC: {{^}}      8 three
CHECK-DEC: {{^}}     14 four
CHECK-DEC: {{^}}     19 five
CHECK-DEC: {{^}}     28 seven
CHECK-DEC: {{^}}     34 eight
CHECK-DEC: {{^}}     40 nine

CHECK-OCT: {{^}}     10 three
CHECK-OCT: {{^}}     16 four
CHECK-OCT: {{^}}     23 five
CHECK-OCT: {{^}}     34 seven
CHECK-OCT: {{^}}     42 eight
CHECK-OCT: {{^}}     50 nine

CHECK-HEX: {{^}}      8 three
CHECK-HEX: {{^}}      e four
CHECK-HEX: {{^}}     13 five
CHECK-HEX: {{^}}     1c seven
CHECK-HEX: {{^}}     22 eight
CHECK-HEX: {{^}}     28 nine

## Show that an invalid value is rejected.
RUN: not llvm-strings --radix z %t 2>&1 | FileCheck %s --check-prefix=INVALID
INVALID: llvm-strings{{.*}}: for the --radix option: Cannot find option named 'z'!