-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not constant fold mux before it has been typechecked (#3633)
Signed-off-by: Mihai Budiu <[email protected]>
- Loading branch information
Mihai Budiu
authored
Oct 28, 2022
1 parent
01fedcc
commit 4a74084
Showing
4 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
action a(){} | ||
action b(){} | ||
action NoAction(){} | ||
control c() { | ||
table t { | ||
actions = { a ; b; } | ||
} | ||
apply { | ||
switch(t.apply().action_run) { | ||
true ? a : b : {} | ||
} | ||
} | ||
} | ||
|
||
control C(); | ||
package top(C c); | ||
|
||
top(c()) main; |
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,24 @@ | ||
action a() { | ||
} | ||
action b() { | ||
} | ||
action NoAction() { | ||
} | ||
control c() { | ||
table t { | ||
actions = { | ||
a; | ||
b; | ||
} | ||
} | ||
apply { | ||
switch (t.apply().action_run) { | ||
(true ? a : b): { | ||
} | ||
} | ||
} | ||
} | ||
|
||
control C(); | ||
package top(C c); | ||
top(c()) main; |
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,3 @@ | ||
issue3622.p4(10): [--Werror=type-error] error: ?:: 'switch' label must be an action name or 'default' | ||
true ? a : b : {} | ||
^^^^^^^^^^^^ |