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
6f2efbe1
Commit
6f2efbe1
authored
3 years ago
by
Valentin Perrelle
Browse files
Options
Downloads
Patches
Plain Diff
[Variadic] Add a test about the conversion of va_arg results
parent
01491b56
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/variadic/tests/defined/oracle/va_arg_cast.res.oracle
+52
-0
52 additions, 0 deletions
...gins/variadic/tests/defined/oracle/va_arg_cast.res.oracle
src/plugins/variadic/tests/defined/va_arg_cast.c
+18
-0
18 additions, 0 deletions
src/plugins/variadic/tests/defined/va_arg_cast.c
with
70 additions
and
0 deletions
src/plugins/variadic/tests/defined/oracle/va_arg_cast.res.oracle
0 → 100644
+
52
−
0
View file @
6f2efbe1
[kernel:parser:decimal-float] va_arg_cast.c:17: Warning:
Floating-point constant 7.1 is not represented exactly. Will use 0x1.c666666666666p2.
(warn-once: no further messages from category 'parser:decimal-float' will be emitted)
[variadic] va_arg_cast.c:10: Declaration of variadic function c.
[variadic] va_arg_cast.c:17: Generic translation of call to variadic function.
[eva] Analyzing a complete application starting at main
[eva] Computing initial state
[eva] Initial state computed
[eva] done for function main
[eva] ====== VALUES COMPUTED ======
[eva:final-states] Values at end of function b:
a ∈ {4619679907765970542}
ap ∈ {{ &__va_args[2] }}
[eva:final-states] Values at end of function c:
a ∈ {4619679907765970542}
ap ∈ {{ &__va_args[0] }}
[eva:final-states] Values at end of function main:
a ∈ {4619679907765970542}
/* Generated by Frama-C */
#include "stdarg.h"
long a;
void b(va_list ap)
{
long tmp;
a = (long)*((double *)*ap);
ap ++;
tmp = *((long *)*ap);
ap ++;
a += tmp;
return;
}
void c(int d, void * const *__va_params)
{
va_list ap;
ap = __va_params;
b(ap);
return;
}
void main(void)
{
{
double __va_arg0 = 8.1;
double __va_arg1 = 7.1;
void *__va_args[2] = {& __va_arg0, & __va_arg1};
c(0,(void * const *)(__va_args));
}
return;
}
This diff is collapsed.
Click to expand it.
src/plugins/variadic/tests/defined/va_arg_cast.c
0 → 100644
+
18
−
0
View file @
6f2efbe1
#include
<stdarg.h>
long
a
;
void
b
(
va_list
ap
)
{
a
=
va_arg
(
ap
,
double
);
a
+=
va_arg
(
ap
,
long
);
}
void
c
(
int
d
,
...)
{
va_list
ap
;
va_start
(
ap
,
d
);
b
(
ap
);
}
void
main
()
{
c
(
0
,
8
.
1
,
7
.
1
);
}
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