Skip to content

Commit 42b7cd5

Browse files
committedOct 11, 2019
[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: 374547
1 parent cb5324c commit 42b7cd5

11 files changed

+28
-28
lines changed
 

‎llvm/test/tools/llvm-objcopy/ELF/basic-binary-copy.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy -O binary %t %t2
3-
# RUN: od -t x2 -v %t2 | FileCheck %s
3+
# RUN: od -t x2 -v %t2 | FileCheck %s --ignore-case
44
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
55

66
!ELF

‎llvm/test/tools/llvm-objcopy/ELF/binary-no-paddr.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy -O binary %t %t2
3-
# RUN: od -t x2 -v %t2 | FileCheck %s
3+
# RUN: od -t x2 -v %t2 | FileCheck %s --ignore-case
44
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
55

66
!ELF

‎llvm/test/tools/llvm-objcopy/ELF/binary-paddr.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy -O binary %t %t2
3-
# RUN: od -t x2 %t2 | FileCheck %s
3+
# RUN: od -t x2 %t2 | FileCheck %s --ignore-case
44
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
55

66
!ELF

‎llvm/test/tools/llvm-objcopy/ELF/binary-segment-layout.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy -O binary %t %t2
3-
# RUN: od -t x2 %t2 | FileCheck %s
3+
# RUN: od -t x2 %t2 | FileCheck %s --ignore-case
44
# RUN: wc -c < %t2 | FileCheck %s --check-prefix=SIZE
55

66
!ELF

‎llvm/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RUN: yaml2obj %s -o %t
22
# RUN: llvm-objcopy -O binary %t %t2
3-
# RUN: od -t x1 %t2 | FileCheck %s
3+
# RUN: od -t x1 %t2 | FileCheck %s --ignore-case
44

55
!ELF
66
FileHeader:

‎llvm/test/tools/llvm-objcopy/ELF/dump-section.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# RUN: llvm-objcopy --dump-section .text=%t4 %t %t5
55
# RUN: llvm-objcopy --dump-section .foo=%t6 %t %t7
66
# RUN: not llvm-objcopy --dump-section .bar=%t8 %t %t9 2>&1 | FileCheck %s --check-prefix=NOBITS -DINPUT=%t
7-
# RUN: od -t x1 %t2 | FileCheck %s
8-
# RUN: od -t x1 %t6 | FileCheck %s --check-prefix=NON-ALLOC
7+
# RUN: od -t x1 %t2 | FileCheck %s --ignore-case
8+
# RUN: od -t x1 %t6 | FileCheck %s --ignore-case --check-prefix=NON-ALLOC
99
# RUN: wc -c %t2 | FileCheck %s --check-prefix=SIZE
1010
# RUN: diff %t2 %t3
1111
# RUN: diff %t4 %t3

‎llvm/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
# RUN: llvm-objcopy %t.base %t.stripped --regex -R blob.*
1414
# Show that the removal leaves the bytes as zeroes, as desired, for all our
1515
# test cases.
16-
# RUN: od -t x1 -j 0x2000 -N 24 %t.stripped | FileCheck %s --check-prefix=CHECK1 -DPATTERN="00 00 00 00"
17-
# RUN: od -t x1 -j 0x2100 -N 12 %t.stripped | FileCheck %s --check-prefix=CHECK2 -DPATTERN="00 00 00 00"
18-
# RUN: od -t x1 -j 0x2200 -N 4 %t.stripped | FileCheck %s --check-prefix=CHECK3 -DPATTERN="00 00 00 00"
19-
# RUN: od -t x1 -j 0x2300 -N 12 %t.stripped | FileCheck %s --check-prefix=CHECK4 -DPATTERN="00 00 00 00"
20-
# RUN: od -t x1 -j 0x3000 -N 68 %t.stripped | FileCheck %s --check-prefix=CHECK5 -DPATTERN="00 00 00 00"
21-
# RUN: od -t x1 -j 0x4000 -N 60 %t.stripped | FileCheck %s --check-prefix=CHECK6 -DPATTERN="00 00 00 00"
22-
# RUN: od -t x1 -j 0x5000 -N 60 %t.stripped | FileCheck %s --check-prefix=CHECK7 -DPATTERN="00 00 00 00"
16+
# RUN: od -t x1 -j 0x2000 -N 24 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK1 -DPATTERN="00 00 00 00"
17+
# RUN: od -t x1 -j 0x2100 -N 12 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK2 -DPATTERN="00 00 00 00"
18+
# RUN: od -t x1 -j 0x2200 -N 4 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK3 -DPATTERN="00 00 00 00"
19+
# RUN: od -t x1 -j 0x2300 -N 12 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK4 -DPATTERN="00 00 00 00"
20+
# RUN: od -t x1 -j 0x3000 -N 68 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK5 -DPATTERN="00 00 00 00"
21+
# RUN: od -t x1 -j 0x4000 -N 60 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK6 -DPATTERN="00 00 00 00"
22+
# RUN: od -t x1 -j 0x5000 -N 60 %t.stripped | FileCheck %s --ignore-case --check-prefix=CHECK7 -DPATTERN="00 00 00 00"
2323

2424
# RUN: cp %t.stripped %t.in
2525
# RUN: echo "with open('%/t.in', 'rb+') as input:" > %t.py
@@ -32,13 +32,13 @@
3232
# RUN: echo " input.write(bytearray.fromhex('DEADBEEF'))" >> %t.py
3333
# RUN: %python %t.py
3434
# RUN: llvm-objcopy %t.in %t.out
35-
# RUN: od -t x1 -j 0x2000 -N 24 %t.out | FileCheck %s --check-prefix=CHECK1 -DPATTERN="de ad be ef"
36-
# RUN: od -t x1 -j 0x2100 -N 12 %t.out | FileCheck %s --check-prefix=CHECK2 -DPATTERN="de ad be ef"
37-
# RUN: od -t x1 -j 0x2200 -N 4 %t.out | FileCheck %s --check-prefix=CHECK3 -DPATTERN="de ad be ef"
38-
# RUN: od -t x1 -j 0x2300 -N 12 %t.out | FileCheck %s --check-prefix=CHECK4 -DPATTERN="de ad be ef"
39-
# RUN: od -t x1 -j 0x3000 -N 68 %t.out | FileCheck %s --check-prefix=CHECK5 -DPATTERN="de ad be ef"
40-
# RUN: od -t x1 -j 0x4000 -N 60 %t.out | FileCheck %s --check-prefix=CHECK6 -DPATTERN="de ad be ef"
41-
# RUN: od -t x1 -j 0x5000 -N 60 %t.out | FileCheck %s --check-prefix=CHECK7 -DPATTERN="de ad be ef"
35+
# RUN: od -t x1 -j 0x2000 -N 24 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK1 -DPATTERN="de ad be ef"
36+
# RUN: od -t x1 -j 0x2100 -N 12 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK2 -DPATTERN="de ad be ef"
37+
# RUN: od -t x1 -j 0x2200 -N 4 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK3 -DPATTERN="de ad be ef"
38+
# RUN: od -t x1 -j 0x2300 -N 12 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK4 -DPATTERN="de ad be ef"
39+
# RUN: od -t x1 -j 0x3000 -N 68 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK5 -DPATTERN="de ad be ef"
40+
# RUN: od -t x1 -j 0x4000 -N 60 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK6 -DPATTERN="de ad be ef"
41+
# RUN: od -t x1 -j 0x5000 -N 60 %t.out | FileCheck %s --ignore-case --check-prefix=CHECK7 -DPATTERN="de ad be ef"
4242

4343
# CHECK1: [[PATTERN]] 11 22 33 44 [[PATTERN]] [[PATTERN]]
4444
# CHECK1-NEXT: 55 66 77 88 [[PATTERN]]

‎llvm/test/tools/llvm-objcopy/ELF/strip-all-gnu.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# Show that the debug section in a segment was removed, to match GNU.
88
# First validate that the offset in use is correct.
99
# RUN: llvm-objcopy %t %t4
10-
# RUN: od -t x1 -N 4 -j 120 %t4 | FileCheck %s --check-prefix=COPY-BYTES
11-
# RUN: od -t x1 -N 4 -j 120 %t2 | FileCheck %s --check-prefix=STRIP-BYTES
10+
# RUN: od -t x1 -N 4 -j 120 %t4 | FileCheck %s --ignore-case --check-prefix=COPY-BYTES
11+
# RUN: od -t x1 -N 4 -j 120 %t2 | FileCheck %s --ignore-case --check-prefix=STRIP-BYTES
1212

1313
!ELF
1414
FileHeader:

‎llvm/test/tools/llvm-objcopy/ELF/strip-sections.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# RUN: yaml2obj %s > %t
22
# RUN: llvm-objcopy --strip-sections %t %t2
33
# RUN: llvm-readobj --file-headers --program-headers %t2 | FileCheck %s
4-
# RUN: od -t x1 -j 4096 -N 12 %t2 | FileCheck %s --check-prefix=DATA
4+
# RUN: od -t x1 -j 4096 -N 12 %t2 | FileCheck %s --ignore-case --check-prefix=DATA
55

66
## Sanity check the DATA-NOT line by showing that "fe ed fa ce" appears
77
## if --strip-sections is not specified.
88
# RUN: llvm-objcopy %t %t3
9-
# RUN: od -t x1 -j 4096 -N 12 %t3 | FileCheck %s --check-prefix=VALIDATE
9+
# RUN: od -t x1 -j 4096 -N 12 %t3 | FileCheck %s --ignore-case --check-prefix=VALIDATE
1010

1111
## Check that llvm-strip --strip-sections is equivalent to
1212
## llvm-objcopy --strip-sections.

‎llvm/test/tools/yaml2obj/elf-override-shoffset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Sections:
7575
# RUN: yaml2obj --docnum=3 %s -o %t3
7676
# RUN: od -t x1 -v %t2 > %t.txt
7777
# RUN: od -t x1 -v %t3 >> %t.txt
78-
# RUN: FileCheck %s --input-file=%t.txt --check-prefix=CASE2
78+
# RUN: FileCheck %s --input-file=%t.txt --ignore-case --check-prefix=CASE2
7979

8080
# CASE2: [[OFFSET:.*]] fe fe fe fe fe fe fe fe
8181
# CASE2: [[FILESIZE:.*]]{{$}}

‎llvm/test/tools/yaml2obj/elf-override-shsize.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Sections:
7474
# RUN: yaml2obj --docnum=3 %s -o %t3
7575
# RUN: od -t x1 -v %t2 > %t.txt
7676
# RUN: od -t x1 -v %t3 >> %t.txt
77-
# RUN: FileCheck %s --input-file=%t.txt --check-prefix=CASE2
77+
# RUN: FileCheck %s --input-file=%t.txt --ignore-case --check-prefix=CASE2
7878

7979
# CASE2: [[OFFSET:.*]] fe fe fe fe fe fe fe fe
8080
# CASE2: [[FILESIZE:.*]]{{$}}
@@ -136,7 +136,7 @@ Sections:
136136
## bytes written is equal to Size in this case.
137137

138138
# RUN: yaml2obj --docnum=5 %s -o %t5
139-
# RUN: od -t x1 -v %t5 | FileCheck %s --check-prefix=CASE5
139+
# RUN: od -t x1 -v %t5 | FileCheck %s --ignore-case --check-prefix=CASE5
140140

141141
# CASE5: aa aa 00 00 bb bb
142142

0 commit comments

Comments
 (0)
Please sign in to comment.