Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cortex-m-rtfm-klee
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KLEE
cortex-m-rtfm-klee
Commits
599194b9
Commit
599194b9
authored
7 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Plain Diff
Merge branch 'klee' of gitlab.henriktjader.com:KLEE/cortex-m-rtfm-klee into klee
parents
2791081e
28b88b09
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.cargo/config
+3
-1
3 additions, 1 deletion
.cargo/config
klee/src/lib.rs
+28
-11
28 additions, 11 deletions
klee/src/lib.rs
klee/src/ll.rs
+3
-0
3 additions, 0 deletions
klee/src/ll.rs
with
34 additions
and
12 deletions
.cargo/config
+
3
−
1
View file @
599194b9
...
@@ -28,6 +28,7 @@ rustflags = [
...
@@ -28,6 +28,7 @@ rustflags = [
"-C", "link-arg=-Tlink.x",
"-C", "link-arg=-Tlink.x",
"-C", "linker=arm-none-eabi-ld",
"-C", "linker=arm-none-eabi-ld",
"-Z", "linker-flavor=ld",
"-Z", "linker-flavor=ld",
"-Z", "thinlto=no",
]
]
# used when building for klee
# used when building for klee
...
@@ -35,7 +36,8 @@ rustflags = [
...
@@ -35,7 +36,8 @@ rustflags = [
[target.x86_64-unknown-linux-gnu]
[target.x86_64-unknown-linux-gnu]
rustflags = [
rustflags = [
"--emit=llvm-bc,llvm-ir",
"--emit=llvm-bc,llvm-ir",
"-C", "linker=true"
"-C", "linker=true",
"-Z", "thinlto=no",
]
]
# default build target (for m3)
# default build target (for m3)
...
...
This diff is collapsed.
Click to expand it.
klee/src/lib.rs
+
28
−
11
View file @
599194b9
...
@@ -7,7 +7,7 @@ extern crate cstr_core;
...
@@ -7,7 +7,7 @@ extern crate cstr_core;
extern
crate
cty
;
extern
crate
cty
;
// mod lang_items;
// mod lang_items;
mod
ll
;
pub
mod
ll
;
use
core
::
mem
;
use
core
::
mem
;
...
@@ -42,7 +42,7 @@ pub fn k_mk_symbol<T>(t: &mut T, name: &CStr) {
...
@@ -42,7 +42,7 @@ pub fn k_mk_symbol<T>(t: &mut T, name: &CStr) {
}
}
}
}
#[inline(
never
)]
#[inline(
always
)]
pub
fn
k_abort
()
->
!
{
pub
fn
k_abort
()
->
!
{
unsafe
{
unsafe
{
ll
::
abort
();
ll
::
abort
();
...
@@ -50,7 +50,7 @@ pub fn k_abort() -> ! {
...
@@ -50,7 +50,7 @@ pub fn k_abort() -> ! {
}
}
/// assume a condition involving symbolic variables
/// assume a condition involving symbolic variables
#[inline(
never
)]
#[inline(
always
)]
pub
fn
k_assume
(
cond
:
bool
)
{
pub
fn
k_assume
(
cond
:
bool
)
{
unsafe
{
unsafe
{
ll
::
klee_assume
(
cond
);
ll
::
klee_assume
(
cond
);
...
@@ -58,10 +58,12 @@ pub fn k_assume(cond: bool) {
...
@@ -58,10 +58,12 @@ pub fn k_assume(cond: bool) {
}
}
/// assert a condition involving symbolic variables
/// assert a condition involving symbolic variables
#[inline(
never
)]
#[inline(
always
)]
pub
fn
k_assert
(
e
:
bool
)
{
pub
fn
k_assert
(
e
:
bool
)
{
if
!
e
{
if
!
e
{
k_abort
();
unsafe
{
ll
::
abort
();
}
}
}
}
}
...
@@ -80,6 +82,21 @@ macro_rules! k_symbol {
...
@@ -80,6 +82,21 @@ macro_rules! k_symbol {
}
}
}
}
/// assertion
#[macro_export]
macro_rules!
k_assert
{
(
$e
:
expr
)
=>
{
{
use
klee
::
ll
;
if
!
$e
{
unsafe
{
ll
::
abort
();
}
}
}
}
}
#[macro_export]
#[macro_export]
macro_rules!
k_visit
{
macro_rules!
k_visit
{
()
=>
{
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
klee/src/ll.rs
+
3
−
0
View file @
599194b9
...
@@ -8,12 +8,15 @@ extern "C" {
...
@@ -8,12 +8,15 @@ extern "C" {
}
}
#[cfg(not(feature
=
"klee_mode"
))]
#[cfg(not(feature
=
"klee_mode"
))]
#[inline(always)]
pub
unsafe
fn
abort
()
->
!
{
pub
unsafe
fn
abort
()
->
!
{
loop
{}
loop
{}
}
}
#[cfg(not(feature
=
"klee_mode"
))]
#[cfg(not(feature
=
"klee_mode"
))]
#[inline(always)]
pub
unsafe
fn
klee_assume
(
_cond
:
bool
)
{}
pub
unsafe
fn
klee_assume
(
_cond
:
bool
)
{}
#[cfg(not(feature
=
"klee_mode"
))]
#[cfg(not(feature
=
"klee_mode"
))]
#[inline(always)]
pub
unsafe
fn
klee_make_symbolic
(
_ptr
:
*
mut
c_void
,
_size
:
usize
,
_name
:
*
const
c_char
)
{}
pub
unsafe
fn
klee_make_symbolic
(
_ptr
:
*
mut
c_void
,
_size
:
usize
,
_name
:
*
const
c_char
)
{}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment