[llvm] r374547 - [Tests] Output of od can be lower or upper case (llvm-objcopy/yaml2obj).

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 05:50:57 PDT 2019


Author: redstar
Date: Fri Oct 11 05:50:57 2019
New Revision: 374547

URL: http://llvm.org/viewvc/llvm-project?rev=374547&view=rev
Log:
[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

Modified:
    llvm/trunk/test/tools/llvm-objcopy/ELF/basic-binary-copy.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/binary-no-paddr.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/binary-paddr.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/binary-segment-layout.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/dump-section.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-gnu.test
    llvm/trunk/test/tools/llvm-objcopy/ELF/strip-sections.test
    llvm/trunk/test/tools/yaml2obj/elf-override-shoffset.yaml
    llvm/trunk/test/tools/yaml2obj/elf-override-shsize.yaml

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/basic-binary-copy.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/basic-binary-copy.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/basic-binary-copy.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/basic-binary-copy.test Fri Oct 11 05:50:57 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-no-paddr.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-no-paddr.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-no-paddr.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-no-paddr.test Fri Oct 11 05:50:57 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-paddr.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-paddr.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-paddr.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-paddr.test Fri Oct 11 05:50:57 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/binary-segment-layout.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/binary-segment-layout.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/binary-segment-layout.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/binary-segment-layout.test Fri Oct 11 05:50:57 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/check-addr-offset-align-binary.test Fri Oct 11 05:50:57 2019
@@ -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:

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/dump-section.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/dump-section.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/dump-section.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/dump-section.test Fri Oct 11 05:50:57 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/preserve-segment-contents.test Fri Oct 11 05:50:57 2019
@@ -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]]

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-gnu.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-gnu.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-gnu.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-all-gnu.test Fri Oct 11 05:50:57 2019
@@ -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:

Modified: llvm/trunk/test/tools/llvm-objcopy/ELF/strip-sections.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objcopy/ELF/strip-sections.test?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objcopy/ELF/strip-sections.test (original)
+++ llvm/trunk/test/tools/llvm-objcopy/ELF/strip-sections.test Fri Oct 11 05:50:57 2019
@@ -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. 

Modified: llvm/trunk/test/tools/yaml2obj/elf-override-shoffset.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-override-shoffset.yaml?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-override-shoffset.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-override-shoffset.yaml Fri Oct 11 05:50:57 2019
@@ -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:.*]]{{$}}

Modified: llvm/trunk/test/tools/yaml2obj/elf-override-shsize.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-override-shsize.yaml?rev=374547&r1=374546&r2=374547&view=diff
==============================================================================
--- llvm/trunk/test/tools/yaml2obj/elf-override-shsize.yaml (original)
+++ llvm/trunk/test/tools/yaml2obj/elf-override-shsize.yaml Fri Oct 11 05:50:57 2019
@@ -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
 




More information about the llvm-commits mailing list