forked from OSchip/llvm-project
[Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).
The command `od -t x` is used to dump data in hex format. The LIT tests assumes that the hex characters are in lowercase. However, there are also platforms which use uppercase letter. To solve this issue the tests are updated to use the new `--ignore-case` option of FileCheck. Reviewers: Bigcheese, jakehehrlich, rupprecht, espindola, alexshap, jhenderson Differential Revision: https://reviews.llvm.org/D68693 llvm-svn: 374343
This commit is contained in:
parent
5070322332
commit
819f01d917
|
@ -1,6 +1,6 @@
|
|||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy -O binary %t %t2
|
||||
# RUN: od -t x2 -v %t2 | FileCheck %s
|
||||
# RUN: od -t x2 -v %t2 | FileCheck %s --ignore-case
|
||||
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
|
||||
|
||||
!ELF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy -O binary %t %t2
|
||||
# RUN: od -t x2 -v %t2 | FileCheck %s
|
||||
# RUN: od -t x2 -v %t2 | FileCheck %s --ignore-case
|
||||
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
|
||||
|
||||
!ELF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy -O binary %t %t2
|
||||
# RUN: od -t x2 %t2 | FileCheck %s
|
||||
# RUN: od -t x2 %t2 | FileCheck %s --ignore-case
|
||||
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
|
||||
|
||||
!ELF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy -O binary %t %t2
|
||||
# RUN: od -t x2 %t2 | FileCheck %s
|
||||
# RUN: od -t x2 %t2 | FileCheck %s --ignore-case
|
||||
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
|
||||
|
||||
!ELF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# RUN: yaml2obj %s -o %t
|
||||
# RUN: llvm-objcopy -O binary %t %t2
|
||||
# RUN: od -t x1 %t2 | FileCheck %s
|
||||
# RUN: od -t x1 %t2 | FileCheck %s --ignore-case
|
||||
|
||||
!ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
# RUN: llvm-objcopy --dump-section .text=%t4 %t %t5
|
||||
# RUN: llvm-objcopy --dump-section .foo=%t6 %t %t7
|
||||
# RUN: not llvm-objcopy --dump-section .bar=%t8 %t %t9 2>&1 | FileCheck %s --check-prefix=NOBITS -DINPUT=%t
|
||||
# RUN: od -t x1 %t2 | FileCheck %s
|
||||
# RUN: od -t x1 %t6 | FileCheck %s --check-prefix=NON-ALLOC
|
||||
# RUN: od -t x1 %t2 | FileCheck %s --ignore-case
|
||||
# RUN: od -t x1 %t6 | FileCheck %s --ignore-case --check-prefix=NON-ALLOC
|
||||
# RUN: wc -c %t2 | FileCheck %s --check-prefix=SIZE
|
||||
# RUN: diff %t2 %t3
|
||||
# RUN: diff %t4 %t3
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
# RUN: llvm-objcopy %t.base %t.stripped --regex -R blob.*
|
||||
# Show that the removal leaves the bytes as zeroes, as desired, for all our
|
||||
# test cases.
|
||||
# RUN: od -t x1 -j 0x2000 -N 24 %t.stripped | FileCheck %s --check-prefix=CHECK1 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2100 -N 12 %t.stripped | FileCheck %s --check-prefix=CHECK2 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2200 -N 4 %t.stripped | FileCheck %s --check-prefix=CHECK3 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2300 -N 12 %t.stripped | FileCheck %s --check-prefix=CHECK4 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x3000 -N 68 %t.stripped | FileCheck %s --check-prefix=CHECK5 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x4000 -N 60 %t.stripped | FileCheck %s --check-prefix=CHECK6 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x5000 -N 60 %t.stripped | FileCheck %s --check-prefix=CHECK7 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2000 -N 24 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK1 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2100 -N 12 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK2 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2200 -N 4 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK3 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x2300 -N 12 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK4 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x3000 -N 68 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK5 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x4000 -N 60 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK6 -DPATTERN="00 00 00 00"
|
||||
# RUN: od -t x1 -j 0x5000 -N 60 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK7 -DPATTERN="00 00 00 00"
|
||||
|
||||
# RUN: cp %t.stripped %t.in
|
||||
# RUN: echo "with open('%/t.in', 'rb+') as input:" > %t.py
|
||||
|
@ -32,13 +32,13 @@
|
|||
# RUN: echo " input.write(bytearray.fromhex('DEADBEEF'))" >> %t.py
|
||||
# RUN: %python %t.py
|
||||
# RUN: llvm-objcopy %t.in %t.out
|
||||
# RUN: od -t x1 -j 0x2000 -N 24 %t.out | FileCheck %s --check-prefix=CHECK1 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2100 -N 12 %t.out | FileCheck %s --check-prefix=CHECK2 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2200 -N 4 %t.out | FileCheck %s --check-prefix=CHECK3 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2300 -N 12 %t.out | FileCheck %s --check-prefix=CHECK4 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x3000 -N 68 %t.out | FileCheck %s --check-prefix=CHECK5 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x4000 -N 60 %t.out | FileCheck %s --check-prefix=CHECK6 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x5000 -N 60 %t.out | FileCheck %s --check-prefix=CHECK7 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2000 -N 24 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK1 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2100 -N 12 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK2 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2200 -N 4 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK3 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x2300 -N 12 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK4 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x3000 -N 68 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK5 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x4000 -N 60 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK6 -DPATTERN="de ad be ef"
|
||||
# RUN: od -t x1 -j 0x5000 -N 60 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK7 -DPATTERN="de ad be ef"
|
||||
|
||||
# CHECK1: [[PATTERN]] 11 22 33 44 [[PATTERN]] [[PATTERN]]
|
||||
# CHECK1-NEXT: 55 66 77 88 [[PATTERN]]
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
# Show that the debug section in a segment was removed, to match GNU.
|
||||
# First validate that the offset in use is correct.
|
||||
# RUN: llvm-objcopy %t %t4
|
||||
# RUN: od -t x1 -N 4 -j 120 %t4 | FileCheck %s --check-prefix=COPY-BYTES
|
||||
# RUN: od -t x1 -N 4 -j 120 %t2 | FileCheck %s --check-prefix=STRIP-BYTES
|
||||
# RUN: od -t x1 -N 4 -j 120 %t4 | FileCheck %s --ignore-case --check-prefix=COPY-BYTES
|
||||
# RUN: od -t x1 -N 4 -j 120 %t2 | FileCheck %s --ignore-case --check-prefix=STRIP-BYTES
|
||||
|
||||
!ELF
|
||||
FileHeader:
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# RUN: yaml2obj %s > %t
|
||||
# RUN: llvm-objcopy --strip-sections %t %t2
|
||||
# RUN: llvm-readobj --file-headers --program-headers %t2 | FileCheck %s
|
||||
# RUN: od -t x1 -j 4096 -N 12 %t2 | FileCheck %s --check-prefix=DATA
|
||||
# RUN: od -t x1 -j 4096 -N 12 %t2 | FileCheck %s --ignore-case --check-prefix=DATA
|
||||
|
||||
## Sanity check the DATA-NOT line by showing that "fe ed fa ce" appears
|
||||
## if --strip-sections is not specified.
|
||||
# RUN: llvm-objcopy %t %t3
|
||||
# RUN: od -t x1 -j 4096 -N 12 %t3 | FileCheck %s --check-prefix=VALIDATE
|
||||
# RUN: od -t x1 -j 4096 -N 12 %t3 | FileCheck %s --ignore-case --check-prefix=VALIDATE
|
||||
|
||||
## Check that llvm-strip --strip-sections is equivalent to
|
||||
## llvm-objcopy --strip-sections.
|
||||
|
|
|
@ -75,7 +75,7 @@ Sections:
|
|||
# RUN: yaml2obj --docnum=3 %s -o %t3
|
||||
# RUN: od -t x1 -v %t2 > %t.txt
|
||||
# RUN: od -t x1 -v %t3 >> %t.txt
|
||||
# RUN: FileCheck %s --input-file=%t.txt --check-prefix=CASE2
|
||||
# RUN: FileCheck %s --input-file=%t.txt --ignore-case --check-prefix=CASE2
|
||||
|
||||
# CASE2: [[OFFSET:.*]] fe fe fe fe fe fe fe fe
|
||||
# CASE2: [[FILESIZE:.*]]{{$}}
|
||||
|
|
|
@ -74,7 +74,7 @@ Sections:
|
|||
# RUN: yaml2obj --docnum=3 %s -o %t3
|
||||
# RUN: od -t x1 -v %t2 > %t.txt
|
||||
# RUN: od -t x1 -v %t3 >> %t.txt
|
||||
# RUN: FileCheck %s --input-file=%t.txt --check-prefix=CASE2
|
||||
# RUN: FileCheck %s --input-file=%t.txt --ignore-case --check-prefix=CASE2
|
||||
|
||||
# CASE2: [[OFFSET:.*]] fe fe fe fe fe fe fe fe
|
||||
# CASE2: [[FILESIZE:.*]]{{$}}
|
||||
|
@ -136,7 +136,7 @@ Sections:
|
|||
## bytes written is equal to Size in this case.
|
||||
|
||||
# RUN: yaml2obj --docnum=5 %s -o %t5
|
||||
# RUN: od -t x1 -v %t5 | FileCheck %s --check-prefix=CASE5
|
||||
# RUN: od -t x1 -v %t5 | FileCheck %s --ignore-case --check-prefix=CASE5
|
||||
|
||||
# CASE5: aa aa 00 00 bb bb
|
||||
|
||||
|
|
Loading…
Reference in New Issue