-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
145296b
commit 2e1a38e
Showing
4 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// RUN: zirgen %s --emit=zhl 2>&1 | FileCheck %s | ||
// RUN: zirgen %s --test --test-cycles=4 2>&1 | FileCheck %s --check-prefix=EXEC | ||
|
||
// This test covers a bug where an `if` without an `else` resulted in a mux with | ||
// only one arm. This is incorrect, as these three expressions should all be | ||
// semantically equivalent: | ||
|
||
// if (x) {a} | ||
// if (x) {a} else {} | ||
// [x, 1-x] -> ({a}, {}) | ||
|
||
extern IsFirstCycle() : Val; | ||
|
||
component Top() { | ||
x := NondetReg(IsFirstCycle()); | ||
if (x) { | ||
Log("First cycle") | ||
} | ||
} | ||
|
||
// CHECK: %[[arr:[0-9]+]] = zhl.array[%{{[0-9]+}}, %{{[0-9]+}}] | ||
// CHECK: %{{[0-9]+}} = zhl.switch %[[arr]] -> { | ||
|
||
// EXEC: [0] Log: First cycle | ||
// EXEC-NOT: Log: First cycle | ||
|
||
test { | ||
Top() | ||
} |