Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vlstill committed Feb 12, 2024
1 parent 92edc33 commit 5566a05
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testdata/p4_16_errors/type-in-expr.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <core.p4>

@foo[bar=4<H]
control p<H>(in H hdrs, out bool flag)
{
apply {
}
}
7 changes: 7 additions & 0 deletions testdata/p4_16_errors_outputs/type-in-expr.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <core.p4>

@foo[bar=4 < H] control p<H>(in H hdrs, out bool flag) {
apply {
}
}

12 changes: 12 additions & 0 deletions testdata/p4_16_errors_outputs/type-in-expr.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type-in-expr.p4(3): [--Werror=type-error] error: H: Type cannot be used here, expecting an expression.
@foo[bar=4<H]
^
type-in-expr.p4(3): [--Werror=type-error] error: 4 < H: structured annotation must be compile-time constant values
@foo[bar=4<H]
^^^
type-in-expr.p4(3): [--Werror=type-error] error: H: Type cannot be used here, expecting an expression.
@foo[bar=4<H]
^
type-in-expr.p4(4): [--Werror=type-error] error: Error while analyzing control p
control p<H>(in H hdrs, out bool flag)
^

0 comments on commit 5566a05

Please sign in to comment.