[PATCH] D159154: [IR] Make detailed structural hash test look at diffs

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 10:32:20 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd944cab731f1: [IR] Make detailed structural hash test look at diffs (authored by aidengrossman).

Changed prior to commit:
  https://reviews.llvm.org/D159154?vs=554548&id=554774#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159154/new/

https://reviews.llvm.org/D159154

Files:
  llvm/test/Analysis/StructuralHash/structural-hash-detailed.ll


Index: llvm/test/Analysis/StructuralHash/structural-hash-detailed.ll
===================================================================
--- llvm/test/Analysis/StructuralHash/structural-hash-detailed.ll
+++ llvm/test/Analysis/StructuralHash/structural-hash-detailed.ll
@@ -1,16 +1,19 @@
-; Require 64 bits here as the hash will change depending upon whether we are on a 32-bit
-; or 64-bit platform.
-; REQUIRE: llvm-64-bits
+; 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 2>&1 | FileCheck %s
+; 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
 }
 
-; These values here are explicitly defined to ensure that they are deterministic
-; on all 64-bit platforms and across runs.
-
-; CHECK: Module Hash: 81f1328ced269bd
-; CHECK: Function f1 Hash: 81f1328ced269bd
+; CHECK: Module Hash: {{([a-z0-9]{14,})}}
+; CHECK: Function f1 Hash: {{([a-z0-9]{14,})}}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159154.554774.patch
Type: text/x-patch
Size: 1326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230830/099269af/attachment.bin>


More information about the llvm-commits mailing list