Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
tar --strip-components=1 -xf thrust-pcsat-wrapper.tar.gz
mv thrust-pcsat-wrapper "$GITHUB_WORKSPACE/tests/thrust-pcsat-wrapper"
env:
PCSAT_URL: https://thrust-ci-public.s3.ap-northeast-1.amazonaws.com/pcsat/thrust-pcsat-wrapper-873d558c6a.tar.gz
PCSAT_SHA256: cae6829b40cfde196ae231f4a97eed5b873756cb59619f580934b488c1e7a11a
PCSAT_URL: https://thrust-ci-public.s3.ap-northeast-1.amazonaws.com/pcsat/thrust-pcsat-wrapper-49ed9fe340.tar.gz
PCSAT_SHA256: 7a606b60050e8e04aece7a58297fcd80055783084996d2f1c9fa99d9d51d6114
- run: rustup show
- uses: Swatinem/rust-cache@v2
- run: cargo test
28 changes: 28 additions & 0 deletions tests/ui/fail/slice_split_first_mut_loop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//@error-in-other-file: Unsat
//@compile-flags: -C debug-assertions=off
//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper
//@rustc-env: THRUST_SOLVER_TIMEOUT_SECS=60

#[thrust::trusted]
#[thrust_macros::requires(true)]
#[thrust_macros::ensures(
(*result).len() == 2
&& (*result)[0] == 10
&& (*result)[1] == 20
)]
fn slice() -> &'static mut [i32] {
unimplemented!()
}

#[thrust::callable]
fn check() {
let sl = slice();
let mut s = &mut *sl;
while let Some((first, rest)) = s.split_first_mut() {
*first = 0;
s = rest;
}
assert!(sl[0] != 0);
}

fn main() {}
1 change: 1 addition & 0 deletions tests/ui/pass/seq_subsequence.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@check-pass
//@compile-flags: -C debug-assertions=off
//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper
//@rustc-env: THRUST_SOLVER_TIMEOUT_SECS=60

use thrust_models::model::{Int, Seq};

Expand Down
27 changes: 27 additions & 0 deletions tests/ui/pass/slice_split_first_mut_loop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//@check-pass
//@compile-flags: -C debug-assertions=off
//@rustc-env: THRUST_SOLVER=tests/thrust-pcsat-wrapper

#[thrust::trusted]
#[thrust_macros::requires(true)]
#[thrust_macros::ensures(
(*result).len() == 2
&& (*result)[0] == 10
&& (*result)[1] == 20
)]
fn slice() -> &'static mut [i32] {
unimplemented!()
}

#[thrust::callable]
fn check() {
let sl = slice();
let mut s = &mut *sl;
while let Some((first, rest)) = s.split_first_mut() {
*first = 0;
s = rest;
}
assert!(sl[0] == 0);
}

fn main() {}
Loading