Skip to content
Snippets Groups Projects
Commit 9c2bb85f authored by Alessandro Di Federico's avatar Alessandro Di Federico
Browse files

Introduce `printf` test using `%f`

This test will be useful to test that calls to external libraries using
float arguments work as appropriate.
parent 79013ee6
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ set(SRC ${CMAKE_SOURCE_DIR}/tests/Runtime)
set(TEST_CFLAGS "-std=c99 -static -fno-pic -fno-pie -g")
set(TEST_CFLAGS_IF_AVAILABLE "-no-pie")
set(TEST_CFLAGS_NATIVE "${TEST_CFLAGS} ${NO_PIE}")
set(TESTS "calc" "function_call" "floating_point" "syscall" "global")
set(TESTS "calc" "function_call" "floating_point" "syscall" "global" "printf")
## calc
set(TEST_SOURCES_calc "${SRC}/calc.c")
......@@ -39,6 +39,14 @@ set(TEST_ARGS_syscall_default "nope")
## global
set(TEST_SOURCES_global "${SRC}/global.c")
## printf
set(TEST_SOURCES_printf "${SRC}/printf.c")
set(TEST_RUNS_printf "one" "two" "threee")
set(TEST_ARGS_printf_one "one")
set(TEST_ARGS_printf_two "one two")
set(TEST_ARGS_printf_three "one two three")
set(TEST_RUNS_global "default")
set(TEST_ARGS_global_default "nope")
......
/*
* This file is distributed under the MIT License. See LICENSE.md for details.
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("%d %f %f\n", argc, (float) argc, (float) argc);
return EXIT_SUCCESS;
}
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