tests: extend rejection twins across public semantic features
This commit is contained in:
1 parent
272aebfd32
commit
06d8a1a76a
32 files changed
+396
-22
No files matched your search
@@ -3,12 +3,13 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md
|
||||
module demo.exchange_failure_order
|
||||
// AIR twin: phase5/reject/cmpxchg_failure_stronger.air
|
||||
|
||||
fn main() -> u64
|
||||
effects [atomic, atomic.weak]
|
||||
{
|
||||
let c = atomic.new(1u64);
|
||||
let (old, exchanged) = atomic.compare_exchange(ref c, 1u64, 2u64, relaxed, acquire);
|
||||
let (old, exchanged) = atomic.compare_exchange(ref c, 1u64, 2u64, relaxed, acquire); // diagnostic here
|
||||
let v = atomic.take(move c);
|
||||
old + v
|
||||
}
|
||||
@@ -3,10 +3,11 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md
|
||||
module demo.leak
|
||||
// AIR twin: phase5/reject/leak.air
|
||||
|
||||
fn main() -> u64
|
||||
effects [atomic]
|
||||
{
|
||||
let c = atomic.new(1u64);
|
||||
atomic.load(ref c, seq_cst)
|
||||
atomic.load(ref c, seq_cst) // diagnostic here
|
||||
}
|
||||
@@ -9,7 +9,7 @@ effects [atomic]
|
||||
{
|
||||
let c = atomic.new(1u64);
|
||||
{
|
||||
mut m = c;
|
||||
mut m = c; // diagnostic here: c
|
||||
}
|
||||
atomic.take(move c)
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md
|
||||
module demo.take_while_lent
|
||||
// AIR twin: phase5/reject/take_while_lent.air
|
||||
|
||||
fn read(c: ref<atomic<u64>>) -> u64
|
||||
effects [atomic]
|
||||
@@ -19,7 +20,7 @@ effects [atomic, task.spawn, task.wait]
|
||||
ref r = c;
|
||||
scope s {
|
||||
let t = task.spawn(s, read, r);
|
||||
v = atomic.take(move c);
|
||||
v = atomic.take(move c); // diagnostic here: atomic.take
|
||||
let x = task.join(move t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ module demo.wide_cell
|
||||
fn main() -> u64
|
||||
effects [atomic]
|
||||
{
|
||||
let c = atomic.new(1u128);
|
||||
let c = atomic.new(1u128); // diagnostic here: 1u128
|
||||
let t = atomic.take(move c);
|
||||
0
|
||||
}
|
||||
Reference in new issue
Block a user