Skip to content

Commit

Permalink
Bring back positive version of default-switch.p4 test
Browse files Browse the repository at this point in the history
  • Loading branch information
vlstill committed Jul 29, 2024
1 parent 64c72a5 commit e9bf6a8
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 9 deletions.
File renamed without changes.
9 changes: 9 additions & 0 deletions testdata/p4_16_errors_outputs/default-last-switch.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default-last-switch.p4(11): [--Werror=invalid] error: switch label b follows 'default' label, which is not allowed.
switch (t.apply().action_run) {
^^^^^^
default-last-switch.p4(13)
b: { return; }
^
default-last-switch.p4(12)
default:
^^^^^^^
9 changes: 0 additions & 9 deletions testdata/p4_16_errors_outputs/default-switch.p4-stderr

This file was deleted.

16 changes: 16 additions & 0 deletions testdata/p4_16_samples/default-switch.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
control ctrl() {
action a() {}
action b() {}

table t {
actions = { a; b; }
default_action = a;
}

apply {
switch (t.apply().action_run) {
b:
default: { return; }
}
}
}
22 changes: 22 additions & 0 deletions testdata/p4_16_samples_outputs/default-switch-first.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
control ctrl() {
action a() {
}
action b() {
}
table t {
actions = {
a();
b();
}
default_action = a();
}
apply {
switch (t.apply().action_run) {
b:
default: {
return;
}
}
}
}

Empty file.
22 changes: 22 additions & 0 deletions testdata/p4_16_samples_outputs/default-switch.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
control ctrl() {
action a() {
}
action b() {
}
table t {
actions = {
a;
b;
}
default_action = a;
}
apply {
switch (t.apply().action_run) {
b:
default: {
return;
}
}
}
}

4 changes: 4 additions & 0 deletions testdata/p4_16_samples_outputs/default-switch.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default-switch.p4(1): [--Wwarn=unused] warning: Control ctrl is not used; removing
control ctrl() {
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module

0 comments on commit e9bf6a8

Please sign in to comment.