From f27b74a942c95959f1d2c6d8f6f4f554188ff7ad Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Fri, 6 Oct 2023 17:05:51 -0700 Subject: [PATCH] macro_attr --- rewriter/tests/macro_attr/CMakeLists.txt | 1 + rewriter/tests/macro_attr/functions.c | 14 +++++++------- rewriter/tests/macro_attr/main.c | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/rewriter/tests/macro_attr/CMakeLists.txt b/rewriter/tests/macro_attr/CMakeLists.txt index 603ba8e87d..668922de6c 100644 --- a/rewriter/tests/macro_attr/CMakeLists.txt +++ b/rewriter/tests/macro_attr/CMakeLists.txt @@ -7,6 +7,7 @@ define_shared_lib( define_test( SRCS main.c NEEDS_LD_WRAP + CRITERION_TEST ) # Build the wrapper lib diff --git a/rewriter/tests/macro_attr/functions.c b/rewriter/tests/macro_attr/functions.c index c7311601f0..ad84673b19 100644 --- a/rewriter/tests/macro_attr/functions.c +++ b/rewriter/tests/macro_attr/functions.c @@ -1,36 +1,36 @@ /* RUN: cat macro_attr_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ -#include +#include #include "functions.h" // LINKARGS: --wrap=f void f() { - printf("Called `f()`\n"); + cr_log_info("Called `f()`"); } // LINKARGS: --wrap=g void g() { - printf("Called `g()`\n"); + cr_log_info("Called `g()`"); } // TODO(src_rewriter_wip): this gets --wrap, but i don't think it should void h(CB cb) { - printf("Calling `cb(0)` from `h`\n"); + cr_log_info("Calling `cb(0)` from `h`"); cb(0); } // LINKARGS: --wrap=i void i() { - printf("Called `i()`\n"); + cr_log_info("Called `i()`"); } // LINKARGS: --wrap=j void j() { - printf("Called `j()`\n"); + cr_log_info("Called `j()`"); } // LINKARGS: --wrap=k void k() { - printf("Called `k()`\n"); + cr_log_info("Called `k()`"); } diff --git a/rewriter/tests/macro_attr/main.c b/rewriter/tests/macro_attr/main.c index d2e407d533..a23205163f 100644 --- a/rewriter/tests/macro_attr/main.c +++ b/rewriter/tests/macro_attr/main.c @@ -3,12 +3,13 @@ RUN: sh -c 'if [ ! -s "macro_attr_call_gates_0.ld" ]; then echo "No link args as */ #include "functions.h" #include +#include INIT_RUNTIME(1); #define IA2_COMPARTMENT 1 #include -int main() { +Test(macro_attr, main) { f(); g(); i();