Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
c89f0a2b
Commit
c89f0a2b
authored
6 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[obfuscator] Adds some tests.
parent
7916f13a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/misc/obfuscate.c
+13
-0
13 additions, 0 deletions
tests/misc/obfuscate.c
tests/misc/oracle/obfuscate.res.oracle
+30
-2
30 additions, 2 deletions
tests/misc/oracle/obfuscate.res.oracle
with
43 additions
and
2 deletions
tests/misc/obfuscate.
i
→
tests/misc/obfuscate.
c
+
13
−
0
View file @
c89f0a2b
...
...
@@ -46,3 +46,16 @@ int logic(int f1)
int
main
(
int
*
p
)
{
if
(
"ti
\r
ti"
==
"ti
\r
ti"
)
f
(
p
);
}
/* Obfuscate logic types and logic constructors. */
/*@ type t = T | F; */
#include
"stdint.h"
/* Do not obfuscate builtins and stdlib types and functions. */
int
builtin_and_stdlib
()
{
int32_t
x
=
42
;
Frama_C_show_each
(
x
);
/*@ assert \true; */
return
1
;
}
This diff is collapsed.
Click to expand it.
tests/misc/oracle/obfuscate.res.oracle
+
30
−
2
View file @
c89f0a2b
[kernel] Parsing tests/misc/obfuscate.i (no preprocessing)
[kernel] Parsing tests/misc/obfuscate.c (with preprocessing)
[obfuscator] Warning: unobfuscated attribute name `fc_stdlib'
[obfuscator] Warning: unobfuscated attribute parameter name `stdint.h'
[obfuscator] Warning: unobfuscated attribute name `missingproto'
/* *********************************** */
/* start of dictionary for obfuscation */
/* *********************************** */
...
...
@@ -12,11 +15,17 @@
#define F1 my_func
#define F2 f
#define F3 logic
#define F4 builtin_and_stdlib
// global variables
#define G1 my_var
// labels
#define L1 end
#define L2 end
// logic constructors
#define LC1 T
#define LC2 F
// logic types
#define LT1 t
// logic variables
#define LV1 I
#define LV2 x
...
...
@@ -29,6 +38,8 @@
#define V2 __retres
#define V3 V1
#define V4 __retres
#define V5 x
#define V6 __retres
// formal variables
#define f1 p
#define f2 f1
...
...
@@ -47,6 +58,7 @@
/* ********************************************************* */
/* Generated by Frama-C */
#include "stdint.h"
enum T1 {
E1 = 0,
E2 = 1,
...
...
@@ -54,7 +66,8 @@ enum T1 {
};
int G1 = 0;
/*@ global invariant LV1: G1 ≥ 0;
*/
*/
/*@ requires G1 > 0;
ensures G1 > \old(G1);
ensures ∀ ℤ LV2; LV2 ≡ LV2;
...
...
@@ -102,4 +115,19 @@ int main(int *f3)
return V4;
}
/*@ type LT1 = LC1 | LC2;
*/
extern int ( /* missing proto */ Frama_C_show_each)();
int F4(void)
{
int V6;
int32_t V5 = 42;
Frama_C_show_each(V5);
/*@ assert \true; */ ;
V6 = 1;
return V6;
}
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