Skip to content

Commit

Permalink
new test for external function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdalla committed Jun 18, 2024
1 parent b0cbb98 commit fc34447
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/tacle_test/programs/ext_func/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
gametime-project:
file:
location: ext_func.c
analysis-function: test
start-label: null
end-label: null


preprocess:
include: null
merge: null
inline: yes
unroll-loops: Yes

analysis:
maximum-error-scale-factor: 10
determinant-threshold: 0.001
max-infeasible-paths: 100
ilp-solver: glpk
gametime-path: ../../ # default path when tests locally
gametime-file-path: ../../../.. # default path when tests locally
32 changes: 32 additions & 0 deletions test/tacle_test/programs/ext_func/ext_func.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>

int main() {
int x = 5;
int y = 10;
char buffer[20];

printf("Before modification:\n");
printf("x = %d\n", x);
printf("y = %d\n", y);

// Convert integers to strings
sprintf(buffer, "%d", x);
// Append some digits to the string representation of x
strcat(buffer, "123");
// Convert back to integer
x = strtol(buffer, NULL, 10);

// Convert integers to strings
sprintf(buffer, "%d", y);
// Append some digits to the string representation of y
strcat(buffer, "456");
// Convert back to integer
y = strtol(buffer, NULL, 10);

printf("After modification:\n");
printf("x = %d\n", x);
printf("y = %d\n", y);

return 0;
}

0 comments on commit fc34447

Please sign in to comment.