1## Show that llvm-strings prints only strings with length of at least the
2## requested number of bytes.
3
4RUN: echo a > %t
5RUN: echo ab >> %t
6RUN: echo abc >> %t
7RUN: echo abcd >> %t
8RUN: echo abcde >> %t
9RUN: not llvm-strings -n 0 2>&1 %t | FileCheck --check-prefix CHECK-0 %s
10RUN: llvm-strings -n 1 %t | FileCheck --check-prefix CHECK-1 %s --implicit-check-not={{.}}
11RUN: llvm-strings -n 2 %t | FileCheck --check-prefix CHECK-2 %s --implicit-check-not={{.}}
12RUN: llvm-strings -n 4 %t | FileCheck --check-prefix CHECK-4 %s --implicit-check-not={{.}}
13RUN: llvm-strings -n 5 %t | FileCheck --check-prefix CHECK-5 %s --implicit-check-not={{.}}
14RUN: llvm-strings -n 6 %t | FileCheck %s --implicit-check-not={{.}} --allow-empty
15
16## Default is equivalent to -n 4.
17RUN: llvm-strings %t | FileCheck --check-prefix CHECK-4 %s --implicit-check-not={{.}}
18
19## Show --bytes works too.
20RUN: llvm-strings --bytes 2 %t | FileCheck --check-prefix CHECK-2 %s --implicit-check-not={{.}}
21
22## Show different syntaxes work.
23RUN: llvm-strings --bytes=2 %t | FileCheck --check-prefix CHECK-2 %s --implicit-check-not={{.}}
24RUN: llvm-strings -n=2 %t | FileCheck --check-prefix CHECK-2 %s --implicit-check-not={{.}}
25
26CHECK-0: invalid minimum string length 0
27
28CHECK-1:      a
29CHECK-1-NEXT: ab
30CHECK-1-NEXT: abc
31CHECK-1-NEXT: abcd
32CHECK-1-NEXT: abcde
33
34CHECK-2:      ab
35CHECK-2-NEXT: abc
36CHECK-2-NEXT: abcd
37CHECK-2-NEXT: abcde
38
39CHECK-4:      abcd
40CHECK-4-NEXT: abcde
41
42CHECK-5:      abcde
43
44## Show that a non-numeric argument is rejected.
45RUN: not llvm-strings -n foo %t 2>&1 | FileCheck %s --check-prefix=ERR
46ERR: llvm-strings{{.*}}: for the --bytes option: 'foo' value invalid for integer argument!
47