-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Minor tweaks - Expression::toString() generate actual expression strings - LocalCopyProp typechecking arg optional - json factor common code * Better name tracking for error messages * Additional slice-related strength reductions - slice on slice * Type_Specialized ctor sugar * Fix brief dbprint of ParserState * update expected error messages --------- Co-authored-by: Chris Dodd <[email protected]>
- Loading branch information
Chris Dodd
and
Chris Dodd
authored
Aug 15, 2023
1 parent
38952df
commit 3bf3c9c
Showing
43 changed files
with
90 additions
and
89 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
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
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
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
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
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
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
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
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
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
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,4 +1,4 @@ | ||
issue905.p4(34): [--Werror=type-error] error: *: not defined on operands of type varbit<0> | ||
issue905.p4(34): [--Werror=type-error] error: can_data.value * 2: not defined on operands of type varbit<0> | ||
modify_field(can_data.value, can_data.value * 2); // error | ||
^ | ||
[--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
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,6 +1,6 @@ | ||
const1_e.p4(19): [--Werror=invalid] error: +: operands have different types: bit<32> and bit<16> | ||
const1_e.p4(19): [--Werror=invalid] error: 5 + 3: operands have different types: bit<32> and bit<16> | ||
x = 32w5 + 16w3; | ||
^^^^^^^^^^^ | ||
const1_e.p4(21): [--Werror=invalid] error: /: Division by zero | ||
const1_e.p4(21): [--Werror=invalid] error: 5 / 0: Division by zero | ||
x = 5 / 0; | ||
^^^^^ |
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,9 +1,9 @@ | ||
div.p4(18): [--Werror=invalid] error: /: Division is not defined for negative numbers | ||
div.p4(18): [--Werror=invalid] error: -8 / -2: Division is not defined for negative numbers | ||
a = - 8 / -2; | ||
^^^^^^^^ | ||
div.p4(19): [--Werror=invalid] error: %: Modulo is not defined for negative numbers | ||
div.p4(19): [--Werror=invalid] error: -10 % 2: Modulo is not defined for negative numbers | ||
a = -10 % 2; | ||
^^^^^^^ | ||
div.p4(20): [--Werror=invalid] error: %: Modulo is not defined for negative numbers | ||
div.p4(20): [--Werror=invalid] error: 10 % -2: Modulo is not defined for negative numbers | ||
a = 10 % -2; | ||
^^^^^^^ |
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 @@ | ||
div0.p4(18): [--Werror=expr] error: /: Division by zero | ||
div0.p4(18): [--Werror=expr] error: a / 0: Division by zero | ||
a = a / 0; | ||
^^^^^ | ||
div0.p4(19): [--Werror=expr] error: %: Modulo by zero | ||
div0.p4(19): [--Werror=expr] error: a % 0: Modulo by zero | ||
a = a % 0; | ||
^^^^^ | ||
div0.p4(20): [--Werror=expr] error: /: Division by zero | ||
div0.p4(20): [--Werror=expr] error: a / 0: Division by zero | ||
a = a / 8w0; | ||
^^^^^^^ | ||
div0.p4(21): [--Werror=expr] error: %: Modulo by zero | ||
div0.p4(21): [--Werror=expr] error: a % 0: Modulo by zero | ||
a = a % 8w0; | ||
^^^^^^^ |
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 @@ | ||
div1.p4(18): [--Werror=type-error] error: /: not defined on negative numbers | ||
div1.p4(18): [--Werror=type-error] error: a / -1: not defined on negative numbers | ||
a = a / -1; // not defined for negative numbers | ||
^^^^^^ | ||
div1.p4(19): [--Werror=type-error] error: /: not defined on negative numbers | ||
div1.p4(19): [--Werror=type-error] error: -5 / a: not defined on negative numbers | ||
a = -5 / a; | ||
^^^^^^ | ||
div1.p4(20): [--Werror=type-error] error: %: not defined on negative numbers | ||
div1.p4(20): [--Werror=type-error] error: a % -1: not defined on negative numbers | ||
a = a % -1; | ||
^^^^^^ | ||
div1.p4(21): [--Werror=type-error] error: %: not defined on negative numbers | ||
div1.p4(21): [--Werror=type-error] error: -5 % a: not defined on negative numbers | ||
a = -5 % a; | ||
^^^^^^ |
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,3 @@ | ||
div3.p4(19): [--Werror=invalid] error: /: could not evaluate expression at compilation time | ||
div3.p4(19): [--Werror=invalid] error: a / 3: could not evaluate expression at compilation time | ||
a = a / b; // not a compile-time constant | ||
^^^^^ |
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
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,3 @@ | ||
issue2206.p4(27): [--Werror=type-error] error: <<: width of left operand of shift needs to be specified | ||
issue2206.p4(27): [--Werror=type-error] error: 1 << h.h.c: width of left operand of shift needs to be specified | ||
h.h.a = (1 << h.h.c) + 8w2; | ||
^^^^^^^^^^ |
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,3 @@ | ||
issue2444-1.p4(2): [--Werror=invalid] error: cast: Only 0 and 1 can be cast to booleans | ||
issue2444-1.p4(2): [--Werror=invalid] error: (bool)2: Only 0 and 1 can be cast to booleans | ||
const bool b1 = (bool)a1; | ||
^^^^^^^^ |
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,3 @@ | ||
issue2496.p4(25): [--Werror=unsupported] error: <<: Compiler only supports widths up to 2048 | ||
issue2496.p4(25): [--Werror=unsupported] error: 1985245330 << 903012108: Compiler only supports widths up to 2048 | ||
h.eth_hdr.eth_type = 1985245330 << 903012108; | ||
^^^^^^^^^^^^^^^^^^^^^^^ |
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,6 +1,14 @@ | ||
issue3057-1.p4(11): [--Werror=type-error] error: ==: cannot compare structure-valued expressions with unknown types | ||
issue3057-1.p4(11): [--Werror=type-error] error: { | ||
a:1; | ||
b:2; } == { | ||
a:1; | ||
b:2; }: cannot compare structure-valued expressions with unknown types | ||
bool b2 = {a = 32w1,b = 32w2} == {a = 32w1,b = 32w2}; | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
issue3057-1.p4(12): [--Werror=type-error] error: ==: cannot compare structure-valued expressions with unknown types | ||
issue3057-1.p4(12): [--Werror=type-error] error: { | ||
a:1; | ||
b:2; } == { | ||
a:1; | ||
b:2; }: cannot compare structure-valued expressions with unknown types | ||
bool b2_ = {a = 1,b = 2} == {a = 1,b = 2}; | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
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
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
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,3 @@ | ||
issue473.p4(70): [--Werror=type-error] error: cast: action argument must be a compile-time constant | ||
issue473.p4(70): [--Werror=type-error] error: (bit<8>)meta.d: action argument must be a compile-time constant | ||
default_action = b(meta.c, (bit<8>) meta.d); | ||
^^^^^^^^^^^^^^^ |
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,3 @@ | ||
key-name.p4(28): [--Werror=expected] error: +: Complex key expression requires a @name annotation | ||
key-name.p4(28): [--Werror=expected] error: h.a + h.a: Complex key expression requires a @name annotation | ||
key = { h.a + h.a : exact; } | ||
^^^^^^^^^ |
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,6 +1,6 @@ | ||
neg.p4(21): [--Werror=type-error] error: /: Cannot operate on signed values | ||
neg.p4(21): [--Werror=type-error] error: a / b: Cannot operate on signed values | ||
c = a / b; // not defined for signed values | ||
^^^^^ | ||
neg.p4(22): [--Werror=type-error] error: %: Cannot operate on signed values | ||
neg.p4(22): [--Werror=type-error] error: a % b: Cannot operate on signed values | ||
c = a % b; | ||
^^^^^ |
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
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
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,3 @@ | ||
range_e.p4(20): [--Werror=type-error] error: ..: Cannot operate on values with different types bit<2> and bit<3> | ||
range_e.p4(20): [--Werror=type-error] error: 2 .. 3: Cannot operate on values with different types bit<2> and bit<3> | ||
2w2 .. 3w3 : reject; // different widths | ||
^^^^^^^^^^ |
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
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
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
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
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
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,6 +1,6 @@ | ||
tuple-newtype.p4(5): [--Werror=type-error] error: T: `type' can only be applied to base types | ||
type tuple<bit> T; | ||
^ | ||
tuple-newtype.p4(12): [--Werror=type-error] error: cast: Illegal cast from tuple<bit<1>> to T | ||
tuple-newtype.p4(12): [--Werror=type-error] error: (T)ListExpression: Illegal cast from tuple<bit<1>> to T | ||
T tt2 = (T){1w0}; | ||
^^^^^^^^ |
Oops, something went wrong.