-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add two related tests, add comments with PR link to the tests
- Loading branch information
Showing
6 changed files
with
33 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// tests problems related to https://github.com/p4lang/p4c/pull/4411 | ||
|
||
#include <core.p4> | ||
|
||
control ctrl<H>(bool val); | ||
|
||
package pkg<H>( | ||
ctrl<H> val = ctrl(H > 3) | ||
); |
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,10 @@ | ||
// tests problems related to https://github.com/p4lang/p4c/pull/4411 | ||
|
||
#include <core.p4> | ||
|
||
parser pars<H>(in bit<16> buf, out H hdrs) { | ||
bool var; | ||
state start { | ||
var = buf > H; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// tests problem solved by https://github.com/p4lang/p4c/pull/4411 | ||
|
||
#include <core.p4> | ||
|
||
@foo[bar=4<H] | ||
|
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,4 @@ | ||
type-in-expr-lex0.p4(8):syntax error, unexpected >, expecting ( | ||
ctrl<H> val = ctrl(H > | ||
^ | ||
[--Werror=overlimit] error: 1 errors encountered, aborting compilation |
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,4 @@ | ||
type-in-expr-lex1.p4(8):syntax error, unexpected ;, expecting ( | ||
var = buf > H; | ||
^ | ||
[--Werror=overlimit] error: 1 errors encountered, aborting compilation |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
type-in-expr.p4(3): [--Werror=type-error] error: H: Type cannot be used here, expecting an expression. | ||
type-in-expr.p4(5): [--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 | ||
type-in-expr.p4(5): [--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. | ||
type-in-expr.p4(5): [--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 | ||
type-in-expr.p4(6): [--Werror=type-error] error: Error while analyzing control p | ||
control p<H>(in H hdrs, out bool flag) | ||
^ |