llvm-project/llvm/test/Analysis/StructuralHash/structural-hash-detailed.ll
Aiden Grossman d944cab731 [IR] Make detailed structural hash test look at diffs
This patch makes structural-hash-detailed.ll look at diffs rather than
specific values to make the test more robust against the underlying
hashing implementation while still testing that the hash value is
deterministic across multiple runs.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D159154
2023-08-30 10:31:58 -07:00

20 lines
577 B
LLVM

; Ensure that the value of the structural hash is consistent across runs to
; check that we aren't doing something like hashing a pointer that could
; introduce non-determinism.
; RUN: opt -passes='print<structural-hash><detailed>' -disable-output %s &> %t.1
; RUN: opt -passes='print<structural-hash><detailed>' -disable-output %s &> %t.2
; RUN: diff %t.1 %t.2
; Check that we get valid output in the detailed case.
; cat %t.1 | FileCheck %s
define i64 @f1(i64 %a) {
ret i64 %a
}
; CHECK: Module Hash: {{([a-z0-9]{14,})}}
; CHECK: Function f1 Hash: {{([a-z0-9]{14,})}}