diff --git a/testdata/p4_16_samples/type-spec-nested.p4 b/testdata/p4_16_samples/type-spec-nested.p4 new file mode 100644 index 00000000000..ddc358186e0 --- /dev/null +++ b/testdata/p4_16_samples/type-spec-nested.p4 @@ -0,0 +1,22 @@ +void test(in T val) {} + +struct S2 { + T x; + T y; +} + +struct S1 { + T1 x; + S2 y; +} + +control c(inout bit<8> a) { + apply { + test((S1, int<6>>){x = 0, y = (S2>){x = 0, y = 0}}); + } +} + +control E(inout bit<8> t); +package top(E e); + +top(c()) main; diff --git a/testdata/p4_16_samples_outputs/type-spec-nested-first.p4 b/testdata/p4_16_samples_outputs/type-spec-nested-first.p4 new file mode 100644 index 00000000000..b8bd9cb4728 --- /dev/null +++ b/testdata/p4_16_samples_outputs/type-spec-nested-first.p4 @@ -0,0 +1,33 @@ +void test(in T val) { +} +struct S2_0 { + int<6> x; + int<6> y; +} + +struct S2 { + T x; + T y; +} + +struct S1_0 { + bit<4> x; + S2_0 y; +} + +struct S1 { + T1 x; + S2 y; +} + +void test_0(in S1_0 val) { +} +control c(inout bit<8> a) { + apply { + test_0((S1_0){x = 4w0,y = (S2_0){x = 6s0,y = 6s0}}); + } +} + +control E(inout bit<8> t); +package top(E e); +top(c()) main; diff --git a/testdata/p4_16_samples_outputs/type-spec-nested-frontend.p4 b/testdata/p4_16_samples_outputs/type-spec-nested-frontend.p4 new file mode 100644 index 00000000000..d6f6b63a35e --- /dev/null +++ b/testdata/p4_16_samples_outputs/type-spec-nested-frontend.p4 @@ -0,0 +1,28 @@ +struct S2_0 { + int<6> x; + int<6> y; +} + +struct S2 { + T x; + T y; +} + +struct S1_0 { + bit<4> x; + S2_0 y; +} + +struct S1 { + T1 x; + S2 y; +} + +control c(inout bit<8> a) { + apply { + } +} + +control E(inout bit<8> t); +package top(E e); +top(c()) main; diff --git a/testdata/p4_16_samples_outputs/type-spec-nested-midend.p4 b/testdata/p4_16_samples_outputs/type-spec-nested-midend.p4 new file mode 100644 index 00000000000..d6f6b63a35e --- /dev/null +++ b/testdata/p4_16_samples_outputs/type-spec-nested-midend.p4 @@ -0,0 +1,28 @@ +struct S2_0 { + int<6> x; + int<6> y; +} + +struct S2 { + T x; + T y; +} + +struct S1_0 { + bit<4> x; + S2_0 y; +} + +struct S1 { + T1 x; + S2 y; +} + +control c(inout bit<8> a) { + apply { + } +} + +control E(inout bit<8> t); +package top(E e); +top(c()) main; diff --git a/testdata/p4_16_samples_outputs/type-spec-nested.p4 b/testdata/p4_16_samples_outputs/type-spec-nested.p4 new file mode 100644 index 00000000000..a28b7d3e710 --- /dev/null +++ b/testdata/p4_16_samples_outputs/type-spec-nested.p4 @@ -0,0 +1,21 @@ +void test(in T val) { +} +struct S2 { + T x; + T y; +} + +struct S1 { + T1 x; + S2 y; +} + +control c(inout bit<8> a) { + apply { + test((S1, int<6>>){x = 0,y = (S2>){x = 0,y = 0}}); + } +} + +control E(inout bit<8> t); +package top(E e); +top(c()) main; diff --git a/testdata/p4_16_samples_outputs/type-spec-nested.p4-stderr b/testdata/p4_16_samples_outputs/type-spec-nested.p4-stderr new file mode 100644 index 00000000000..e69de29bb2d