OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Checks that a given assembyl file is decoded identically to objdump. | 6 # Checks that a given assembyl file is decoded identically to objdump. |
7 # | 7 # |
8 # Usage: | 8 # Usage: |
9 # decoder_test_one_file.sh GAS=... OBJDUMP=... DECODER=... ASMFILE=... | 9 # decoder_test_one_file.sh GAS=... OBJDUMP=... DECODER=... ASMFILE=... |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 # Produce an object file, disassemble it in 2 ways and compare results. | 28 # Produce an object file, disassemble it in 2 ways and compare results. |
29 $GAS "$ASMFILE" -o "$ASMFILE.o" | 29 $GAS "$ASMFILE" -o "$ASMFILE.o" |
30 rm -f "$ASMFILE" | 30 rm -f "$ASMFILE" |
31 $DECODER "$ASMFILE.o" > "$ASMFILE.decoder" | 31 $DECODER "$ASMFILE.o" > "$ASMFILE.decoder" |
32 # Take objdump output starting at line 8 to skip the unimportant header that | 32 # Take objdump output starting at line 8 to skip the unimportant header that |
33 # is not emulated in the decoder test. | 33 # is not emulated in the decoder test. |
34 $OBJDUMP -d "$ASMFILE.o" | | 34 $OBJDUMP -d "$ASMFILE.o" | |
35 tail -n+8 - | | 35 tail -n+8 - | |
36 cmp - "$ASMFILE.decoder" | 36 cmp - "$ASMFILE.decoder" |
37 rm -f "$ASMFILE.o" "$ASMFILE.decoder" | 37 rm -f "$ASMFILE.o" "$ASMFILE.decoder" |
OLD | NEW |