47 lines · plain
1## Show that llvm-strings prints only strings with length of at least the2## requested number of bytes.3 4RUN: echo a > %t5RUN: echo ab >> %t6RUN: echo abc >> %t7RUN: echo abcd >> %t8RUN: echo abcde >> %t9RUN: not llvm-strings -n 0 2>&1 %t | FileCheck --check-prefix CHECK-0 %s10RUN: 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-empty15 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: error: expected a positive integer, but got '0'27 28CHECK-1: a29CHECK-1-NEXT: ab30CHECK-1-NEXT: abc31CHECK-1-NEXT: abcd32CHECK-1-NEXT: abcde33 34CHECK-2: ab35CHECK-2-NEXT: abc36CHECK-2-NEXT: abcd37CHECK-2-NEXT: abcde38 39CHECK-4: abcd40CHECK-4-NEXT: abcde41 42CHECK-5: abcde43 44## Show that a non-numeric argument is rejected.45RUN: not llvm-strings -n foo %t 2>&1 | FileCheck %s --check-prefix=ERR46ERR: error: expected a positive integer, but got 'foo'47