Skip to content
Snippets Groups Projects
Commit 5b2a4c72 authored by Henrich Lauko's avatar Henrich Lauko
Browse files

test: Add bunch of abstract unit aggregate tests.

parent 5d79327b
No related branches found
No related tags found
No related merge requests found
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
char * store_ten( char * aggr ) {
auto idx = __unit_val_i64();
aggr[idx] = 10;
return aggr;
}
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto res = store_ten( aggr );
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
char * store_value( char * aggr ) {
auto val = __unit_val_i8();
aggr[5] = val;
return aggr;
}
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto res = store_value( aggr );
char arr[ 10 ] = {};
auto concrete = store_value( arr );
assert( concrete[ 0 ] == 0 );
assert( arr[ 5 ] ); /* ERROR */
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto c = aggr[6];
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto idx = __unit_val_i64();
auto c = aggr[idx];
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto idx = __unit_val_i64();
auto c = aggr[idx];
assert( c ); /* ERROR */
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto val = __unit_val_i8();
auto aggr = static_cast< char * >( __unit_aggregate() );
aggr[5] = val;
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto val = __unit_val_i8();
auto idx = __unit_val_i64();
auto aggr = static_cast< char * >( __unit_aggregate() );
aggr[idx] = val;
}
/* TAGS: star min */
/* VERIFY_OPTS: --symbolic -o nofail:malloc */
#include <rst/domains.h>
#include <cassert>
int main() {
auto aggr = static_cast< char * >( __unit_aggregate() );
auto idx = __unit_val_i64();
aggr[idx] = 10;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment