Skip to content
Snippets Groups Projects
Commit a0e48f90 authored by Thibault Martin's avatar Thibault Martin
Browse files

[tests] Add specifier of implicit ints in tests

parent 7f8bf59b
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 20 deletions
...@@ -4,7 +4,7 @@ STDOPT: +"-dive-from-variables main::res -dive-depth-limit 5" ...@@ -4,7 +4,7 @@ STDOPT: +"-dive-from-variables main::res -dive-depth-limit 5"
int f(int x, int y) int f(int x, int y)
{ {
const c = x + 1; const int c = x + 1;
int w = y + 1; int w = y + 1;
return c + w; return c + w;
} }
......
void duff(int *to, int *from, int count) { void duff(int *to, int *from, int count) {
register n = (count + 7) / 8; register int n = (count + 7) / 8;
switch(count % 8) { switch(count % 8) {
case 0: do { case 0: do {
Frama_C_show_each(to); Frama_C_show_each(to);
......
...@@ -4,7 +4,7 @@ PLUGIN: report from,inout,scope,eva ...@@ -4,7 +4,7 @@ PLUGIN: report from,inout,scope,eva
OPT: -eva-warn-copy-indeterminate=-main4 -eva -eva-show-progress -eva-remove-redundant-alarms -eva-warn-key=alarm=inactive -then -report-csv @PTEST_RESULT@/csv.csv -report-no-proven -then -report-csv= -eva-warn-key=alarm -eva-slevel 1 OPT: -eva-warn-copy-indeterminate=-main4 -eva -eva-show-progress -eva-remove-redundant-alarms -eva-warn-key=alarm=inactive -then -report-csv @PTEST_RESULT@/csv.csv -report-no-proven -then -report-csv= -eva-warn-key=alarm -eva-slevel 1
COMMENT: first, do an analysis without any message, but check that the .csv is complete. Then, redo the analysis with value warnings. slevel 1 is just there to force Value to restart COMMENT: first, do an analysis without any message, but check that the .csv is complete. Then, redo the analysis with value warnings. slevel 1 is just there to force Value to restart
*/ */
volatile v; volatile int v;
void main1(int x) { void main1(int x) {
int t[10]; int t[10];
int u[15]; int u[15];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
int main(){ int main(){
struct flock fl; struct flock fl;
volatile choice = 0; volatile int choice = 0;
// Normal usage // Normal usage
int flags = fcntl(0, F_GETFD); int flags = fcntl(0, F_GETFD);
......
...@@ -6,7 +6,7 @@ int main(){ ...@@ -6,7 +6,7 @@ int main(){
char *string = "foo"; char *string = "foo";
wchar_t *wstring = L"bar"; wchar_t *wstring = L"bar";
volatile nondet = 0; volatile int nondet = 0;
// Wrong pointers are passed to printf and this must be detected by value // Wrong pointers are passed to printf and this must be detected by value
switch (nondet) switch (nondet)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
volatile v; volatile int v;
static void copy(void *dst_, void *src_, size_t off, size_t len) static void copy(void *dst_, void *src_, size_t off, size_t len)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
STDOPT: #" -eva-alloc-builtin fresh" STDOPT: #" -eva-alloc-builtin fresh"
*/ */
#include "stdlib.h" #include "stdlib.h"
volatile v; volatile int v;
void main1() { void main1() {
int *p = malloc(40); int *p = malloc(40);
......
...@@ -8,7 +8,7 @@ void *malloc(size_t size); ...@@ -8,7 +8,7 @@ void *malloc(size_t size);
//@ assigns \nothing; frees p; //@ assigns \nothing; frees p;
void free(void *p); void free(void *p);
volatile v; volatile int v;
void* main1() { void* main1() {
int i, *p; int i, *p;
......
...@@ -10,7 +10,7 @@ void* my_calloc (int s, int n) { ...@@ -10,7 +10,7 @@ void* my_calloc (int s, int n) {
return malloc (s*n); return malloc (s*n);
} }
volatile foo; volatile int foo;
void main () { void main () {
char *p1 = my_calloc (0, 0); char *p1 = my_calloc (0, 0);
......
...@@ -7,7 +7,7 @@ void f(int *p, int i) { ...@@ -7,7 +7,7 @@ void f(int *p, int i) {
*p = i; *p = i;
} }
volatile v; volatile int v;
void main() { void main() {
/*@ eva_allocate fresh; */ /*@ eva_allocate fresh; */
......
...@@ -24,7 +24,7 @@ void init () { ...@@ -24,7 +24,7 @@ void init () {
for (j=0;j<100;j++) dst5[j] = -1; for (j=0;j<100;j++) dst5[j] = -1;
} }
volatile maybe; volatile int maybe;
void buggy () { void buggy () {
char c; char c;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "string.h" #include "string.h"
volatile v; volatile int v;
int x; int x;
......
...@@ -137,7 +137,7 @@ void main9() { ...@@ -137,7 +137,7 @@ void main9() {
free (q); free (q);
} }
volatile v; volatile int v;
void f(int x) { void f(int x) {
Frama_C_show_each(x); Frama_C_show_each(x);
......
...@@ -9,7 +9,7 @@ float f; ...@@ -9,7 +9,7 @@ float f;
double d, big; double d, big;
unsigned long long ull; unsigned long long ull;
double fd(void); double fd(void);
volatile rand; volatile int rand;
void main1 (long long l){ void main1 (long long l){
u1.l = l; u1.l = l;
......
...@@ -41,7 +41,7 @@ void main(int c, char **v) ...@@ -41,7 +41,7 @@ void main(int c, char **v)
volatile v; volatile int v;
void main_log_exp(double d) { void main_log_exp(double d) {
double l1, l2, l3, l4, l5, l6, l7, l8; double l1, l2, l3, l4, l5, l6, l7, l8;
......
volatile v; volatile int v;
//@ requires c; assigns \nothing; //@ requires c; assigns \nothing;
void __assert(int c); void __assert(int c);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
float f; float f;
double d; double d;
volatile v; volatile int v;
// Conversion from binary integer representation to float // Conversion from binary integer representation to float
void main1() { void main1() {
......
volatile v; volatile int v;
void main() { void main() {
double d1, d2; double d1, d2;
......
/* run.config* /* run.config*
STDOPT: #"-kernel-warn-key parser:decimal-float=active -float-hex" STDOPT: #"-kernel-warn-key parser:decimal-float=active -float-hex"
*/ */
volatile v; volatile int v;
void main(void) void main(void)
{ {
float x; double d; float x; double d;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
STDOPT: #"-kernel-warn-key parser:decimal-float=active -float-hex -warn-special-float none" STDOPT: #"-kernel-warn-key parser:decimal-float=active -float-hex -warn-special-float none"
*/ */
volatile v; volatile int v;
volatile float any_float; volatile float any_float;
volatile double any_double; volatile double any_double;
......
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