Adding a twist to byte-order test case
@@ -39,17 +39,17 @@ control egress(inout headers hdr,
in psa_egress_input_metadata_t istd,
inout psa_egress_output_metadata_t ostd)
{
+ const bit<32> addr2 = 0x12345678;
+
action action1(bit<32> data) { hdr.dummy.addr1 = data + 32w1; }
- action action2() {meta.addr1 = 0x12345678; }
- action action3(bit<32> data) { hdr.dummy.addr1 = data + 32w1; }
- action action4() {meta.addr1 = 0x12345678; }
+ action action2() {meta.addr1 = 0x12345678 + 32w1; }
+ action action3() {meta.addr1 = addr2 + 32w1; }
table t1 {
actions = {
action1;
action2;
action3;
- action4;
}
key = {
@@ -62,15 +62,15 @@ control egress(inout headers hdr,
const entries = {
(0x00, 0x12345678) : action1(0x12345678);
(0x01, 0x12345678) : action2();
- (0x02, 0x12345678) : action3(0x12345678);
- (0x03, 0x12345678) : action4();
+ (0x02, 0x12345678) : action1(addr2);
+ (0x03, 0x12345678) : action3();
}
}
apply {
t1.apply();
- if (hdr.dummy.version==1 || hdr.dummy.version==3) {
+ if (hdr.dummy.version==0x01 || hdr.dummy.version==0x03) {
hdr.dummy.addr1 = meta.addr1;
}
}
