-
Notifications
You must be signed in to change notification settings - Fork 471
Open
Labels
coreTopics concerning the core segments of the compiler (frontend, midend, parser)Topics concerning the core segments of the compiler (frontend, midend, parser)
Description
Building the following P4 program with p4test
:
void 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) {
^
Metadata
Metadata
Assignees
Labels
coreTopics concerning the core segments of the compiler (frontend, midend, parser)Topics concerning the core segments of the compiler (frontend, midend, parser)