Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimír Štill <[email protected]>
  • Loading branch information
vlstill committed Feb 19, 2025
1 parent d1eb186 commit 988e1b6
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 0 deletions.
22 changes: 22 additions & 0 deletions testdata/p4_16_samples/type-spec-nested.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
void test<T>(in T val) {}

struct S2<T> {
T x;
T y;
}

struct S1<T1, T2> {
T1 x;
S2<T2> y;
}

control c(inout bit<8> a) {
apply {
test((S1<bit<4>, int<6>>){x = 0, y = (S2<int<6>>){x = 0, y = 0}});
}
}

control E(inout bit<8> t);
package top(E e);

top(c()) main;
33 changes: 33 additions & 0 deletions testdata/p4_16_samples_outputs/type-spec-nested-first.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
void test<T>(in T val) {
}
struct S2_0 {
int<6> x;
int<6> y;
}

struct S2<T> {
T x;
T y;
}

struct S1_0 {
bit<4> x;
S2_0 y;
}

struct S1<T1, T2> {
T1 x;
S2<T2> 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;
28 changes: 28 additions & 0 deletions testdata/p4_16_samples_outputs/type-spec-nested-frontend.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
struct S2_0 {
int<6> x;
int<6> y;
}

struct S2<T> {
T x;
T y;
}

struct S1_0 {
bit<4> x;
S2_0 y;
}

struct S1<T1, T2> {
T1 x;
S2<T2> y;
}

control c(inout bit<8> a) {
apply {
}
}

control E(inout bit<8> t);
package top(E e);
top(c()) main;
28 changes: 28 additions & 0 deletions testdata/p4_16_samples_outputs/type-spec-nested-midend.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
struct S2_0 {
int<6> x;
int<6> y;
}

struct S2<T> {
T x;
T y;
}

struct S1_0 {
bit<4> x;
S2_0 y;
}

struct S1<T1, T2> {
T1 x;
S2<T2> y;
}

control c(inout bit<8> a) {
apply {
}
}

control E(inout bit<8> t);
package top(E e);
top(c()) main;
21 changes: 21 additions & 0 deletions testdata/p4_16_samples_outputs/type-spec-nested.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
void test<T>(in T val) {
}
struct S2<T> {
T x;
T y;
}

struct S1<T1, T2> {
T1 x;
S2<T2> y;
}

control c(inout bit<8> a) {
apply {
test((S1<bit<4>, int<6>>){x = 0,y = (S2<int<6>>){x = 0,y = 0}});
}
}

control E(inout bit<8> t);
package top(E e);
top(c()) main;
Empty file.

0 comments on commit 988e1b6

Please sign in to comment.