-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Dodd
committed
Aug 14, 2023
1 parent
9209776
commit e819dc4
Showing
33 changed files
with
65 additions
and
62 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 |
---|---|---|
@@ -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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
psa-meter2.p4(57): [--Werror=type-error] error: cast | ||
psa-meter2.p4(57): [--Werror=type-error] error: Cannot extract field GREEN from PSA_MeterColor_t which has type Type(PSA_MeterColor_t) | ||
b.data = (bit<16>)meter0.execute(index, PSA_MeterColor_t.GREEN); | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
---- Actual error: | ||
psa.p4(631): Cannot unify type 'PSA_MeterColor_t' with type 'bit<16>' | ||
enum PSA_MeterColor_t { RED, GREEN, YELLOW } | ||
^^^^^^^^^^^^^^^^ | ||
---- Originating from: | ||
psa.p4(631): Cannot cast from 'PSA_MeterColor_t' to 'bit<16>' | ||
enum PSA_MeterColor_t { RED, GREEN, YELLOW } | ||
^^^^^^^^^^^^^^^^ | ||
^^^^^ | ||
psa-meter2.p4(57) | ||
b.data = (bit<16>)meter0.execute(index, PSA_MeterColor_t.GREEN); | ||
^^^^^^^^^^^^^^^^ |
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}; | ||
^^^^^^^^ |
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,9 +1,9 @@ | ||
wrong-cast.p4(1): [--Werror=invalid] error: cast: Only 0 and 1 can be cast to booleans | ||
wrong-cast.p4(1): [--Werror=invalid] error: (bool)3: Only 0 and 1 can be cast to booleans | ||
const bool b = (bool)3; | ||
^^^^^^^ | ||
wrong-cast.p4(2): [--Werror=invalid] error: cast: Cannot cast signed value to boolean | ||
wrong-cast.p4(2): [--Werror=invalid] error: (bool)2s0: Cannot cast signed value to boolean | ||
const bool c = (bool)2s0; | ||
^^^^^^^^^ | ||
wrong-cast.p4(3): [--Werror=invalid] error: cast: Only bit<1> values can be cast to bool | ||
wrong-cast.p4(3): [--Werror=invalid] error: (bool)10w0: Only bit<1> values can be cast to bool | ||
const bool d = (bool)10w0; | ||
^^^^^^^^^^ |
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
6 changes: 3 additions & 3 deletions
6
testdata/p4_16_samples_outputs/gauntlet_various_ops-bmv2.p4-stderr
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