Skip to content

Commit

Permalink
Several "unit" tests
Browse files Browse the repository at this point in the history
Co-authored by: Luc Maranget
  • Loading branch information
artkhyzha committed Sep 9, 2023
1 parent 328f7c8 commit 1381c6f
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 0 deletions.
16 changes: 16 additions & 0 deletions herd/tests/instructions/AArch64/AK001.litmus
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
AArch64 AK001 (* LB+rel+br-ctrl *)
{
ins_t *y;
0:X2=x; 0:X4=y; 0:X3=P1:L0;
1:X2=x; 1:X4=y;
}
P0 |P1 ;
LDR W1,[X2] | ADR X5,L1 ;
STLR X3,[X4] | STR X5,[X4] ;
| LDR X3,[X4] ;
| BR X3 ;
|L0: ;
| MOV W0,#1 ;
| STR W0,[X2] ;
|L1: ;
exists (0:X1=1 /\ 1:X0=1)
11 changes: 11 additions & 0 deletions herd/tests/instructions/AArch64/AK001.litmus.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Test AK001 Allowed
States 2
0:X1=0; 1:X0=0;
0:X1=0; 1:X0=1;
No
Witnesses
Positive: 0 Negative: 3
Condition exists (0:X1=1 /\ 1:X0=1)
Observation AK001 Never 0 3
Hash=7967e5120b4f97d2a96964ef4e3b026a

17 changes: 17 additions & 0 deletions herd/tests/instructions/AArch64/AK002.litmus
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AArch64 AK002 (* MP+rel+br-ctrlisb-1 *)
{
ins_t *y;
0:X2=x; 0:X4=y; 0:X3=P1:L0;
1:X2=x; 1:X4=y;
}
P0 | P1 ;
MOV W1,#1 | ADR X5,L1 ;
STR W1,[X2] | STR X5,[X4] ;
STLR X3,[X4] | LDR X3,[X4] ;
| BR X3 ;
|L0: ;
| ISB ;
| MOV W0,#1 ;
| LDR W1,[X2] ;
|L1: ;
exists (1:X0=1 /\ 1:X1=0)
11 changes: 11 additions & 0 deletions herd/tests/instructions/AArch64/AK002.litmus.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Test AK002 Allowed
States 2
1:X0=0; 1:X1=0;
1:X0=1; 1:X1=1;
No
Witnesses
Positive: 0 Negative: 3
Condition exists (1:X0=1 /\ 1:X1=0)
Observation AK002 Never 0 3
Hash=c4340862f7579b543222fa925b3531ea

17 changes: 17 additions & 0 deletions herd/tests/instructions/AArch64/AK003.litmus
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
AArch64 AK003 (* MP+rel+br-ctrlisb-2 *)
{
ins_t *y;
0:X2=x; 0:X4=y; 0:X3=P1:L0;
1:X2=x; 1:X4=y;
}
P0 | P1 ;
MOV W1,#1 | ADR X5,L1 ;
STR W1,[X2] | STR X5,[X4] ;
STLR X3,[X4] | LDR X3,[X4] ;
| BR X3 ;
|L0: ;
| ISB ;
| MOV W0,#1 ;
|L1: ;
| LDR W1,[X2] ;
exists (1:X0=1 /\ 1:X1=0)
12 changes: 12 additions & 0 deletions herd/tests/instructions/AArch64/AK003.litmus.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Test AK003 Allowed
States 3
1:X0=0; 1:X1=0;
1:X0=0; 1:X1=1;
1:X0=1; 1:X1=1;
No
Witnesses
Positive: 0 Negative: 5
Condition exists (1:X0=1 /\ 1:X1=0)
Observation AK003 Never 0 5
Hash=f1ea3d37edb778d976084e71b2bbafc9

0 comments on commit 1381c6f

Please sign in to comment.