diff --git a/rewriter/tests/recursion/CMakeLists.txt b/rewriter/tests/recursion/CMakeLists.txt index 3d166b471e..3d79ea7ee5 100644 --- a/rewriter/tests/recursion/CMakeLists.txt +++ b/rewriter/tests/recursion/CMakeLists.txt @@ -12,6 +12,7 @@ define_test( PKEY 1 NEEDS_LD_WRAP INCLUDE_DIR include/dso + CRITERION_TEST ) define_ia2_wrapper() diff --git a/rewriter/tests/recursion/dso.c b/rewriter/tests/recursion/dso.c index 62aace3c08..2241c05df4 100644 --- a/rewriter/tests/recursion/dso.c +++ b/rewriter/tests/recursion/dso.c @@ -2,6 +2,7 @@ RUN: cat recursion_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "recursion_main.h" +#include #include #include @@ -10,8 +11,8 @@ RUN: cat recursion_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s // LINKARGS: --wrap=recurse_dso void recurse_dso(int count) { - printf("recursion_dso: %d\n", count); - if (count > 0) { - recurse_main(count - 1); - } + cr_log_info("recursion_dso: %d\n", count); + if (count > 0) { + recurse_main(count - 1); + } } diff --git a/rewriter/tests/recursion/main.c b/rewriter/tests/recursion/main.c index 3f243be73b..555c057dc3 100644 --- a/rewriter/tests/recursion/main.c +++ b/rewriter/tests/recursion/main.c @@ -1,11 +1,12 @@ /* RUN: cat recursion_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s -RUN: %binary_dir/tests/recursion/recursion_main_wrapped | diff %S/Output/recursion.out - */ +#include "recursion_dso.h" +#include +#include #include #include -#include "recursion_dso.h" #define IA2_DEFINE_TEST_HANDLER #include "test_fault_handler.h" @@ -15,15 +16,12 @@ INIT_RUNTIME(2); // LINKARGS: --wrap=recurse_main void recurse_main(int count) { - printf("recursion_main: %d\n", count); - if (count > 0) { - recurse_dso(count - 1); - } + cr_log_info("recursion_main: %d\n", count); + if (count > 0) { + recurse_dso(count - 1); + } } -int main() { - recurse_main(5); - - // We fault in a destructor while exiting, TODO: #112 - expect_fault = true; +Test(recursion, main) { + recurse_main(5); }