Open
Description
Building the following P4 program with p4test
:
vo
5C48
id bar(bit<2> x, out bit<8> y) {
switch (x) {
0b01: { y = 2; }
0b10: { y = 3; }
}
}
control C(out bit<8> y) {
action foo() {
bar(1, y);
}
table t {
actions = { foo; }
default_action = foo;
}
apply {
t.apply();
}
}
control proto(out bit<8> y);
package top(proto p);
top(C()) main;
results in:
tmp.p4(2): [--Wwarn=mismatch] warning: x: constant expression in switch
switch (x) {
^
In file: ../../../frontends/p4/simplifySwitch.cpp:34
Compiler Bug: tmp.p4(2): Unexpected expression x;
switch (x) {
^