Skip to content

Commit f760a93

Browse files
committed
[herd] Add tests
1 parent 2f8ed1d commit f760a93

File tree

8 files changed

+90
-2
lines changed

8 files changed

+90
-2
lines changed

herd/tests/instructions/AArch64.kvm/A031.litmus.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ States 3
55
1:X5=2; [PTE(z)]=(oa:PA(x));
66
Ok
77
Witnesses
8-
Positive: 14 Negative: 0
8+
Positive: 10 Negative: 0
99
Flag requires-BBM
1010
Condition ~exists ([PTE(z)]=(oa:PA(x), af:0) /\ 1:X5=2)
11-
Observation A031 Never 0 14
11+
Observation A031 Never 0 10
1212
Hash=b49f887241d4043b0d917f97925e00ab
1313

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
AArch64 A032
2+
Variant=vmsa
3+
TTHM=HA
4+
(* Allowed, by two spurious HW updates *)
5+
{
6+
int x=1;
7+
int y=2;
8+
[PTE(x)]=(oa:PA(x),af:0);
9+
0:X0=PTE(x); 0:X1=(oa:PA(y),af:0);
10+
}
11+
P0 ;
12+
LDR X3,[X0] ;
13+
STR X1,[X0] ;
14+
exists 0:X3=(oa:PA(x)) /\ [PTE(x)]=(oa:PA(y))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Test A032 Allowed
2+
States 4
3+
0:X3=(oa:PA(x), af:0); [PTE(x)]=(oa:PA(y), af:0);
4+
0:X3=(oa:PA(x), af:0); [PTE(x)]=(oa:PA(y));
5+
0:X3=(oa:PA(x)); [PTE(x)]=(oa:PA(y), af:0);
6+
0:X3=(oa:PA(x)); [PTE(x)]=(oa:PA(y));
7+
Ok
8+
Witnesses
9+
Positive: 2 Negative: 6
10+
Condition exists (0:X3=(oa:PA(x)) /\ [PTE(x)]=(oa:PA(y)))
11+
Observation A032 Sometimes 2 6
12+
Hash=4d4ebbbbd741d64b8bb4bcece91ef26d
13+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
AArch64 A033
2+
Variant=vmsa
3+
TTHM=HA
4+
(* Only 4 exections, tests the "write_loaded" optimisation in herd/mem.ml *)
5+
{
6+
[x]=1;
7+
[PTE(x)]=(oa:PA(x),af:0);
8+
0:X4=(oa:PA(x),af:0); 0:X5=PTE(x);
9+
0:X6=(oa:PA(y));
10+
}
11+
P0 ;
12+
CAS X4,X6,[X5] ;
13+
locations [PTE(x)]
14+
exists [PTE(x)]=(oa:PA(x));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Test A033 Allowed
2+
States 2
3+
[PTE(x)]=(oa:PA(x));
4+
[PTE(x)]=(oa:PA(y));
5+
Ok
6+
Witnesses
7+
Positive: 2 Negative: 2
8+
Condition exists ([PTE(x)]=(oa:PA(x)))
9+
Observation A033 Sometimes 2 2
10+
Hash=3ed88fecb82a1a11276fc0a9dff5afa6
11+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
AArch64 A034
2+
Variant=vmsa
3+
TTHM=HA
4+
(*
5+
* Test enhanced bounds on spurious HW updates,
6+
* Should terminate in decent time.
7+
*)
8+
{
9+
[x]=1; [y]=2;
10+
[PTE(x)]=(oa:PA(x));
11+
0:X1=x; 1:X1=x;
12+
1:X4=(oa:PA(x),af:0); 1:X5=PTE(x);
13+
1:X6=(oa:PA(y));
14+
}
15+
P0 | P1 ;
16+
L1: | STR X4,[X5] ;
17+
LDR W0,[X1] | DSB ISH ;
18+
L2: | LSR X9,X1,#12 ;
19+
LDR W2,[X1] | TLBI VAAE1IS,X9 ;
20+
| DSB ISH ;
21+
| CAS X4,X6,[X5] ;
22+
exists (0:X0=2 /\ 0:X2=1)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Test A034 Allowed
2+
States 3
3+
0:X0=1; 0:X2=1;
4+
0:X0=1; 0:X2=2;
5+
0:X0=2; 0:X2=2;
6+
No
7+
Witnesses
8+
Positive: 0 Negative: 70
9+
Condition exists (0:X0=2 /\ 0:X2=1)
10+
Observation A034 Never 0 70
11+
Hash=0a5d5dfceba07390c6252921dbe58a4f
12+

herd/tests/instructions/AArch64.kvm/asl-vmsa.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ nonames A006,F006,F007
1717
nonames A024,A025
1818
# Too long to run (copied to the catalogue)
1919
nonames A031
20+
# Too long to run
21+
nonames A034

0 commit comments

Comments
 (0)