| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 |
|
| 18 | . "$(dirname "$0")/../lib.sh"
|
| 19 |
|
| 20 | setup
|
| 21 | build_pair basic.c
|
| 22 |
|
| 23 | before="$(md5sum < "$workdir/orig.o")"
|
| 24 |
|
| 25 | "$OBJTOOL" klp checksum --dry-run --debug-checksum=changed \
|
| 26 | "$workdir/orig.o" > "$workdir/debug.log" 2>&1 ||
|
| 27 | fail "klp checksum --debug-checksum failed"
|
| 28 |
|
| 29 | |
| 30 | |
| 31 | [ "$(md5sum < "$workdir/orig.o")" = "$before" ] ||
|
| 32 | fail "--dry-run modified the object"
|
| 33 | has_input_section orig.o .discard.sym_checksum &&
|
| 34 | fail "--dry-run created .discard.sym_checksum"
|
| 35 |
|
| 36 | grep -qE '^DEBUG: .*: checksum: changed\(\): [^ ]+\+0x[0-9a-f]+ [0-9a-f]{16}$' \
|
| 37 | "$workdir/debug.log" ||
|
| 38 | fail "unexpected --debug-checksum format: $(head -1 "$workdir/debug.log")"
|
| 39 |
|
| 40 | |
| 41 | grep -qE "^DEBUG: .*checksum: changed\(\): " "$workdir/debug.log" ||
|
| 42 | fail "klp-build's --show-first-changed pattern no longer matches"
|
| 43 |
|
| 44 | |
| 45 | |
| 46 | grep -qE 'checksum: untouched\(\)' "$workdir/debug.log" &&
|
| 47 | fail "--debug-checksum=changed also dumped untouched()"
|
| 48 |
|
| 49 | pass "--debug-checksum format is the one klp-build -f parses"
|