From 5566a0552392d1498713d1e42fb11acb904ada60 Mon Sep 17 00:00:00 2001 From: Vladimir Still Date: Mon, 12 Feb 2024 01:17:32 -0800 Subject: [PATCH] Add test --- testdata/p4_16_errors/type-in-expr.p4 | 8 ++++++++ testdata/p4_16_errors_outputs/type-in-expr.p4 | 7 +++++++ testdata/p4_16_errors_outputs/type-in-expr.p4-stderr | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 testdata/p4_16_errors/type-in-expr.p4 create mode 100644 testdata/p4_16_errors_outputs/type-in-expr.p4 create mode 100644 testdata/p4_16_errors_outputs/type-in-expr.p4-stderr diff --git a/testdata/p4_16_errors/type-in-expr.p4 b/testdata/p4_16_errors/type-in-expr.p4 new file mode 100644 index 00000000000..1f733715ede --- /dev/null +++ b/testdata/p4_16_errors/type-in-expr.p4 @@ -0,0 +1,8 @@ +#include + +@foo[bar=4(in H hdrs, out bool flag) +{ + apply { + } +} diff --git a/testdata/p4_16_errors_outputs/type-in-expr.p4 b/testdata/p4_16_errors_outputs/type-in-expr.p4 new file mode 100644 index 00000000000..b260bf5c0ca --- /dev/null +++ b/testdata/p4_16_errors_outputs/type-in-expr.p4 @@ -0,0 +1,7 @@ +#include + +@foo[bar=4 < H] control p(in H hdrs, out bool flag) { + apply { + } +} + diff --git a/testdata/p4_16_errors_outputs/type-in-expr.p4-stderr b/testdata/p4_16_errors_outputs/type-in-expr.p4-stderr new file mode 100644 index 00000000000..b81e3569f16 --- /dev/null +++ b/testdata/p4_16_errors_outputs/type-in-expr.p4-stderr @@ -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(in H hdrs, out bool flag) + ^