Skip to content

Commit

Permalink
add test for back with distance zero
Browse files Browse the repository at this point in the history
  • Loading branch information
mars-risc0 committed Jan 13, 2025
1 parent deedcc1 commit 33dc293
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion zirgen/compiler/picus/picus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ class PicusPrinter {
}

void visitOp(zirgen::Zhlt::BackOp back) {
auto callee = back.getCallee();
size_t distance = back.getDistance().getZExtValue();
AnySignal signal = signalize(freshName(), back.getType());
if (distance > 0) {
Expand Down
19 changes: 19 additions & 0 deletions zirgen/compiler/picus/test/back-zero.zir
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// RUN: zirgen %s --emit=picus | FileCheck %s

// CHECK: (prime-number 2013265921)
// CHECK: (begin-module Count)
// CHECK: (input x0)
// CHECK-NEXT: (output layout_a__super__super)
// CHECK-NEXT: (output result_a__super__super)
// CHECK-NEXT: (output result_a_reg__super)
// CHECK-NEXT: (call [{{.*}}] Reg [{{.*}}])
// CHECK-NEXT: (assert (= result_a__super__super x2__super__super))
// CHECK-NEXT: (assert (= result_a_reg__super x2_reg__super))
// CHECK-NEXT: (end-module)

#[picus]
component Count(first: Val) {
public a : Reg;
a := Reg(a@0);
}

0 comments on commit 33dc293

Please sign in to comment.