Skip to content
Snippets Groups Projects
Commit 2eb83ffa authored by an7s's avatar an7s
Browse files

testing

Former-commit-id: fb284e77297be7952d379ff4e271224b03cb08de
parent 5bf2aaad
No related branches found
No related tags found
No related merge requests found
......@@ -304,6 +304,7 @@ libtransform/src/leapattern.cpp -text
libtransform/src/pointercheck64.cpp -text
libtransform/src/transform.cpp -text
libtransform/tests/Makefile -text
libtransform/tests/Makefile.pointers -text
libtransform/tests/austin/array.c -text
libtransform/tests/austin/branch.c -text
libtransform/tests/austin/malloc.c -text
......@@ -320,6 +321,7 @@ libtransform/tests/false_positives/ls.err -text
libtransform/tests/false_positives/ls.out -text
libtransform/tests/false_positives/ls.shared.orig -text
libtransform/tests/false_positives/ls.shared.orig.peasoup -text
libtransform/tests/idiom18.c -text
libtransform/tests/int16overflow.c -text
libtransform/tests/int32overflow.c -text
libtransform/tests/integer/addsuboverflow/Makefile -text
......
CC=DO_NOT_USE
CXX=DO_NOT_USE
CFLAGS=DO_NOT_USE
LD=DO_NOT_USE
.SUFFIXES: .o .c .cpp .exe
exes=idiom18.exe
all: env_check ${exes}
.PHONY: env_check
.o.exe:
gcc -g $< -o $@
# gcc -m32 $< -o $@
${PEASOUP_HOME}/tools/ps_analyze.sh $@ $@.peasoup --step ilr=off --step concolic=off --step p1transform=off --step isr=off --step integertransform=on --step-option integertransform:--instrument-idioms --step-option integertransform:--check-pointers --step twitchertransform=off
.c.o:
gcc -O2 -c $<
# gcc -c -m32 $<
.cpp.o:
${PEASOUP_HOME}/tools/ps_comp++.sh $<
env_check:
@echo checking env vars; \
if [ "X${TOOLCHAIN}" = "X" ]; then \
echo TOOLCHAIN environment variable should be set.; \
exit -1;\
elif [ "X${STRATA}" = "X" ]; then \
echo STRATA environment variable should be set. ;\
exit -1;\
elif [ "X${SMPSA_HOME}" = "X" ]; then \
echo SMPSA_HOME environment variable should be set.; \
exit -1;\
elif [ "X${PEASOUP_HOME}" = "X" ]; then \
echo PEASOUP_HOME environment variable should be set.; \
exit -1;\
elif [ "X${STRATA_HOME}" = "X" ]; then \
echo STRATA_HOME environment variable should be set.; \
exit -1;\
fi ;
clean:
rm -f *.o *.syms *.map
rm -f *.exe *.exe.peasoup *.dis *.data *.idb *.log *.ncexe *.readelf temp.* *.temp *.stratafied *.asm *.SMPobjdump *.id0 *.id1 *.til *.nam
rm -Rf concolic.files_*
rm -Rf peasoup_executable_directory.*
rm -f strata.log.*
rm -f *.sym
rm -f *.peasoup
rm -f *.tmp.* tmp.*
cleandb:
${PEASOUP_HOME}/tools/db/drop_my_tables.sh
${PEASOUP_HOME}/tools/db/pdb_setup.sh
concclean:
rm -Rf concolic.files_*
rm strata.log.*
#include <stdio.h>
#include <stdlib.h>
#define MAX_SIZE 100
struct foobar {
int x;
int y;
};
int foobar(struct foobar *myarray, struct foobar *(myarray2d[2][MAX_SIZE/2]))
{
int i, j;
int sum = 0;
for (i = 0; i < 2; ++i)
for (j = 0; j < MAX_SIZE/2; ++j)
{
(*myarray2d)[i][j] = myarray[i * 2 + j];
sum += myarray2d[i][j];
}
return sum;
}
int main(int argc, char **argv)
{
struct foobar myarray[MAX_SIZE];
struct foobar myarray2d[2][MAX_SIZE/2];
struct foobar* ptr = &myarray[0];
int i;
int j;
int z = 100;
if (argc > 1)
z = atoi(argv[1]);
for (i = 0; i < MAX_SIZE; i++)
{
ptr[i].x = i;
ptr[i].y = i+1;
}
for (i = 0; i < 2; ++i)
for (j = 0; j < z/2; ++j)
myarray2d[i][j] = ptr[i * 2 + j];
int x = foobar(&myarray, &myarray2d);
printf("x = %d\n", x);
return 0;
}
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