diff --git a/testdata/p4_14_errors_outputs/issue905.p4-stderr b/testdata/p4_14_errors_outputs/issue905.p4-stderr index ec6d29a9432..4403f3a3d51 100644 --- a/testdata/p4_14_errors_outputs/issue905.p4-stderr +++ b/testdata/p4_14_errors_outputs/issue905.p4-stderr @@ -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 diff --git a/testdata/p4_16_errors_outputs/binary_e.p4-stderr b/testdata/p4_16_errors_outputs/binary_e.p4-stderr index 228dfd38c9d..6c521a17ad0 100644 --- a/testdata/p4_16_errors_outputs/binary_e.p4-stderr +++ b/testdata/p4_16_errors_outputs/binary_e.p4-stderr @@ -4,12 +4,12 @@ binary_e.p4(32): [--Werror=type-error] error: Indexing a[2] applied to non-array binary_e.p4(33): [--Werror=type-error] error: Array index d must be an integer, but it has type bool c = stack[d]; // indexing with bool ^ -binary_e.p4(35): [--Werror=type-error] error: &: Cannot operate on values with different widths 2 and 4 +binary_e.p4(35): [--Werror=type-error] error: e & f: Cannot operate on values with different widths 2 and 4 f = e & f; // different width ^^^^^ -binary_e.p4(38): [--Werror=type-error] error: <: not defined on bool and bool +binary_e.p4(38): [--Werror=type-error] error: d < d: not defined on bool and bool d = d < d; // not defined on bool ^^^^^ -binary_e.p4(39): [--Werror=type-error] error: >: not defined on int<2> and int<4> +binary_e.p4(39): [--Werror=type-error] error: a > c: not defined on int<2> and int<4> d = a > c; // different width ^^^^^ diff --git a/testdata/p4_16_errors_outputs/const1_e.p4-stderr b/testdata/p4_16_errors_outputs/const1_e.p4-stderr index 3b115bab9cc..32c4bc8613e 100644 --- a/testdata/p4_16_errors_outputs/const1_e.p4-stderr +++ b/testdata/p4_16_errors_outputs/const1_e.p4-stderr @@ -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; ^^^^^ diff --git a/testdata/p4_16_errors_outputs/div.p4-stderr b/testdata/p4_16_errors_outputs/div.p4-stderr index 33f75e4551e..a413c2b02d1 100644 --- a/testdata/p4_16_errors_outputs/div.p4-stderr +++ b/testdata/p4_16_errors_outputs/div.p4-stderr @@ -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; ^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/div0.p4-stderr b/testdata/p4_16_errors_outputs/div0.p4-stderr index 5ad4493fba5..4f7890097eb 100644 --- a/testdata/p4_16_errors_outputs/div0.p4-stderr +++ b/testdata/p4_16_errors_outputs/div0.p4-stderr @@ -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; ^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/div1.p4-stderr b/testdata/p4_16_errors_outputs/div1.p4-stderr index 7743d70407b..6e9af70866f 100644 --- a/testdata/p4_16_errors_outputs/div1.p4-stderr +++ b/testdata/p4_16_errors_outputs/div1.p4-stderr @@ -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; ^^^^^^ diff --git a/testdata/p4_16_errors_outputs/div3.p4-stderr b/testdata/p4_16_errors_outputs/div3.p4-stderr index 8db6f2540b6..32e38aa13ae 100644 --- a/testdata/p4_16_errors_outputs/div3.p4-stderr +++ b/testdata/p4_16_errors_outputs/div3.p4-stderr @@ -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 ^^^^^ diff --git a/testdata/p4_16_errors_outputs/issue1542.p4-stderr b/testdata/p4_16_errors_outputs/issue1542.p4-stderr index 906df8d4090..f807dc17848 100644 --- a/testdata/p4_16_errors_outputs/issue1542.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue1542.p4-stderr @@ -1,4 +1,4 @@ -issue1542.p4(27): [--Werror=type-error] error: cast: argument does not match declaration in actions list: cast +issue1542.p4(27): [--Werror=type-error] error: (bit<32>)32w2: argument does not match declaration in actions list: (bit<32>)32w1 ( true, 1, true ) : multicast(2); ^ issue1542.p4(22) diff --git a/testdata/p4_16_errors_outputs/issue2206.p4-stderr b/testdata/p4_16_errors_outputs/issue2206.p4-stderr index 7ddc68f2cb7..c7e0471a316 100644 --- a/testdata/p4_16_errors_outputs/issue2206.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue2206.p4-stderr @@ -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; ^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/issue2444-1.p4-stderr b/testdata/p4_16_errors_outputs/issue2444-1.p4-stderr index 89fcc743351..c13b265b899 100644 --- a/testdata/p4_16_errors_outputs/issue2444-1.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue2444-1.p4-stderr @@ -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; ^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/issue2496.p4-stderr b/testdata/p4_16_errors_outputs/issue2496.p4-stderr index ffdfc31bd39..2f5c4ae6164 100644 --- a/testdata/p4_16_errors_outputs/issue2496.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue2496.p4-stderr @@ -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; ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/issue3057-1.p4-stderr b/testdata/p4_16_errors_outputs/issue3057-1.p4-stderr index c5fad282bb2..027d2cd5dc0 100644 --- a/testdata/p4_16_errors_outputs/issue3057-1.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue3057-1.p4-stderr @@ -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}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/issue3221.p4-stderr b/testdata/p4_16_errors_outputs/issue3221.p4-stderr index f1311d4dc4d..3b2ad653981 100644 --- a/testdata/p4_16_errors_outputs/issue3221.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue3221.p4-stderr @@ -1,4 +1,4 @@ -issue3221.p4(8): [--Werror=type-error] error: cast +issue3221.p4(8): [--Werror=type-error] error: (t1)a return (t1)a; ^^^^^ ---- Actual error: diff --git a/testdata/p4_16_errors_outputs/issue401.p4-stderr b/testdata/p4_16_errors_outputs/issue401.p4-stderr index 6e7f8baab07..10774810d19 100644 --- a/testdata/p4_16_errors_outputs/issue401.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue401.p4-stderr @@ -1,4 +1,4 @@ -issue401.p4(42): [--Werror=type-error] error: cast +issue401.p4(42): [--Werror=type-error] error: (bit<1>)ListExpression bit<1> b = (bit<1>) { 0 }; ^^^^^^^^^^^^^^ ---- Actual error: diff --git a/testdata/p4_16_errors_outputs/issue473.p4-stderr b/testdata/p4_16_errors_outputs/issue473.p4-stderr index cb045237f30..1e13865efa9 100644 --- a/testdata/p4_16_errors_outputs/issue473.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue473.p4-stderr @@ -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); ^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/key-name.p4-stderr b/testdata/p4_16_errors_outputs/key-name.p4-stderr index 4fef296cc1f..b7bb16d6e0d 100644 --- a/testdata/p4_16_errors_outputs/key-name.p4-stderr +++ b/testdata/p4_16_errors_outputs/key-name.p4-stderr @@ -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; } ^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/neg.p4-stderr b/testdata/p4_16_errors_outputs/neg.p4-stderr index 7822933663f..8db09b8531c 100644 --- a/testdata/p4_16_errors_outputs/neg.p4-stderr +++ b/testdata/p4_16_errors_outputs/neg.p4-stderr @@ -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; ^^^^^ diff --git a/testdata/p4_16_errors_outputs/newtype-err.p4-stderr b/testdata/p4_16_errors_outputs/newtype-err.p4-stderr index 570d236840e..3130e54af98 100644 --- a/testdata/p4_16_errors_outputs/newtype-err.p4-stderr +++ b/testdata/p4_16_errors_outputs/newtype-err.p4-stderr @@ -6,7 +6,7 @@ newtype-err.p4(2): Cannot cast implicitly type 'bit<32>' to type 'N32' type bit<32> N32; ^^^ ---- Originating from: -newtype-err.p4(10): Source expression '+' produces a result of type 'bit<32>' which cannot be assigned to a left-value with type 'N32' +newtype-err.p4(10): Source expression 'b + b' produces a result of type 'bit<32>' which cannot be assigned to a left-value with type 'N32' n = b + b; ^^^^^ newtype-err.p4(2) diff --git a/testdata/p4_16_errors_outputs/psa-meter2.p4-stderr b/testdata/p4_16_errors_outputs/psa-meter2.p4-stderr index 985fa64ce81..9c5c316e4b1 100644 --- a/testdata/p4_16_errors_outputs/psa-meter2.p4-stderr +++ b/testdata/p4_16_errors_outputs/psa-meter2.p4-stderr @@ -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); + ^^^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/range_e.p4-stderr b/testdata/p4_16_errors_outputs/range_e.p4-stderr index d55c64d3313..987144b038e 100644 --- a/testdata/p4_16_errors_outputs/range_e.p4-stderr +++ b/testdata/p4_16_errors_outputs/range_e.p4-stderr @@ -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 ^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/serenum-type.p4-stderr b/testdata/p4_16_errors_outputs/serenum-type.p4-stderr index 8192d0b9913..fc77d871ad7 100644 --- a/testdata/p4_16_errors_outputs/serenum-type.p4-stderr +++ b/testdata/p4_16_errors_outputs/serenum-type.p4-stderr @@ -1,7 +1,7 @@ serenum-type.p4(8): [--Werror=type-error] error: EthT: Illegal type for enum; only bit<> and int<> are allowed enum EthT EthTypes { ^^^^ -serenum-type.p4(49): [--Werror=type-error] error: cast +serenum-type.p4(49): [--Werror=type-error] error: (EthTypes)16w0 h.eth.type = (EthTypes)(bit<16>)0; ^^^^^^^^^^^^^^^^^^^^ ---- Actual error: diff --git a/testdata/p4_16_errors_outputs/serenum-typedef.p4-stderr b/testdata/p4_16_errors_outputs/serenum-typedef.p4-stderr index 95b56d924d7..769fcd9b6e2 100644 --- a/testdata/p4_16_errors_outputs/serenum-typedef.p4-stderr +++ b/testdata/p4_16_errors_outputs/serenum-typedef.p4-stderr @@ -1,7 +1,7 @@ serenum-typedef.p4(8): [--Werror=type-error] error: EthT: Illegal type for enum; only bit<> and int<> are allowed enum EthT EthTypes { ^^^^ -serenum-typedef.p4(49): [--Werror=type-error] error: cast +serenum-typedef.p4(49): [--Werror=type-error] error: (EthTypes)16w0 h.eth.type = (EthTypes)(bit<16>)0; ^^^^^^^^^^^^^^^^^^^^ ---- Actual error: diff --git a/testdata/p4_16_errors_outputs/signs.p4-stderr b/testdata/p4_16_errors_outputs/signs.p4-stderr index 60463dd13b5..b0ef2871250 100644 --- a/testdata/p4_16_errors_outputs/signs.p4-stderr +++ b/testdata/p4_16_errors_outputs/signs.p4-stderr @@ -7,6 +7,6 @@ signs.p4(18): [--Werror=type-error] error: b signs.p4(18): Source expression '8w0' produces a result of type 'bit<8>' which cannot be assigned to a left-value with type 'int<8>' int<8> b = 8w0; ^^^ -signs.p4(19): [--Werror=type-error] error: -: Cannot operate on values with different signs +signs.p4(19): [--Werror=type-error] error: a - b: Cannot operate on values with different signs a = a - b; ^^^^^ diff --git a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4-stderr b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4-stderr index eaf69f2c16a..df59a585545 100644 --- a/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4-stderr +++ b/testdata/p4_16_errors_outputs/table-entries-lpm-2.p4-stderr @@ -13,9 +13,9 @@ table-entries-lpm-2.p4(82): [--Wwarn=mismatch] warning: 8w0x100: value does not table-entries-lpm-2.p4(71): [--Wwarn=mismatch] warning: P4Runtime requires that LPM matches have masked-off bits set to 0, updating value 8w0x11 to conform to the P4Runtime specification 0x11 &&& 0x1F0 : a_with_control_params(12); ^^^^ -table-entries-lpm-2.p4(74): [--Werror=invalid] error: &&& invalid mask for LPM key +table-entries-lpm-2.p4(74): [--Werror=invalid] error: 17 &&& 225 invalid mask for LPM key 0x11 &&& 0xE1 : a_with_control_params(13); ^^^^^^^^^^^^^ -table-entries-lpm-2.p4(78): [--Werror=invalid] error: &&& invalid mask for LPM key +table-entries-lpm-2.p4(78): [--Werror=invalid] error: 17 &&& 129 invalid mask for LPM key 0x11 &&& 0x181 : a_with_control_params(14); ^^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4-stderr b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4-stderr index 0f42c23a1bc..ef394c76640 100644 --- a/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4-stderr +++ b/testdata/p4_16_errors_outputs/table-entries-optional-2-bmv2.p4-stderr @@ -4,6 +4,6 @@ table-entries-optional-2-bmv2.p4(71): [--Wwarn=mismatch] warning: 8w0x100: value table-entries-optional-2-bmv2.p4(73): [--Wwarn=mismatch] warning: 16w0x10000: value does not fit in 16 bits (default, 0x10000): a_with_control_params(3); ^^^^^^^ -table-entries-optional-2-bmv2.p4(69): [--Werror=invalid] error: &&& invalid key expression +table-entries-optional-2-bmv2.p4(69): [--Werror=invalid] error: 170 &&& 240 invalid key expression (0xaa &&& 0xf0, 0x1111 &&& 0xffff) : a_with_control_params(1); ^^^^^^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/tuple-newtype.p4-stderr b/testdata/p4_16_errors_outputs/tuple-newtype.p4-stderr index d03c9f97040..1660e362c27 100644 --- a/testdata/p4_16_errors_outputs/tuple-newtype.p4-stderr +++ b/testdata/p4_16_errors_outputs/tuple-newtype.p4-stderr @@ -1,6 +1,6 @@ tuple-newtype.p4(5): [--Werror=type-error] error: T: `type' can only be applied to base types type tuple T; ^ -tuple-newtype.p4(12): [--Werror=type-error] error: cast: Illegal cast from tuple> to T +tuple-newtype.p4(12): [--Werror=type-error] error: (T)ListExpression: Illegal cast from tuple> to T T tt2 = (T){1w0}; ^^^^^^^^ diff --git a/testdata/p4_16_errors_outputs/virtual1.p4-stderr b/testdata/p4_16_errors_outputs/virtual1.p4-stderr index f4151e3dae6..2d4cac44a81 100644 --- a/testdata/p4_16_errors_outputs/virtual1.p4-stderr +++ b/testdata/p4_16_errors_outputs/virtual1.p4-stderr @@ -1,4 +1,4 @@ -virtual1.p4(24): [--Werror=type-error] error: return + +virtual1.p4(24): [--Werror=type-error] error: return ix + 1 return (ix + 1); ^^^^^^ ---- Actual error: @@ -6,7 +6,7 @@ virtual1.p4(23): Cannot cast implicitly type 'bit<16>' to type 'bool' bool f(in bit<16> ix) { ^^^^ ---- Originating from: -virtual1.p4(24): Source expression '+' produces a result of type 'bit<16>' which cannot be assigned to a left-value with type 'bool' +virtual1.p4(24): Source expression 'ix + 1' produces a result of type 'bit<16>' which cannot be assigned to a left-value with type 'bool' return (ix + 1); ^^^^^^ virtual1.p4(23) diff --git a/testdata/p4_16_errors_outputs/virtual2.p4-stderr b/testdata/p4_16_errors_outputs/virtual2.p4-stderr index fce2e0b90be..ec4bd8f67a2 100644 --- a/testdata/p4_16_errors_outputs/virtual2.p4-stderr +++ b/testdata/p4_16_errors_outputs/virtual2.p4-stderr @@ -1,4 +1,4 @@ -virtual2.p4(24): [--Werror=type-error] error: return +: return expression in function with void return +virtual2.p4(24): [--Werror=type-error] error: return ix + 1: return expression in function with void return return (ix + 1); ^^^^^^ virtual2.p4(22): [--Werror=type-error] error: cntr diff --git a/testdata/p4_16_errors_outputs/wrong-cast.p4-stderr b/testdata/p4_16_errors_outputs/wrong-cast.p4-stderr index c0738c4b9b5..34c5659590d 100644 --- a/testdata/p4_16_errors_outputs/wrong-cast.p4-stderr +++ b/testdata/p4_16_errors_outputs/wrong-cast.p4-stderr @@ -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; ^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/array_field.p4-stderr b/testdata/p4_16_samples_outputs/array_field.p4-stderr index be3218351bb..f16e6ed9522 100644 --- a/testdata/p4_16_samples_outputs/array_field.p4-stderr +++ b/testdata/p4_16_samples_outputs/array_field.p4-stderr @@ -1,7 +1,7 @@ array_field.p4(27): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s[a] s[a].z = 1; ^^^^ -array_field.p4(28): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s[+] +array_field.p4(28): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s[a_0/a + 1] s[a+1].z = 0; ^^^^^^ array_field.p4(29): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s[a] diff --git a/testdata/p4_16_samples_outputs/constant_folding.p4-stderr b/testdata/p4_16_samples_outputs/constant_folding.p4-stderr index 385d0835e9b..f20e2e3ea0d 100644 --- a/testdata/p4_16_samples_outputs/constant_folding.p4-stderr +++ b/testdata/p4_16_samples_outputs/constant_folding.p4-stderr @@ -1,4 +1,4 @@ -constant_folding.p4(95): [--Wwarn=overflow] warning: <<: Shifting 8-bit value with 9 +constant_folding.p4(95): [--Wwarn=overflow] warning: 1 << 9: Shifting 8-bit value with 9 z = 8w1 << 9; ^^^^^^^^ constant_folding.p4(95): [--Wwarn=mismatch] warning: 8w512: value does not fit in 8 bits diff --git a/testdata/p4_16_samples_outputs/gauntlet_various_ops-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/gauntlet_various_ops-bmv2.p4-stderr index 18dca659fad..1899bc36665 100644 --- a/testdata/p4_16_samples_outputs/gauntlet_various_ops-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/gauntlet_various_ops-bmv2.p4-stderr @@ -1,16 +1,16 @@ -gauntlet_various_ops-bmv2.p4(120): [--Wwarn=overflow] warning: >>: Shifting 4-bit value with 16 +gauntlet_various_ops-bmv2.p4(120): [--Wwarn=overflow] warning: 1 >> 16: Shifting 4-bit value with 16 h.rshift.g = 4w1 >> 8w16; ^^^^^^^^^^^ gauntlet_various_ops-bmv2.p4(123): [--Wwarn=mismatch] warning: 4w16: value does not fit in 4 bits h.lshift.a = (bit<8>)(4w4 << 8w2); ^^^^^^^^^^ -gauntlet_various_ops-bmv2.p4(124): [--Wwarn=overflow] warning: <<: Shifting 4-bit value with 16 +gauntlet_various_ops-bmv2.p4(124): [--Wwarn=overflow] warning: 4 << 16: Shifting 4-bit value with 16 h.lshift.b = (bit<8>)(4w4 << 8w16); ^^^^^^^^^^^ gauntlet_various_ops-bmv2.p4(124): [--Wwarn=mismatch] warning: 4w262144: value does not fit in 4 bits h.lshift.b = (bit<8>)(4w4 << 8w16); ^^^^^^^^^^^ -gauntlet_various_ops-bmv2.p4(126): [--Wwarn=overflow] warning: <<: Shifting 8-bit value with 256 +gauntlet_various_ops-bmv2.p4(126): [--Wwarn=overflow] warning: 1 << 256: Shifting 8-bit value with 256 h.lshift.d = (bit<8>)1 << 256; ^^^^^^^^^^^^^^^^ gauntlet_various_ops-bmv2.p4(126): [--Wwarn=mismatch] warning: 8w115792089237316195423570985008687907853269984665640564039457584007913129639936: value does not fit in 8 bits diff --git a/testdata/p4_16_samples_outputs/issue3289.p4-stderr b/testdata/p4_16_samples_outputs/issue3289.p4-stderr index 6dde2821ad2..728666cea48 100644 --- a/testdata/p4_16_samples_outputs/issue3289.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue3289.p4-stderr @@ -1,10 +1,10 @@ -issue3289.p4(3): [--Wwarn=overflow] warning: <<: Shifting 5-bit value with 5 +issue3289.p4(3): [--Wwarn=overflow] warning: 1 << 5: Shifting 5-bit value with 5 return (5w1) << 5; ^^^^^^^^^^ issue3289.p4(3): [--Wwarn=mismatch] warning: 5w32: value does not fit in 5 bits return (5w1) << 5; ^^^^^^^^^^ -issue3289.p4(8): [--Wwarn=overflow] warning: <<: Shifting 5-bit value with 6 +issue3289.p4(8): [--Wwarn=overflow] warning: 1 << 6: Shifting 5-bit value with 6 return (5w1) << 6; ^^^^^^^^^^ issue3289.p4(8): [--Wwarn=mismatch] warning: 5w64: value does not fit in 5 bits