From 6a10043a9ec95caa1679fc9f256ef3295c7d5405 Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Tue, 24 Oct 2023 16:56:32 -0700 Subject: [PATCH 1/5] Remove lit comments --- rewriter/tests/ffmpeg/ffmpeg.test | 14 -------- .../tests/global_fn_ptr/include/operations.h | 2 -- rewriter/tests/global_fn_ptr/main.c | 5 --- rewriter/tests/global_fn_ptr/operations.c | 2 -- rewriter/tests/header_includes/impl.c | 2 -- rewriter/tests/header_includes/include/impl.h | 1 - rewriter/tests/header_includes/liboption.c | 3 -- rewriter/tests/header_includes/main.c | 1 - rewriter/tests/heap_two_keys/main.c | 1 - rewriter/tests/heap_two_keys/plugin.c | 6 ---- rewriter/tests/libusb/libusb.test | 4 --- rewriter/tests/macro_attr/functions.c | 6 ---- rewriter/tests/macro_attr/main.c | 1 - rewriter/tests/minimal/main.c | 4 --- rewriter/tests/minimal/minimal.c | 4 --- rewriter/tests/mmap_loop/include/mmap_loop.h | 2 -- rewriter/tests/mmap_loop/main.c | 1 - rewriter/tests/mmap_loop/mmap_loop.c | 3 -- rewriter/tests/omit_wrappers/library.h | 5 --- .../tests/permissive_mode/permissive_mode.c | 1 - rewriter/tests/protected_threads/library.c | 2 -- rewriter/tests/protected_threads/main.c | 1 - rewriter/tests/read_config/builtin.c | 6 ---- rewriter/tests/read_config/main.c | 9 ----- rewriter/tests/read_config/plugin.c | 10 ------ rewriter/tests/recursion/dso.c | 2 -- rewriter/tests/recursion/main.c | 2 -- rewriter/tests/rewrite_fn_ptr_eq/lib.c | 2 -- rewriter/tests/rewrite_fn_ptr_eq/main.c | 16 --------- rewriter/tests/rewrite_macros/lib.c | 3 -- rewriter/tests/rewrite_macros/main.c | 6 ---- rewriter/tests/ro_sharing/main.c | 1 - rewriter/tests/ro_sharing/plugin.c | 5 --- rewriter/tests/shared_data/access_shared.c | 3 -- rewriter/tests/shared_data/main.c | 1 - rewriter/tests/should_segfault/main.c | 1 - rewriter/tests/should_segfault/print_secret.c | 3 -- rewriter/tests/sighandler/lib.c | 2 -- rewriter/tests/sighandler/main.c | 1 - rewriter/tests/simple1/main.c | 10 ------ rewriter/tests/simple1/simple1.c | 6 ---- rewriter/tests/structs/include/structs.h | 34 ------------------ rewriter/tests/structs/main.c | 1 - rewriter/tests/structs/structs.c | 35 ------------------- rewriter/tests/threads/include/library.h | 6 ---- rewriter/tests/threads/library.c | 7 ---- rewriter/tests/threads/main.c | 1 - rewriter/tests/tls_protected/library.c | 3 -- rewriter/tests/tls_protected/main.c | 1 - rewriter/tests/trusted_direct/main.c | 2 -- rewriter/tests/trusted_direct/plugin.c | 2 -- rewriter/tests/trusted_indirect/main.c | 8 ----- rewriter/tests/trusted_indirect/rand_op.c | 6 ---- rewriter/tests/two_keys_minimal/main.c | 6 ---- rewriter/tests/two_keys_minimal/plugin.c | 5 --- rewriter/tests/two_shared_ranges/main.c | 5 --- rewriter/tests/two_shared_ranges/plugin.c | 5 --- rewriter/tests/untrusted_indirect/foo.c | 4 --- rewriter/tests/untrusted_indirect/main.c | 3 -- 59 files changed, 294 deletions(-) diff --git a/rewriter/tests/ffmpeg/ffmpeg.test b/rewriter/tests/ffmpeg/ffmpeg.test index 6058be20c..62580e0ec 100644 --- a/rewriter/tests/ffmpeg/ffmpeg.test +++ b/rewriter/tests/ffmpeg/ffmpeg.test @@ -1,24 +1,10 @@ # libavformat -RUN: sh -c "for hdr in avformat.h avio.h; do %ia2_generate_checks $(pkg-config --variable includedir libavformat)/libavformat/$hdr %S/include %T/$hdr; done" -RUN: ia2-rewriter --output-header %T/fn_ptr_ia2_avformat.h %T/wrapper.c %T/avformat.h %T/avio.h -- -I%resource_dir -I%ia2_include -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/avformat.h -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/avio.h # libavutil -RUN: sh -c "for hdr in dict.h version.h macros.h common.h attributes.h mem.h avutil.h rational.h mathematics.h intfloat.h error.h log.h pixfmt.h; do %ia2_generate_checks $(pkg-config --variable includedir libavutil)/libavutil/$hdr %S/include %T/$hdr; done" -RUN: ia2-rewriter --output-header %T/fn_ptr_ia2_avutil.h %T/wrapper.c %T/dict.h %T/version.h %T/macros.h %T/common.h %T/attributes.h %T/mem.h %T/avutil.h %T/rational.h %T/mathematics.h %T/intfloat.h %T/error.h %T/log.h %T/pixfmt.h -- -I%resource_dir -I%ia2_include -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/dict.h # version.h has only #defines, so it doesn't have anything we would CHECK # macros.h has only #defines, so it doesn't have anything we would CHECK -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/common.h # attributes.h has only #defines, so it doesn't have anything we would CHECK -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/mem.h -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/avutil.h -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/rational.h -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/mathematics.h # intfloat.h has only #defines and "static inline" functions, so it doesn't have anything we would CHECK for now -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/error.h -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/log.h # pixfmt.h has only #defines and enums, so it doesn't have anything we would CHECK diff --git a/rewriter/tests/global_fn_ptr/include/operations.h b/rewriter/tests/global_fn_ptr/include/operations.h index d2ae659f5..ae9f67636 100644 --- a/rewriter/tests/global_fn_ptr/include/operations.h +++ b/rewriter/tests/global_fn_ptr/include/operations.h @@ -1,12 +1,10 @@ /* -RUN: cat %t.c.args | FileCheck --check-prefix=LINKARGS %s */ #pragma once #include #include -// LINKARGS: --wrap=call_operations uint32_t call_operation(size_t i); // CHECK: typedef struct IA2_fnptr__ZTSPFjjjE WordFn; diff --git a/rewriter/tests/global_fn_ptr/main.c b/rewriter/tests/global_fn_ptr/main.c index 4cefe7767..4ddbdfab8 100644 --- a/rewriter/tests/global_fn_ptr/main.c +++ b/rewriter/tests/global_fn_ptr/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "global_fn_ptr_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include "operations.h" #include @@ -15,9 +14,7 @@ INIT_RUNTIME(1); // `sum` can't be set to __ia2_add since it's defined in asm so the compiler doesn't know it's a valid initializer //static WordFn sum = __ia2_add; -// REWRITER: static WordFn sum = IA2_FN(add); static WordFn sum = add; -// REWRITER: static HalfFn diff = IA2_FN(sub); static HalfFn diff = sub; // The following won't compile since the inner pointer is also type-specific //static HalfFn mul = {&__ia2_mul_0_1}; @@ -25,14 +22,12 @@ static HalfFn diff = sub; Op operations[2] IA2_SHARED_DATA = { { { "add", 4 }, - // REWRITER: IA2_FN(add), add, { "Adds two u32s", 14 }, 0, }, { { "mul", 4 }, - // REWRITER: IA2_FN(mul), mul, { "Multiply two u32s", 18 }, 0, diff --git a/rewriter/tests/global_fn_ptr/operations.c b/rewriter/tests/global_fn_ptr/operations.c index 5a05012dd..6fb99f091 100644 --- a/rewriter/tests/global_fn_ptr/operations.c +++ b/rewriter/tests/global_fn_ptr/operations.c @@ -1,5 +1,4 @@ /* -RUN: cat global_fn_ptr_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "operations.h" #include @@ -7,7 +6,6 @@ RUN: cat global_fn_ptr_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s extern Op operations[2]; -// LINKARGS: --wrap=call_operation uint32_t call_operation(size_t i) { // TODO: Add a way to share strings between compartments //printf("%s\n", operations[i].desc.data); diff --git a/rewriter/tests/header_includes/impl.c b/rewriter/tests/header_includes/impl.c index c6abe55e4..1c2c67b22 100644 --- a/rewriter/tests/header_includes/impl.c +++ b/rewriter/tests/header_includes/impl.c @@ -1,9 +1,7 @@ /* -RUN: cat header_includes_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "types.h" -// LINKARGS: --wrap=unwrap_or int unwrap_or(Option opt, int default_value) { if (opt.present) { return opt.value; diff --git a/rewriter/tests/header_includes/include/impl.h b/rewriter/tests/header_includes/include/impl.h index bca700436..741a99118 100644 --- a/rewriter/tests/header_includes/include/impl.h +++ b/rewriter/tests/header_includes/include/impl.h @@ -1,5 +1,4 @@ #pragma once #include "types.h" -// LINKARGS: --wrap=unwrap_or int unwrap_or(Option opt, int default_value); diff --git a/rewriter/tests/header_includes/liboption.c b/rewriter/tests/header_includes/liboption.c index 8e6e0df20..8fca999c9 100644 --- a/rewriter/tests/header_includes/liboption.c +++ b/rewriter/tests/header_includes/liboption.c @@ -1,11 +1,9 @@ /* -RUN: cat header_includes_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include "liboption.h" #include "types.h" -// LINKARGS: --wrap=None Option None() { cr_log_info("returning `None`"); Option none = { @@ -15,7 +13,6 @@ Option None() { return none; } -// LINKARGS: --wrap=Some Option Some(int x) { cr_log_info("returning `Some(%d)`", x); Option opt = { diff --git a/rewriter/tests/header_includes/main.c b/rewriter/tests/header_includes/main.c index 98fcd0214..3b2b970f5 100644 --- a/rewriter/tests/header_includes/main.c +++ b/rewriter/tests/header_includes/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "header_includes_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include "liboption.h" #include "types.h" diff --git a/rewriter/tests/heap_two_keys/main.c b/rewriter/tests/heap_two_keys/main.c index d007b998b..fd1665532 100644 --- a/rewriter/tests/heap_two_keys/main.c +++ b/rewriter/tests/heap_two_keys/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "heap_two_keys_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/heap_two_keys/plugin.c b/rewriter/tests/heap_two_keys/plugin.c index 29e67c4c8..f67b07b51 100644 --- a/rewriter/tests/heap_two_keys/plugin.c +++ b/rewriter/tests/heap_two_keys/plugin.c @@ -1,5 +1,4 @@ /* -RUN: cat heap_two_keys_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -9,7 +8,6 @@ RUN: cat heap_two_keys_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s #define IA2_COMPARTMENT 2 #include -// LINKARGS: --wrap=read_from_plugin uint8_t read_from_plugin(uint8_t *ptr) { if (ptr == NULL) { return -1; @@ -18,7 +16,6 @@ uint8_t read_from_plugin(uint8_t *ptr) { return read; } -// LINKARGS: --wrap=read_from_plugin_expect_fault uint8_t read_from_plugin_expect_fault(uint8_t *ptr) { if (ptr == NULL) { return -1; @@ -27,10 +24,8 @@ uint8_t read_from_plugin_expect_fault(uint8_t *ptr) { return read; } -// LINKARGS: --wrap=trigger_compartment_init void trigger_compartment_init(void) {} -// LINKARGS: --wrap=write_from_plugin void write_from_plugin(uint8_t *ptr, uint8_t value) { if (ptr == NULL) { return; @@ -38,7 +33,6 @@ void write_from_plugin(uint8_t *ptr, uint8_t value) { *ptr = value; } -// LINKARGS: --wrap=write_from_plugin_expect_fault void write_from_plugin_expect_fault(uint8_t *ptr, uint8_t value) { if (ptr == NULL) { return; diff --git a/rewriter/tests/libusb/libusb.test b/rewriter/tests/libusb/libusb.test index a86ce2b30..e69de29bb 100644 --- a/rewriter/tests/libusb/libusb.test +++ b/rewriter/tests/libusb/libusb.test @@ -1,4 +0,0 @@ -RUN: sh -c "%ia2_generate_checks $(pkg-config --variable includedir libusb-1.0)/libusb-1.0/libusb.h %S/include %T/libusb.h" -RUN: ia2-rewriter --output-header %T/fn_ptr_ia2.h %T/wrapper.c %T/libusb.h -- -I%resource_dir -I%ia2_include -RUN: cat %T/wrapper.c.args | FileCheck --check-prefix=LINKARGS %T/libusb.h -RUN: cat %T/libusb.h | sed 's/^.*CHECK.*$//' | FileCheck --check-prefix 'TYPEDEF-CHECK' %T/libusb.h diff --git a/rewriter/tests/macro_attr/functions.c b/rewriter/tests/macro_attr/functions.c index ad84673b1..e18da598e 100644 --- a/rewriter/tests/macro_attr/functions.c +++ b/rewriter/tests/macro_attr/functions.c @@ -1,15 +1,12 @@ /* -RUN: cat macro_attr_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include "functions.h" -// LINKARGS: --wrap=f void f() { cr_log_info("Called `f()`"); } -// LINKARGS: --wrap=g void g() { cr_log_info("Called `g()`"); } @@ -20,17 +17,14 @@ void h(CB cb) { cb(0); } -// LINKARGS: --wrap=i void i() { cr_log_info("Called `i()`"); } -// LINKARGS: --wrap=j void j() { cr_log_info("Called `j()`"); } -// LINKARGS: --wrap=k void k() { cr_log_info("Called `k()`"); } diff --git a/rewriter/tests/macro_attr/main.c b/rewriter/tests/macro_attr/main.c index a23205163..191c31189 100644 --- a/rewriter/tests/macro_attr/main.c +++ b/rewriter/tests/macro_attr/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "macro_attr_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include "functions.h" #include diff --git a/rewriter/tests/minimal/main.c b/rewriter/tests/minimal/main.c index c819e4016..3eea81856 100644 --- a/rewriter/tests/minimal/main.c +++ b/rewriter/tests/minimal/main.c @@ -1,11 +1,7 @@ /* -RUN: sh -c 'if [ ! -s "minimal_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' -RUN: readelf -lW %binary_dir/tests/minimal/minimal_main_wrapped | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include #include "minimal.h" diff --git a/rewriter/tests/minimal/minimal.c b/rewriter/tests/minimal/minimal.c index dca720e5f..26f2230db 100644 --- a/rewriter/tests/minimal/minimal.c +++ b/rewriter/tests/minimal/minimal.c @@ -1,21 +1,17 @@ /* -RUN: cat minimal_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "minimal.h" #include -// LINKARGS: --wrap=arg1 void arg1(int x) { cr_log_info("arg1"); } -// LINKARGS: --wrap=foo void foo() { cr_log_info("foo"); } -// LINKARGS: --wrap=return_val int return_val() { cr_log_info("return_val"); return 1; diff --git a/rewriter/tests/mmap_loop/include/mmap_loop.h b/rewriter/tests/mmap_loop/include/mmap_loop.h index 975775b76..1ab18f14a 100644 --- a/rewriter/tests/mmap_loop/include/mmap_loop.h +++ b/rewriter/tests/mmap_loop/include/mmap_loop.h @@ -1,8 +1,6 @@ #pragma once #include -// LINKARGS: --wrap=lib_mmap_buf char *lib_mmap_buf(size_t size); -// LINKARGS: --wrap=lib_malloc_buf char *lib_malloc_buf(size_t size); diff --git a/rewriter/tests/mmap_loop/main.c b/rewriter/tests/mmap_loop/main.c index 341a0ab8a..e95029d0e 100644 --- a/rewriter/tests/mmap_loop/main.c +++ b/rewriter/tests/mmap_loop/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "mmap_loop_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include "mmap_loop.h" #include diff --git a/rewriter/tests/mmap_loop/mmap_loop.c b/rewriter/tests/mmap_loop/mmap_loop.c index d6222d7cc..e9f2328ae 100644 --- a/rewriter/tests/mmap_loop/mmap_loop.c +++ b/rewriter/tests/mmap_loop/mmap_loop.c @@ -1,5 +1,4 @@ /* -RUN: cat mmap_loop_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "mmap_loop.h" @@ -11,14 +10,12 @@ RUN: cat mmap_loop_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s #define IA2_COMPARTMENT 2 #include -// LINKARGS: --wrap=lib_malloc_buf char *lib_malloc_buf(size_t size) { char *buf = malloc(size); memset(buf, 0, size); return buf; } -// LINKARGS: --wrap=lib_mmap_buf char *lib_mmap_buf(size_t size) { // mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); char *buf = mmap(NULL, size, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0); diff --git a/rewriter/tests/omit_wrappers/library.h b/rewriter/tests/omit_wrappers/library.h index 919e0cb18..1233c440f 100644 --- a/rewriter/tests/omit_wrappers/library.h +++ b/rewriter/tests/omit_wrappers/library.h @@ -1,7 +1,4 @@ /* -RUN: cp %s %t.h -RUN: ia2-rewriter --omit-wrappers %t.c %t.h -- -I%resource_dir -RUN: sh -c "[ ! -e %t.c.args ]" */ #pragma once @@ -16,11 +13,9 @@ typedef struct { } HoldsWordFn; // We aren't emitting wrappers, so this function should not get wrapped -// LINKARGS-NOT: --wrap=not_wrapped // CHECK: void not_wrapped(); void not_wrapped(); // This function shouldn't get removed or wrapped -// LINKARGS-NOT: --wrap=untouched_variadics // CHECK: void untouched_variadics(int a, ...); void untouched_variadics(int a, ...); diff --git a/rewriter/tests/permissive_mode/permissive_mode.c b/rewriter/tests/permissive_mode/permissive_mode.c index e93417329..9b2aa5fd1 100644 --- a/rewriter/tests/permissive_mode/permissive_mode.c +++ b/rewriter/tests/permissive_mode/permissive_mode.c @@ -1,5 +1,4 @@ /* -RUN: true */ // TODO remove the above when lit is removed. As of now a RUN line is required. diff --git a/rewriter/tests/protected_threads/library.c b/rewriter/tests/protected_threads/library.c index eba25fd63..1fcf69ff8 100644 --- a/rewriter/tests/protected_threads/library.c +++ b/rewriter/tests/protected_threads/library.c @@ -1,5 +1,4 @@ /* -RUN: cat protected_threads_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "library.h" #include @@ -9,5 +8,4 @@ RUN: cat protected_threads_call_gates_1.ld | FileCheck --check-prefix=LINKARGS % #define IA2_COMPARTMENT 2 #include -// LINKARGS: --wrap=lib_nop void lib_nop(void) {} diff --git a/rewriter/tests/protected_threads/main.c b/rewriter/tests/protected_threads/main.c index 6582ebb22..0f66a6c62 100644 --- a/rewriter/tests/protected_threads/main.c +++ b/rewriter/tests/protected_threads/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "protected_threads_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include "library.h" #include diff --git a/rewriter/tests/read_config/builtin.c b/rewriter/tests/read_config/builtin.c index bf0f96483..dab2a0478 100644 --- a/rewriter/tests/read_config/builtin.c +++ b/rewriter/tests/read_config/builtin.c @@ -1,5 +1,4 @@ /* -RUN: cat read_config_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -15,19 +14,16 @@ static struct cfg_opt opts[3] = { { "name", str, - // REWRITER: IA2_FN(parse_str), parse_str, }, { "num_options", u32, - // REWRITER: IA2_FN(parse_u32), parse_u32, }, { "array", other, - // REWRITER: IA2_FN(parse_array), parse_array, }, }; @@ -40,7 +36,6 @@ static void parse_array(char *opt, void *out) { // The arguments to the following functions point to the main binary so we don't // need to use a shared buffer -// LINKARGS: --wrap=get_builtin_opt struct cfg_opt *get_builtin_opt(char *name) { for (size_t i = 0; i < 3; i++) { if (!strcmp(opts[i].name, name)) { @@ -51,7 +46,6 @@ struct cfg_opt *get_builtin_opt(char *name) { exit(-1); } -// LINKARGS: --wrap=print_array void print_array(uint8_t ar[3]) { cr_log_info("[%x, %x, %x]", ar[0], ar[1], ar[2]); } diff --git a/rewriter/tests/read_config/main.c b/rewriter/tests/read_config/main.c index 030361c5f..392d4dac2 100644 --- a/rewriter/tests/read_config/main.c +++ b/rewriter/tests/read_config/main.c @@ -1,12 +1,7 @@ /* -RUN: cat read_config_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s -RUN: readelf -lW %binary_dir/tests/read_config/read_config_main_wrapped | FileCheck --check-prefix=SEGMENTS %s -RUN: cat main.c | FileCheck --match-full-lines --check-prefix=REWRITER %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include "plugin.h" #include #include @@ -51,19 +46,16 @@ name=builtin_config\n\ num_options=3\n\ array=\x11\x22\x33"; -// LINKARGS: --wrap=parse_bool void parse_bool(char *opt, void *out) { bool *res = out; *res = strcmp(opt, "false"); } -// LINKARGS: --wrap=parse_str void parse_str(char *opt, void *out) { char **res = out; strcpy(*res, opt); } -// LINKARGS: --wrap=parse_u32 void parse_u32(char *opt, void *out) { uint32_t *res = out; *res = strtol(opt, NULL, 10); @@ -123,7 +115,6 @@ Test(read_config, main) { // This function pointer may come from the plugin, so drop from pkey 1 to // pkey 0 before calling it. If the function is in the built-in module, // it'll have a wrapper from pkey 0 to pkey 1. - // REWRITER: IA2_CALL((opt->parse), 0)(delim + 1, &shared_entry.value); (opt->parse)(delim + 1, &shared_entry.value); // Copy the value from the shared entry to the main binary's stack. entries[idx].value = shared_entry.value; diff --git a/rewriter/tests/read_config/plugin.c b/rewriter/tests/read_config/plugin.c index a7ab90053..77cc36f8a 100644 --- a/rewriter/tests/read_config/plugin.c +++ b/rewriter/tests/read_config/plugin.c @@ -1,10 +1,7 @@ /* -RUN: readelf -lW %binary_dir/tests/read_config/libread_config_lib_wrapped.so | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include "plugin.h" #include "core.h" #include @@ -26,37 +23,31 @@ static struct cfg_opt opts[6] IA2_SHARED_DATA = { { "name", str, - // REWRITER: IA2_FN(parse_str), parse_str, }, { "num_options", u32, - // REWRITER: IA2_FN(parse_u32), parse_u32, }, { "debug_mode", boolean, - // REWRITER: IA2_FN(parse_bool), parse_bool, }, { "magic_val", other, - // REWRITER: IA2_FN(parse_tuple), parse_tuple, }, { "some_flag", boolean, - // REWRITER: IA2_FN(parse_bool), parse_bool, }, { "random_seed", u32, - // REWRITER: IA2_FN(parse_u32), parse_u32, }, }; @@ -83,7 +74,6 @@ struct cfg_opt *get_opt(char *name) { exit(-1); } -// LINKARGS: --wrap=print_tuple void print_tuple(struct tuple *tup) { // These derefs are fine since the heap is shared. cr_log_info("(%x, %x)", tup->first, tup->second); diff --git a/rewriter/tests/recursion/dso.c b/rewriter/tests/recursion/dso.c index 2241c05df..ff706f1a5 100644 --- a/rewriter/tests/recursion/dso.c +++ b/rewriter/tests/recursion/dso.c @@ -1,5 +1,4 @@ /* -RUN: cat recursion_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "recursion_main.h" #include @@ -9,7 +8,6 @@ RUN: cat recursion_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s #define IA2_COMPARTMENT 2 #include -// LINKARGS: --wrap=recurse_dso void recurse_dso(int count) { cr_log_info("recursion_dso: %d\n", count); if (count > 0) { diff --git a/rewriter/tests/recursion/main.c b/rewriter/tests/recursion/main.c index 555c057dc..d335f3a99 100644 --- a/rewriter/tests/recursion/main.c +++ b/rewriter/tests/recursion/main.c @@ -1,5 +1,4 @@ /* -RUN: cat recursion_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s */ #include "recursion_dso.h" @@ -14,7 +13,6 @@ INIT_RUNTIME(2); #define IA2_COMPARTMENT 1 #include -// LINKARGS: --wrap=recurse_main void recurse_main(int count) { cr_log_info("recursion_main: %d\n", count); if (count > 0) { diff --git a/rewriter/tests/rewrite_fn_ptr_eq/lib.c b/rewriter/tests/rewrite_fn_ptr_eq/lib.c index 2229abbe5..4ebeeaa49 100644 --- a/rewriter/tests/rewrite_fn_ptr_eq/lib.c +++ b/rewriter/tests/rewrite_fn_ptr_eq/lib.c @@ -1,5 +1,4 @@ /* -RUN: cat rewrite_fn_ptr_eq_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -8,7 +7,6 @@ RUN: cat rewrite_fn_ptr_eq_call_gates_1.ld | FileCheck --check-prefix=LINKARGS % #include #include -// LINKARGS: --wrap=call_fn int call_fn(bin_op fn, int x, int y) { cr_assert(fn != NULL); int res = fn(x, y); diff --git a/rewriter/tests/rewrite_fn_ptr_eq/main.c b/rewriter/tests/rewrite_fn_ptr_eq/main.c index f8fe55e22..3c2eb314f 100644 --- a/rewriter/tests/rewrite_fn_ptr_eq/main.c +++ b/rewriter/tests/rewrite_fn_ptr_eq/main.c @@ -1,5 +1,4 @@ /* -RUN: cat main.c | FileCheck --match-full-lines --check-prefix=REWRITER %S/main.c */ #include #include @@ -31,20 +30,14 @@ Test(rewrite_fn_ptr_eq, main) { bin_op fn2 = NULL; // Check that pointers for types other than functions are not rewritten - // REWRITER: if (y) { } if (y) { } - // REWRITER: if (x) { } if (x) { } - // REWRITER: if (!y) { } if (!y) { } - // REWRITER: if (!x) { } if (!x) { } - // REWRITER: if (IA2_ADDR(fn)) { if (fn) { call_fn(fn, 2, 1); } - // REWRITER: if (!IA2_ADDR(fn2)) { if (!fn2) { fn2 = sub; call_fn(fn2, 2, 1); @@ -56,26 +49,17 @@ Test(rewrite_fn_ptr_eq, main) { if (mod_ptr->fn) { } bin_op *ptr = &fn; - // REWRITER: if (IA2_ADDR(*ptr)) { } if (*ptr) { } - // REWRITER: if (NULL == IA2_ADDR(mod_ptr->fn)) { } if (NULL == mod_ptr->fn) { } - // REWRITER: if (IA2_ADDR(mod.fn) != NULL) { } if (mod.fn != NULL) { } - // REWRITER: if (IA2_ADDR(mod.fn) == IA2_ADDR(mod_ptr->fn)) { } if (mod.fn == mod_ptr->fn) { } - // REWRITER: if (IA2_ADDR(mod.fn) == IA2_FN_ADDR(add)) { } if (mod.fn == add) { } - // REWRITER: if (IA2_FN_ADDR(sub) == IA2_ADDR(mod_ptr->fn)) { } if (sub == mod_ptr->fn) { } - // REWRITER: if (x && IA2_ADDR(fn2)) { } if (x && fn2) { } - // REWRITER: if (y || !IA2_ADDR(fn)) { } if (y || !fn) { } - // REWRITER: if (x && IA2_ADDR(fn) && y) { } if (x && fn && y) { } } diff --git a/rewriter/tests/rewrite_macros/lib.c b/rewriter/tests/rewrite_macros/lib.c index d9d623333..7ffbccc89 100644 --- a/rewriter/tests/rewrite_macros/lib.c +++ b/rewriter/tests/rewrite_macros/lib.c @@ -1,5 +1,4 @@ /* -RUN: cat rewrite_macros_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "lib.h" #include @@ -15,7 +14,6 @@ struct event { int id; }; -// LINKARGS: --wrap=get_event struct event *get_event() { static struct event evt = { .id = 1 }; return &evt; @@ -26,7 +24,6 @@ static bool nop(struct event *evt) { } static void nop2(struct event *evt) { } -// LINKARGS: --wrap=init_actions void init_actions() { actions.add = nop; actions.del = nop; diff --git a/rewriter/tests/rewrite_macros/main.c b/rewriter/tests/rewrite_macros/main.c index 75ca0df85..c33e8c714 100644 --- a/rewriter/tests/rewrite_macros/main.c +++ b/rewriter/tests/rewrite_macros/main.c @@ -1,5 +1,4 @@ /* -RUN: cat main.c | FileCheck --match-full-lines --check-prefix=REWRITER %s */ #include "lib.h" #include @@ -20,20 +19,15 @@ Test(rewrite_macros, main) { struct event *evt = get_event(); // Test that the FnPtrCall pass can rewrite simple macros - // REWRITER: IA2_CALL(add_event, 0)(evt); add_event(evt); - // REWRITER: IA2_CALL(actions.add, 0)(evt); actions.add(evt); bool(*fn)(struct event *evt) = add_event; bool(*fn2)(struct event *evt) = actions.add; // Test that the FnPtrEq pass can rewrite simple macros - // REWRITER: if (IA2_ADDR(fn) == IA2_ADDR(add_event)) {} if (fn == add_event) {} - // REWRITER: if (IA2_ADDR(fn) == IA2_ADDR(actions.add)) {} if (fn == actions.add) {} - // REWRITER: IA2_CALL(fn, 0)(evt); fn(evt); } diff --git a/rewriter/tests/ro_sharing/main.c b/rewriter/tests/ro_sharing/main.c index 64722ad92..10c56886f 100644 --- a/rewriter/tests/ro_sharing/main.c +++ b/rewriter/tests/ro_sharing/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "ro_sharing_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/ro_sharing/plugin.c b/rewriter/tests/ro_sharing/plugin.c index f50ab959b..e3c12c8dc 100644 --- a/rewriter/tests/ro_sharing/plugin.c +++ b/rewriter/tests/ro_sharing/plugin.c @@ -1,5 +1,4 @@ /* -RUN: cat ro_sharing_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "test_fault_handler.h" #include @@ -21,12 +20,10 @@ const uint32_t plugin_shared_ro = 0x730283; // Global in .data uint32_t plugin_secret_rw = 0x8294671; -// LINKARGS: --wrap=get_plugin_str const char *get_plugin_str() { return plugin_str; } -// LINKARGS: --wrap=get_plugin_uint const uint32_t *get_plugin_uint(bool secret) { if (secret) return &plugin_secret_rw; @@ -34,13 +31,11 @@ const uint32_t *get_plugin_uint(bool secret) { return &plugin_shared_ro; } -// LINKARGS: --wrap=read_main_string void read_main_string(const char *str) { // Check that we can read a string passed from main cr_log_info("%s", str); } -// LINKARGS: --wrap=read_main_uint void read_main_uint(const uint32_t *shared, const uint32_t *secret) { // Check that we can read a pointer to rodata passed from main cr_log_info("0x%x", *shared); diff --git a/rewriter/tests/shared_data/access_shared.c b/rewriter/tests/shared_data/access_shared.c index 434732b08..358cb092f 100644 --- a/rewriter/tests/shared_data/access_shared.c +++ b/rewriter/tests/shared_data/access_shared.c @@ -1,17 +1,14 @@ /* -RUN: cat shared_data_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include "access_shared.h" #include -// LINKARGS: --wrap=read_shared uint8_t read_shared(uint8_t *shared) { cr_log_info("read %d from shared variable\n", *shared); return *shared; } -// LINKARGS: --wrap=write_shared uint8_t write_shared(uint8_t *shared, uint8_t new_value) { uint8_t old_value = *shared; cr_log_info("writing %d to shared variable\n", new_value); diff --git a/rewriter/tests/shared_data/main.c b/rewriter/tests/shared_data/main.c index 726791aff..207654bda 100644 --- a/rewriter/tests/shared_data/main.c +++ b/rewriter/tests/shared_data/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "shared_data_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/should_segfault/main.c b/rewriter/tests/should_segfault/main.c index 53f4c2ec4..4b8d05ef8 100644 --- a/rewriter/tests/should_segfault/main.c +++ b/rewriter/tests/should_segfault/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "should_segfault_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/should_segfault/print_secret.c b/rewriter/tests/should_segfault/print_secret.c index 2d506ccd1..8cd1d6ee1 100644 --- a/rewriter/tests/should_segfault/print_secret.c +++ b/rewriter/tests/should_segfault/print_secret.c @@ -1,5 +1,4 @@ /* -RUN: cat should_segfault_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -12,12 +11,10 @@ static bool early_fault = false; // Trigger a fault earlier than expected to test that CHECK_VIOLATION prints a // different message than in the mpk violation case. -// LINKARGS: --wrap=do_early_fault void do_early_fault() { early_fault = true; } -// LINKARGS: --wrap=print_secret void print_secret() { if (early_fault) { raise(SIGSEGV); diff --git a/rewriter/tests/sighandler/lib.c b/rewriter/tests/sighandler/lib.c index e4b02c68b..82453ddef 100644 --- a/rewriter/tests/sighandler/lib.c +++ b/rewriter/tests/sighandler/lib.c @@ -1,5 +1,4 @@ /* -RUN: cat sighandler_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "lib.h" @@ -26,7 +25,6 @@ void trap_handler_lib(int sig) { IA2_DEFINE_SIGHANDLER(trap_handler_lib, 2); -// LINKARGS: --wrap=test_handler_from_lib void test_handler_from_lib(void) { raise(SIGTRAP); } diff --git a/rewriter/tests/sighandler/main.c b/rewriter/tests/sighandler/main.c index 8773c4164..d42ecca85 100644 --- a/rewriter/tests/sighandler/main.c +++ b/rewriter/tests/sighandler/main.c @@ -1,5 +1,4 @@ /* -RUN: true */ #include "lib.h" #include diff --git a/rewriter/tests/simple1/main.c b/rewriter/tests/simple1/main.c index 5bc21c5a4..9e9d6edaf 100644 --- a/rewriter/tests/simple1/main.c +++ b/rewriter/tests/simple1/main.c @@ -1,6 +1,4 @@ /* -RUN: cat main.c | FileCheck --match-full-lines --check-prefix=REWRITER %s -RUN: cat simple1_call_gates_0.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -23,10 +21,8 @@ INIT_RUNTIME(1); // IA2_DEFINE_WRAPPER with target pkey 1, then use IA2_WRAPPER. static HookFn exit_hook_fn = NULL; -// LINKARGS: --wrap=get_exit_hook HookFn get_exit_hook(void) { return exit_hook_fn; } -// LINKARGS: --wrap=set_exit_hook void set_exit_hook(HookFn new_exit_hook_fn) { exit_hook_fn = new_exit_hook_fn; } // Secret values: a secret string and decryption value. @@ -52,9 +48,7 @@ Test(simple1, main) { // These will be called from untrusted code but may access trusted compartment // 0 struct SimpleCallbacks scb = { - // REWRITER: .read_cb = IA2_FN(main_read), .read_cb = main_read, - // REWRITER: .write_cb = IA2_FN(main_write), .write_cb = main_write, }; @@ -66,23 +60,19 @@ Test(simple1, main) { srand(time(NULL)); // These will be called from untrusted code but may access trusted compartment // 0 - // REWRITER: simple_foreach_v1(s, IA2_FN(main_map)); simple_foreach_v1(s, main_map); simple_reset(s); - // REWRITER: simple_foreach_v2(s, IA2_FN(main_map)); simple_foreach_v2(s, main_map); simple_destroy(s); // We need to check if exit_hook_fn is NULL since IA2_CALL always // returns a non-null pointer. Since it's an opaque pointer, we use this macro // instead of directly comparing with NULL. - // REWRITER: if (!IA2_ADDR(exit_hook_fn)) { if (!exit_hook_fn) { // Creates a wrapper that assumes the caller has pkey 0 and the callee is // untrusted since libsimple1 sets the value of exit_hook_fn. If // exit_hook_fn were to point to a function defined in this binary, it must // be a wrapped function with an untrusted caller and callee with pkey 0. - // REWRITER: IA2_CALL(exit_hook_fn, 0)(); exit_hook_fn(); } } diff --git a/rewriter/tests/simple1/simple1.c b/rewriter/tests/simple1/simple1.c index 155f57282..b7aa29288 100644 --- a/rewriter/tests/simple1/simple1.c +++ b/rewriter/tests/simple1/simple1.c @@ -1,6 +1,5 @@ /* Source rewriter pass is a noop for PKEY=0. -RUN: cat simple1_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -19,10 +18,8 @@ struct Simple { int state; }; -// LINKARGS: --wrap=simple_destroy void simple_destroy(struct Simple *s) { free(s); } -// LINKARGS: --wrap=simple_foreach_v1 void simple_foreach_v1(struct Simple *s, int (*map_fn)(int)) { for (;;) { int value = s->scb.read_cb(s->state); @@ -37,12 +34,10 @@ void simple_foreach_v1(struct Simple *s, int (*map_fn)(int)) { } } -// LINKARGS: --wrap=simple_foreach_v2 void simple_foreach_v2(struct Simple *s, SimpleMapFn map_fn) { simple_foreach_v1(s, map_fn); } -// LINKARGS: --wrap=simple_new struct Simple *simple_new(struct SimpleCallbacks scb) { if (!did_set_exit_hook) { set_exit_hook(simple_exit_hook); @@ -61,5 +56,4 @@ struct Simple *simple_new(struct SimpleCallbacks scb) { return s; } -// LINKARGS: --wrap=simple_reset void simple_reset(struct Simple *s) { s->state = 0; } diff --git a/rewriter/tests/structs/include/structs.h b/rewriter/tests/structs/include/structs.h index 9459c568a..cc804fec1 100644 --- a/rewriter/tests/structs/include/structs.h +++ b/rewriter/tests/structs/include/structs.h @@ -121,104 +121,70 @@ struct s14 { unsigned int field8; }; -// LINKARGS: --wrap=get_s1 struct s1 get_s1(void); -// LINKARGS: --wrap=cksum_s1 int cksum_s1(struct s1); -// LINKARGS: --wrap=get_s2 struct s2 get_s2(void); -// LINKARGS: --wrap=extract_s2 float extract_s2(struct s2); -// LINKARGS: --wrap=get_s3 struct s3 get_s3(void); -// LINKARGS: --wrap=cksum_s3 int cksum_s3(struct s3); -// LINKARGS: --wrap=inc_s3 struct s3 inc_s3(struct s3); -// LINKARGS: --wrap=get_s4 struct s4 get_s4(void); -// LINKARGS: --wrap=cksum_s4 float cksum_s4(struct s4); -// LINKARGS: --wrap=get_s5 struct s5 get_s5(void); -// LINKARGS: --wrap=get_s5_int struct s5 get_s5_int(int); -// LINKARGS: --wrap=check_s5 void check_s5(struct s5 ); -// LINKARGS: --wrap=cksum_s5_f float cksum_s5_f(struct s5); -// LINKARGS: --wrap=cksum_s5_z size_t cksum_s5_z(struct s5); -// LINKARGS: --wrap=get_s6 struct s6 get_s6(void); -// LINKARGS: --wrap=cksum_s6 size_t cksum_s6(struct s6); -// LINKARGS: --wrap=inc_s6 struct s6 inc_s6(struct s6); -// LINKARGS: --wrap=mix_s6 struct s6 mix_s6(struct s6 s1, struct s6 s2); -// LINKARGS: --wrap=get_s7 struct s7 get_s7(void); -// LINKARGS: --wrap=cksum_s7 unsigned int cksum_s7(struct s7); -// LINKARGS: --wrap=get_s8 struct s8 get_s8(void); -// LINKARGS: --wrap=cksum_s8 size_t cksum_s8(struct s8); -// LINKARGS: --wrap=get_s9 struct s9 get_s9(void); -// LINKARGS: --wrap=cksum_s9 __int128 cksum_s9(struct s9); -// LINKARGS: --wrap=get_s10 struct s10 get_s10(void); -// LINKARGS: --wrap=cksum_s10 __int128 cksum_s10(struct s10); -// LINKARGS: --wrap=get_s11 struct s11 get_s11(void); -// LINKARGS: --wrap=cksum_s11 unsigned int cksum_s11(struct s11); -// LINKARGS: --wrap=get_s12 struct s12 get_s12(void); -// LINKARGS: --wrap=cksum_s12 unsigned int cksum_s12(struct s12); -// LINKARGS: --wrap=get_s13 struct s13 get_s13(void); -// LINKARGS: --wrap=cksum_s13 unsigned int cksum_s13(struct s13); -// LINKARGS: --wrap=get_s14 struct s14 get_s14(void); -// LINKARGS: --wrap=cksum_s14 unsigned int cksum_s14(struct s14); diff --git a/rewriter/tests/structs/main.c b/rewriter/tests/structs/main.c index ba85a5a7c..ce4f96cfa 100644 --- a/rewriter/tests/structs/main.c +++ b/rewriter/tests/structs/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "structs_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/structs/structs.c b/rewriter/tests/structs/structs.c index 3f33df73c..25e75dbce 100644 --- a/rewriter/tests/structs/structs.c +++ b/rewriter/tests/structs/structs.c @@ -1,11 +1,9 @@ /* -RUN: cat structs_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include "structs.h" #include #include -// LINKARGS: --wrap=check_s5 void check_s5(struct s5 s) { cr_assert_eq(s.i1, 6976); cr_assert_eq(s.p1, (void*)0xb17ebee7); @@ -16,17 +14,14 @@ void check_s5(struct s5 s) { cr_assert_lt(fabs(s.f1 - 390.5600f), 0.0001f); } -// LINKARGS: --wrap=cksum_s1 int cksum_s1(struct s1 s) { return s.i1 + s.i2; } -// LINKARGS: --wrap=cksum_s10 __int128 cksum_s10(struct s10 s) { return s.i1 + s.i2 + s.i3 + s.z1; } -// LINKARGS: --wrap=cksum_s11 unsigned int cksum_s11(struct s11 s) { return 9 * s.az1[0] + 8 * s.az1[1] @@ -39,7 +34,6 @@ unsigned int cksum_s11(struct s11 s) { + 1 * s.az1[8]; } -// LINKARGS: --wrap=cksum_s12 unsigned int cksum_s12(struct s12 s) { return 9 * s.ac1[0] + 8 * s.ac1[1] @@ -52,7 +46,6 @@ unsigned int cksum_s12(struct s12 s) { + 1 * s.ac1[8]; } -// LINKARGS: --wrap=cksum_s13 unsigned int cksum_s13(struct s13 s) { unsigned int x0 = s.x & 0xffffffff; unsigned int x1 = (s.x >> 32) & 0xffffffff; @@ -61,57 +54,46 @@ unsigned int cksum_s13(struct s13 s) { return x0 + x1 + x2 + x3; } -// LINKARGS: --wrap=cksum_s14 unsigned int cksum_s14(struct s14 s) { return s.u1 + s.u32 + s.field2 + s.field3 + s.field7; } -// LINKARGS: --wrap=cksum_s3 int cksum_s3(struct s3 s) { return s.i1 + s.c1 + s.u1; } -// LINKARGS: --wrap=cksum_s4 float cksum_s4(struct s4 s) { return s.f1 + s.f2; } -// LINKARGS: --wrap=cksum_s5 float cksum_s5_f(struct s5 s) { return s.f1; } -// LINKARGS: --wrap=cksum_s5 size_t cksum_s5_z(struct s5 s) { return s.i1 + (size_t)s.p1 + s.ac1[0] + s.ac1[1] + s.ac1[2] + (size_t)s.p2; } -// LINKARGS: --wrap=cksum_s6 size_t cksum_s6(struct s6 s) { return s.i1 + s.c1 + s.i2 + s.c2 + s.z1; } -// LINKARGS: --wrap=cksum_s7 unsigned int cksum_s7(struct s7 s) { return s.b1 + s.c1 + s.u1; } -// LINKARGS: --wrap=cksum_s8 size_t cksum_s8(struct s8 s) { return s.b1 + s.c1 + s.z1 + s.c2 + s.z2 + s.z3; } -// LINKARGS: --wrap=cksum_s9 __int128 cksum_s9(struct s9 s) { return s.i1 + s.i2 + s.i3; } -// LINKARGS: --wrap=extract_s2 float extract_s2(struct s2 s) { return s.f1; } -// LINKARGS: --wrap=get_s1 struct s1 get_s1(void) { struct s1 s = { 3, @@ -120,7 +102,6 @@ struct s1 get_s1(void) { return s; } -// LINKARGS: --wrap=get_s10 struct s10 get_s10(void) { struct s10 s = { .i1 = 96506328, @@ -131,7 +112,6 @@ struct s10 get_s10(void) { return s; } -// LINKARGS: --wrap=get_s11 struct s11 get_s11(void) { struct s11 s = { .az1 = {1, 2, 3, 4, 5, 6, 7, 8, 9}, @@ -139,7 +119,6 @@ struct s11 get_s11(void) { return s; } -// LINKARGS: --wrap=get_s12 struct s12 get_s12(void) { struct s12 s = { .ac1 = {1, 2, 3, 4, 5, 6, 7, 8, 9}, @@ -147,7 +126,6 @@ struct s12 get_s12(void) { return s; } -// LINKARGS: --wrap=get_s13 struct s13 get_s13(void) { struct s13 s = { .x = 0x7fffeeeeddddcccc @@ -157,7 +135,6 @@ struct s13 get_s13(void) { return s; } -// LINKARGS: --wrap=get_s14 struct s14 get_s14(void) { struct s14 s = { 0, @@ -203,7 +180,6 @@ struct s14 get_s14(void) { return s; } -// LINKARGS: --wrap=get_s2 struct s2 get_s2(void) { struct s2 s = { 3.14, @@ -211,7 +187,6 @@ struct s2 get_s2(void) { return s; } -// LINKARGS: --wrap=get_s3 struct s3 get_s3(void) { struct s3 s = { .i1 = 50, @@ -221,7 +196,6 @@ struct s3 get_s3(void) { return s; } -// LINKARGS: --wrap=get_s4 struct s4 get_s4(void) { struct s4 s = { .f1 = 3.14, @@ -230,7 +204,6 @@ struct s4 get_s4(void) { return s; } -// LINKARGS: --wrap=get_s5 struct s5 get_s5(void) { struct s5 s = { .i1 = 31, @@ -242,7 +215,6 @@ struct s5 get_s5(void) { return s; } -// LINKARGS: --wrap=get_s5_int struct s5 get_s5_int(int i1) { struct s5 s = { .i1 = i1, @@ -254,7 +226,6 @@ struct s5 get_s5_int(int i1) { return s; } -// LINKARGS: --wrap=get_s6 struct s6 get_s6(void) { struct s6 s = { .i1 = 8043, @@ -266,7 +237,6 @@ struct s6 get_s6(void) { return s; } -// LINKARGS: --wrap=get_s7 struct s7 get_s7(void) { struct s7 s = { .b1 = true, @@ -276,7 +246,6 @@ struct s7 get_s7(void) { return s; } -// LINKARGS: --wrap=get_s8 struct s8 get_s8(void) { struct s8 s = { .b1 = true, @@ -289,7 +258,6 @@ struct s8 get_s8(void) { return s; } -// LINKARGS: --wrap=get_s9 struct s9 get_s9(void) { struct s9 s = { .i1 = 96506328, @@ -299,7 +267,6 @@ struct s9 get_s9(void) { return s; } -// LINKARGS: --wrap=inc_s3 struct s3 inc_s3(struct s3 s) { s.i1++; s.c1++; @@ -307,7 +274,6 @@ struct s3 inc_s3(struct s3 s) { return s; } -// LINKARGS: --wrap=inc_s6 struct s6 inc_s6(struct s6 s) { s.i1++; s.c1++; @@ -317,7 +283,6 @@ struct s6 inc_s6(struct s6 s) { return s; } -// LINKARGS: --wrap=mix_s6 struct s6 mix_s6(struct s6 s1, struct s6 s2) { s1.i1 += s2.i1 / 2; s1.c1 += s2.c1 / 2; diff --git a/rewriter/tests/threads/include/library.h b/rewriter/tests/threads/include/library.h index 179ef4442..0e608e4aa 100644 --- a/rewriter/tests/threads/include/library.h +++ b/rewriter/tests/threads/include/library.h @@ -7,21 +7,15 @@ typedef void (*Fn)(void); // This function does nothing, but should get wrapped -// LINKARGS: --wrap=library_foo void library_foo(); -// LINKARGS: --wrap=library_spawn_thread pthread_t library_spawn_thread(void); -// LINKARGS: --wrap=library_showpkru void library_showpkru(void); // effectively just memset, but from within the compartment -// LINKARGS: --wrap=library_memset void library_memset(void *ptr, uint8_t byte, size_t n); -// LINKARGS: --wrap=library_call_fn void library_call_fn(Fn what); -// LINKARGS: --wrap=library_access_int_ptr int library_access_int_ptr(int *ptr); diff --git a/rewriter/tests/threads/library.c b/rewriter/tests/threads/library.c index f74ad0b0b..fdf7025bf 100644 --- a/rewriter/tests/threads/library.c +++ b/rewriter/tests/threads/library.c @@ -1,5 +1,4 @@ /* -RUN: cat threads_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -10,23 +9,19 @@ RUN: cat threads_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s int data_in_lib = 900; -// LINKARGS: --wrap=library_access_int_ptr int library_access_int_ptr(int *ptr) { return *ptr; } -// LINKARGS: --wrap=library_call_fn void library_call_fn(Fn what) { cr_log_info("in lib, about to call fnptr; lib data: %d\n", data_in_lib); cr_assert_eq(data_in_lib, 900); what(); } -// LINKARGS: --wrap=library_foo void library_foo() { cr_log_info("data in library: %d\n", data_in_lib); cr_assert_eq(data_in_lib, 900); } -// LINKARGS: --wrap=library_memset void library_memset(void *ptr, uint8_t byte, size_t n) { char *char_ptr = (char *)ptr; for (size_t i = 0; i < n; i++) { @@ -34,7 +29,6 @@ void library_memset(void *ptr, uint8_t byte, size_t n) { } } -// LINKARGS: --wrap=library_showpkru void library_showpkru() { uint32_t actual_pkru = ia2_get_pkru(); cr_log_info("library pkru %08x", actual_pkru); @@ -46,7 +40,6 @@ static void *library_showpkru_thread_main(void *unused) { return NULL; } -// LINKARGS: --wrap=library_spawn_thread pthread_t library_spawn_thread(void) { pthread_t thread; int ret = pthread_create(&thread, NULL, library_showpkru_thread_main, NULL); diff --git a/rewriter/tests/threads/main.c b/rewriter/tests/threads/main.c index cfbc8c6c2..0d49f06ed 100644 --- a/rewriter/tests/threads/main.c +++ b/rewriter/tests/threads/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "threads_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include diff --git a/rewriter/tests/tls_protected/library.c b/rewriter/tests/tls_protected/library.c index 96bab6b86..ff619f756 100644 --- a/rewriter/tests/tls_protected/library.c +++ b/rewriter/tests/tls_protected/library.c @@ -1,10 +1,7 @@ /* -RUN: readelf -lW %binary_dir/tests/tls_protected/libtls_protected_lib_wrapped.so | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include "library.h" #include "test_fault_handler.h" #include diff --git a/rewriter/tests/tls_protected/main.c b/rewriter/tests/tls_protected/main.c index 30129b5f6..9ef4d2dfe 100644 --- a/rewriter/tests/tls_protected/main.c +++ b/rewriter/tests/tls_protected/main.c @@ -1,5 +1,4 @@ /* -RUN: true */ #include diff --git a/rewriter/tests/trusted_direct/main.c b/rewriter/tests/trusted_direct/main.c index 45823ecfb..9c686a8c4 100644 --- a/rewriter/tests/trusted_direct/main.c +++ b/rewriter/tests/trusted_direct/main.c @@ -1,5 +1,4 @@ /* -RUN: cat trusted_direct_call_gates_0.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -24,7 +23,6 @@ uint32_t secret = 0x09431233; bool clean_exit IA2_SHARED_DATA = false; -//LINKARGS: --wrap=print_message void print_message(void) { cr_log_info("%s: the secret 0x%" PRIx32 " is defined in the main binary\n", __func__, secret); cr_assert(secret == 0x09431233); diff --git a/rewriter/tests/trusted_direct/plugin.c b/rewriter/tests/trusted_direct/plugin.c index ce0b7b239..13291a6b2 100644 --- a/rewriter/tests/trusted_direct/plugin.c +++ b/rewriter/tests/trusted_direct/plugin.c @@ -1,12 +1,10 @@ /* -RUN: cat trusted_direct_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include #include "exported_fn.h" #include "test_fault_handler.h" -// LINKARGS: --wrap=start_plugin void start_plugin(void) { cr_log_info("%s: this is defined in the plugin\n", __func__); print_message(); diff --git a/rewriter/tests/trusted_indirect/main.c b/rewriter/tests/trusted_indirect/main.c index 953711f25..00f2319ec 100644 --- a/rewriter/tests/trusted_indirect/main.c +++ b/rewriter/tests/trusted_indirect/main.c @@ -1,6 +1,4 @@ /* -RUN: cat main.c | FileCheck --match-full-lines --check-prefix=REWRITER %s -RUN: sh -c 'if [ ! -s "trusted_indirect_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include @@ -36,16 +34,11 @@ void call_fn_ptr() { uint32_t x = 987234; uint32_t y = 142151; // This calls `f.op` with and without parentheses to ensure the rewriter handles both - // REWRITER: uint32_t res1 = IA2_CALL(f.op, 0)(x, y); uint32_t res1 = f.op(x, y); - // REWRITER: f.op = IA2_FN(multiply); f.op = multiply; - // REWRITER: uint32_t res2 = IA2_CALL((f.op), 0)(x, y); uint32_t res2 = (f.op)(x, y); cr_assert_eq(res2, 2897346862); - // REWRITER: f.op = IA2_FN(divide); f.op = divide; - // REWRITER: uint32_t res3 = IA2_CALL(f.op, 0)(x, y); uint32_t res3 = f.op(x, y); cr_assert_eq(res3, 6); } @@ -63,7 +56,6 @@ void do_test() { static uint32_t secret = 34; leak_secret_address(&secret); - // REWRITER: IA2_CALL((f.op), 0)(0, 0); (f.op)(0, 0); } diff --git a/rewriter/tests/trusted_indirect/rand_op.c b/rewriter/tests/trusted_indirect/rand_op.c index 7f5b5d7d1..62a5835c3 100644 --- a/rewriter/tests/trusted_indirect/rand_op.c +++ b/rewriter/tests/trusted_indirect/rand_op.c @@ -1,5 +1,4 @@ /* -RUN: cat trusted_indirect_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include @@ -31,7 +30,6 @@ static uint32_t steal_secret(uint32_t x, uint32_t y) { return 0; } -// LINKARGS: --wrap=get_bad_function function_t get_bad_function(void) { function_t f = (function_t){ .name = "", @@ -40,7 +38,6 @@ function_t get_bad_function(void) { return f; } -// LINKARGS: --wrap=get_function function_t get_function(void) { function_t f; if (fn_is_add) { @@ -53,17 +50,14 @@ function_t get_function(void) { return f; } -// LINKARGS: --wrap=leak_secret_address void leak_secret_address(uint32_t *addr) { secret_address = addr; } -// LINKARGS: --wrap=sub uint32_t sub(uint32_t x, uint32_t y) { return x - y; } -// LINKARGS: --wrap=swap_function void swap_function(void) { fn_is_add = !fn_is_add; } diff --git a/rewriter/tests/two_keys_minimal/main.c b/rewriter/tests/two_keys_minimal/main.c index 514526819..7038942bb 100644 --- a/rewriter/tests/two_keys_minimal/main.c +++ b/rewriter/tests/two_keys_minimal/main.c @@ -1,12 +1,7 @@ /* -RUN: sh -c 'if [ ! -s "should_segfault_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' -RUN: cat two_keys_minimal_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s -RUN: readelf -lW %binary_dir/tests/two_keys_minimal/two_keys_minimal_main_wrapped | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include #include @@ -32,7 +27,6 @@ bool debug_mode IA2_SHARED_DATA = false; bool clean_exit IA2_SHARED_DATA = false; -// LINKARGS: --wrap=print_message void print_message(void) { cr_log_info("this is defined in the main binary"); if (debug_mode) { diff --git a/rewriter/tests/two_keys_minimal/plugin.c b/rewriter/tests/two_keys_minimal/plugin.c index 94735fc5a..120c0658c 100644 --- a/rewriter/tests/two_keys_minimal/plugin.c +++ b/rewriter/tests/two_keys_minimal/plugin.c @@ -1,11 +1,7 @@ /* -RUN: cat two_keys_minimal_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s -RUN: readelf -lW %binary_dir/tests/two_keys_minimal/libtwo_keys_minimal_lib_wrapped.so | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include #include @@ -21,7 +17,6 @@ uint32_t plugin_secret = 0x78341244; extern bool clean_exit; -// LINKARGS: --wrap=start_plugin void start_plugin(void) { cr_log_info("this is defined in the plugin"); if (debug_mode) { diff --git a/rewriter/tests/two_shared_ranges/main.c b/rewriter/tests/two_shared_ranges/main.c index 1d551c8a1..984be2271 100644 --- a/rewriter/tests/two_shared_ranges/main.c +++ b/rewriter/tests/two_shared_ranges/main.c @@ -1,11 +1,7 @@ /* -RUN: cat two_shared_ranges_call_gates_2.ld | FileCheck --check-prefix=LINKARGS %s -RUN: readelf -lW %binary_dir/tests/two_shared_ranges/two_shared_ranges_main_wrapped | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include #include @@ -27,7 +23,6 @@ static bool steal_plugin_secret = false; bool clean_exit IA2_SHARED_DATA = false; -// LINKARGS: --wrap=print_message void print_message(void) { cr_log_info("this is defined in the main binary"); cr_log_info("the main secret is at %p", &secret); diff --git a/rewriter/tests/two_shared_ranges/plugin.c b/rewriter/tests/two_shared_ranges/plugin.c index 8f61aea98..38a302129 100644 --- a/rewriter/tests/two_shared_ranges/plugin.c +++ b/rewriter/tests/two_shared_ranges/plugin.c @@ -1,11 +1,7 @@ /* -RUN: cat two_shared_ranges_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s -RUN: readelf -lW %binary_dir/tests/two_shared_ranges/libtwo_shared_ranges_lib_wrapped.so | FileCheck --check-prefix=SEGMENTS %s */ // Check that readelf shows exactly one executable segment -// SEGMENTS-COUNT-1: LOAD{{.*}}R E -// SEGMENTS-NOT: LOAD{{.*}}R E #include #include @@ -20,7 +16,6 @@ uint32_t plugin_shared IA2_SHARED_DATA = 0x415ea635; extern bool clean_exit; -// LINKARGS: --wrap=start_plugin void start_plugin(void) { cr_log_info("this is defined in the plugin"); cr_log_info("the plugin secret is at %p", &plugin_secret); diff --git a/rewriter/tests/untrusted_indirect/foo.c b/rewriter/tests/untrusted_indirect/foo.c index 2441cb56a..540dd9327 100644 --- a/rewriter/tests/untrusted_indirect/foo.c +++ b/rewriter/tests/untrusted_indirect/foo.c @@ -1,5 +1,4 @@ /* -RUN: cat untrusted_indirect_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s */ #include #include @@ -16,14 +15,12 @@ uint64_t pick_lhs(uint64_t x, uint64_t y) { static callback_t function = pick_lhs; static uint64_t last_result = 0; -// LINKARGS: --wrap=apply_callback // Applies a binary operation to the args using either a registered callback or an internal default function. uint64_t apply_callback(uint64_t x, uint64_t y) { last_result = function(x, y); return last_result; } -// LINKARGS: --wrap=register_callback bool register_callback(callback_t cb) { if (!cb) { return false; @@ -32,7 +29,6 @@ bool register_callback(callback_t cb) { return true; } -// LINKARGS: --wrap=unregister_callback void unregister_callback() { function = pick_lhs; if (last_result) { diff --git a/rewriter/tests/untrusted_indirect/main.c b/rewriter/tests/untrusted_indirect/main.c index 950b03e59..b8b205925 100644 --- a/rewriter/tests/untrusted_indirect/main.c +++ b/rewriter/tests/untrusted_indirect/main.c @@ -1,5 +1,4 @@ /* -RUN: sh -c 'if [ ! -s "untrusted_indirect_call_gates_0.ld" ]; then echo "No link args as expected"; exit 0; fi; echo "Unexpected link args"; exit 1;' */ #include #include @@ -61,11 +60,9 @@ void do_test() { cr_log_info("TRUSTED: the secret is 0x%lx\n", secret); cr_log_info("0x%lx\n", apply_callback(1, 2)); - // REWRITER: register_callback(IA2_FN(pick_rhs)); register_callback(pick_rhs); cr_log_info("0x%lx\n", apply_callback(3, 4)); - // REWRITER: register_callback(IA2_FN(leak_secret_address)); register_callback(leak_secret_address); cr_log_info("TRUSTED: oops we leaked the address of the secret\n"); apply_callback(5, 6); From 72a11a576480cc2b65c5ff926b31f4280f0bb242 Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Tue, 24 Oct 2023 15:18:06 -0700 Subject: [PATCH 2/5] Remove empty comments --- rewriter/tests/global_fn_ptr/include/operations.h | 2 -- rewriter/tests/global_fn_ptr/main.c | 2 -- rewriter/tests/global_fn_ptr/operations.c | 2 -- rewriter/tests/header_includes/impl.c | 2 -- rewriter/tests/header_includes/liboption.c | 2 -- rewriter/tests/header_includes/main.c | 2 -- rewriter/tests/heap_two_keys/main.c | 2 -- rewriter/tests/heap_two_keys/plugin.c | 2 -- rewriter/tests/macro_attr/functions.c | 2 -- rewriter/tests/macro_attr/main.c | 2 -- rewriter/tests/minimal/main.c | 2 -- rewriter/tests/minimal/minimal.c | 2 -- rewriter/tests/mmap_loop/main.c | 2 -- rewriter/tests/mmap_loop/mmap_loop.c | 2 -- rewriter/tests/omit_wrappers/library.h | 2 -- rewriter/tests/permissive_mode/permissive_mode.c | 4 ---- rewriter/tests/protected_threads/library.c | 2 -- rewriter/tests/protected_threads/main.c | 2 -- rewriter/tests/read_config/builtin.c | 2 -- rewriter/tests/read_config/main.c | 2 -- rewriter/tests/read_config/plugin.c | 2 -- rewriter/tests/recursion/dso.c | 2 -- rewriter/tests/recursion/main.c | 2 -- rewriter/tests/rewrite_fn_ptr_eq/lib.c | 2 -- rewriter/tests/rewrite_fn_ptr_eq/main.c | 2 -- rewriter/tests/rewrite_macros/lib.c | 2 -- rewriter/tests/rewrite_macros/main.c | 2 -- rewriter/tests/ro_sharing/main.c | 2 -- rewriter/tests/ro_sharing/plugin.c | 2 -- rewriter/tests/shared_data/access_shared.c | 2 -- rewriter/tests/shared_data/main.c | 2 -- rewriter/tests/should_segfault/main.c | 2 -- rewriter/tests/should_segfault/print_secret.c | 2 -- rewriter/tests/sighandler/lib.c | 2 -- rewriter/tests/sighandler/main.c | 2 -- rewriter/tests/simple1/main.c | 2 -- rewriter/tests/structs/main.c | 2 -- rewriter/tests/structs/structs.c | 2 -- rewriter/tests/threads/library.c | 2 -- rewriter/tests/threads/main.c | 2 -- rewriter/tests/tls_protected/library.c | 2 -- rewriter/tests/tls_protected/main.c | 2 -- rewriter/tests/trusted_direct/main.c | 2 -- rewriter/tests/trusted_direct/plugin.c | 2 -- rewriter/tests/trusted_indirect/main.c | 2 -- rewriter/tests/trusted_indirect/rand_op.c | 2 -- rewriter/tests/two_keys_minimal/main.c | 2 -- rewriter/tests/two_keys_minimal/plugin.c | 2 -- rewriter/tests/two_shared_ranges/main.c | 2 -- rewriter/tests/two_shared_ranges/plugin.c | 2 -- rewriter/tests/untrusted_indirect/foo.c | 2 -- rewriter/tests/untrusted_indirect/main.c | 2 -- 52 files changed, 106 deletions(-) diff --git a/rewriter/tests/global_fn_ptr/include/operations.h b/rewriter/tests/global_fn_ptr/include/operations.h index ae9f67636..83ffb539d 100644 --- a/rewriter/tests/global_fn_ptr/include/operations.h +++ b/rewriter/tests/global_fn_ptr/include/operations.h @@ -1,5 +1,3 @@ -/* -*/ #pragma once #include diff --git a/rewriter/tests/global_fn_ptr/main.c b/rewriter/tests/global_fn_ptr/main.c index 4ddbdfab8..d7a3ded39 100644 --- a/rewriter/tests/global_fn_ptr/main.c +++ b/rewriter/tests/global_fn_ptr/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "operations.h" #include #include diff --git a/rewriter/tests/global_fn_ptr/operations.c b/rewriter/tests/global_fn_ptr/operations.c index 6fb99f091..dfbd1af94 100644 --- a/rewriter/tests/global_fn_ptr/operations.c +++ b/rewriter/tests/global_fn_ptr/operations.c @@ -1,5 +1,3 @@ -/* -*/ #include "operations.h" #include #include diff --git a/rewriter/tests/header_includes/impl.c b/rewriter/tests/header_includes/impl.c index 1c2c67b22..a918ae7af 100644 --- a/rewriter/tests/header_includes/impl.c +++ b/rewriter/tests/header_includes/impl.c @@ -1,5 +1,3 @@ -/* -*/ #include "types.h" int unwrap_or(Option opt, int default_value) { diff --git a/rewriter/tests/header_includes/liboption.c b/rewriter/tests/header_includes/liboption.c index 8fca999c9..2126387c8 100644 --- a/rewriter/tests/header_includes/liboption.c +++ b/rewriter/tests/header_includes/liboption.c @@ -1,5 +1,3 @@ -/* -*/ #include #include "liboption.h" #include "types.h" diff --git a/rewriter/tests/header_includes/main.c b/rewriter/tests/header_includes/main.c index 3b2b970f5..4a6e85a22 100644 --- a/rewriter/tests/header_includes/main.c +++ b/rewriter/tests/header_includes/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "liboption.h" #include "types.h" #include diff --git a/rewriter/tests/heap_two_keys/main.c b/rewriter/tests/heap_two_keys/main.c index fd1665532..ac3a6e0ba 100644 --- a/rewriter/tests/heap_two_keys/main.c +++ b/rewriter/tests/heap_two_keys/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/heap_two_keys/plugin.c b/rewriter/tests/heap_two_keys/plugin.c index f67b07b51..39b5d50d2 100644 --- a/rewriter/tests/heap_two_keys/plugin.c +++ b/rewriter/tests/heap_two_keys/plugin.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "exported_fn.h" diff --git a/rewriter/tests/macro_attr/functions.c b/rewriter/tests/macro_attr/functions.c index e18da598e..7e670ae4c 100644 --- a/rewriter/tests/macro_attr/functions.c +++ b/rewriter/tests/macro_attr/functions.c @@ -1,5 +1,3 @@ -/* -*/ #include #include "functions.h" diff --git a/rewriter/tests/macro_attr/main.c b/rewriter/tests/macro_attr/main.c index 191c31189..0868943a6 100644 --- a/rewriter/tests/macro_attr/main.c +++ b/rewriter/tests/macro_attr/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "functions.h" #include #include diff --git a/rewriter/tests/minimal/main.c b/rewriter/tests/minimal/main.c index 3eea81856..94f4d911a 100644 --- a/rewriter/tests/minimal/main.c +++ b/rewriter/tests/minimal/main.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment diff --git a/rewriter/tests/minimal/minimal.c b/rewriter/tests/minimal/minimal.c index 26f2230db..451bae6f0 100644 --- a/rewriter/tests/minimal/minimal.c +++ b/rewriter/tests/minimal/minimal.c @@ -1,5 +1,3 @@ -/* -*/ #include "minimal.h" #include diff --git a/rewriter/tests/mmap_loop/main.c b/rewriter/tests/mmap_loop/main.c index e95029d0e..e9868ebe4 100644 --- a/rewriter/tests/mmap_loop/main.c +++ b/rewriter/tests/mmap_loop/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "mmap_loop.h" #include #include diff --git a/rewriter/tests/mmap_loop/mmap_loop.c b/rewriter/tests/mmap_loop/mmap_loop.c index e9f2328ae..1e56cb1d1 100644 --- a/rewriter/tests/mmap_loop/mmap_loop.c +++ b/rewriter/tests/mmap_loop/mmap_loop.c @@ -1,5 +1,3 @@ -/* -*/ #include "mmap_loop.h" #include "ia2.h" diff --git a/rewriter/tests/omit_wrappers/library.h b/rewriter/tests/omit_wrappers/library.h index 1233c440f..8db0720b4 100644 --- a/rewriter/tests/omit_wrappers/library.h +++ b/rewriter/tests/omit_wrappers/library.h @@ -1,5 +1,3 @@ -/* -*/ #pragma once #include diff --git a/rewriter/tests/permissive_mode/permissive_mode.c b/rewriter/tests/permissive_mode/permissive_mode.c index 9b2aa5fd1..f8e18b4ab 100644 --- a/rewriter/tests/permissive_mode/permissive_mode.c +++ b/rewriter/tests/permissive_mode/permissive_mode.c @@ -1,7 +1,3 @@ -/* -*/ -// TODO remove the above when lit is removed. As of now a RUN line is required. - #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif diff --git a/rewriter/tests/protected_threads/library.c b/rewriter/tests/protected_threads/library.c index 1fcf69ff8..6b20db452 100644 --- a/rewriter/tests/protected_threads/library.c +++ b/rewriter/tests/protected_threads/library.c @@ -1,5 +1,3 @@ -/* -*/ #include "library.h" #include #include diff --git a/rewriter/tests/protected_threads/main.c b/rewriter/tests/protected_threads/main.c index 0f66a6c62..b2aa18f83 100644 --- a/rewriter/tests/protected_threads/main.c +++ b/rewriter/tests/protected_threads/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "library.h" #include #include diff --git a/rewriter/tests/read_config/builtin.c b/rewriter/tests/read_config/builtin.c index dab2a0478..c633cf1aa 100644 --- a/rewriter/tests/read_config/builtin.c +++ b/rewriter/tests/read_config/builtin.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/read_config/main.c b/rewriter/tests/read_config/main.c index 392d4dac2..68d05fdd2 100644 --- a/rewriter/tests/read_config/main.c +++ b/rewriter/tests/read_config/main.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment #include "plugin.h" diff --git a/rewriter/tests/read_config/plugin.c b/rewriter/tests/read_config/plugin.c index 77cc36f8a..3c85bacec 100644 --- a/rewriter/tests/read_config/plugin.c +++ b/rewriter/tests/read_config/plugin.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment #include "plugin.h" diff --git a/rewriter/tests/recursion/dso.c b/rewriter/tests/recursion/dso.c index ff706f1a5..3152499d4 100644 --- a/rewriter/tests/recursion/dso.c +++ b/rewriter/tests/recursion/dso.c @@ -1,5 +1,3 @@ -/* -*/ #include "recursion_main.h" #include #include diff --git a/rewriter/tests/recursion/main.c b/rewriter/tests/recursion/main.c index d335f3a99..33aede95f 100644 --- a/rewriter/tests/recursion/main.c +++ b/rewriter/tests/recursion/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "recursion_dso.h" #include diff --git a/rewriter/tests/rewrite_fn_ptr_eq/lib.c b/rewriter/tests/rewrite_fn_ptr_eq/lib.c index 4ebeeaa49..ce7cbad3e 100644 --- a/rewriter/tests/rewrite_fn_ptr_eq/lib.c +++ b/rewriter/tests/rewrite_fn_ptr_eq/lib.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/rewrite_fn_ptr_eq/main.c b/rewriter/tests/rewrite_fn_ptr_eq/main.c index 3c2eb314f..547ff750d 100644 --- a/rewriter/tests/rewrite_fn_ptr_eq/main.c +++ b/rewriter/tests/rewrite_fn_ptr_eq/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/rewrite_macros/lib.c b/rewriter/tests/rewrite_macros/lib.c index 7ffbccc89..09a76fea9 100644 --- a/rewriter/tests/rewrite_macros/lib.c +++ b/rewriter/tests/rewrite_macros/lib.c @@ -1,5 +1,3 @@ -/* -*/ #include "lib.h" #include diff --git a/rewriter/tests/rewrite_macros/main.c b/rewriter/tests/rewrite_macros/main.c index c33e8c714..63891d78e 100644 --- a/rewriter/tests/rewrite_macros/main.c +++ b/rewriter/tests/rewrite_macros/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "lib.h" #include #include diff --git a/rewriter/tests/ro_sharing/main.c b/rewriter/tests/ro_sharing/main.c index 10c56886f..996e92437 100644 --- a/rewriter/tests/ro_sharing/main.c +++ b/rewriter/tests/ro_sharing/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/ro_sharing/plugin.c b/rewriter/tests/ro_sharing/plugin.c index e3c12c8dc..759f27e63 100644 --- a/rewriter/tests/ro_sharing/plugin.c +++ b/rewriter/tests/ro_sharing/plugin.c @@ -1,5 +1,3 @@ -/* -*/ #include "test_fault_handler.h" #include #include diff --git a/rewriter/tests/shared_data/access_shared.c b/rewriter/tests/shared_data/access_shared.c index 358cb092f..4e52e8de7 100644 --- a/rewriter/tests/shared_data/access_shared.c +++ b/rewriter/tests/shared_data/access_shared.c @@ -1,5 +1,3 @@ -/* -*/ #include #include "access_shared.h" #include diff --git a/rewriter/tests/shared_data/main.c b/rewriter/tests/shared_data/main.c index 207654bda..62533f1d2 100644 --- a/rewriter/tests/shared_data/main.c +++ b/rewriter/tests/shared_data/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/should_segfault/main.c b/rewriter/tests/should_segfault/main.c index 4b8d05ef8..0e6c35faf 100644 --- a/rewriter/tests/should_segfault/main.c +++ b/rewriter/tests/should_segfault/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/should_segfault/print_secret.c b/rewriter/tests/should_segfault/print_secret.c index 8cd1d6ee1..8e2d78046 100644 --- a/rewriter/tests/should_segfault/print_secret.c +++ b/rewriter/tests/should_segfault/print_secret.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/sighandler/lib.c b/rewriter/tests/sighandler/lib.c index 82453ddef..81ce43da2 100644 --- a/rewriter/tests/sighandler/lib.c +++ b/rewriter/tests/sighandler/lib.c @@ -1,5 +1,3 @@ -/* -*/ #include "lib.h" #include diff --git a/rewriter/tests/sighandler/main.c b/rewriter/tests/sighandler/main.c index d42ecca85..37c10146a 100644 --- a/rewriter/tests/sighandler/main.c +++ b/rewriter/tests/sighandler/main.c @@ -1,5 +1,3 @@ -/* -*/ #include "lib.h" #include #include diff --git a/rewriter/tests/simple1/main.c b/rewriter/tests/simple1/main.c index 9e9d6edaf..33a93402d 100644 --- a/rewriter/tests/simple1/main.c +++ b/rewriter/tests/simple1/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/structs/main.c b/rewriter/tests/structs/main.c index ce4f96cfa..28ebfd198 100644 --- a/rewriter/tests/structs/main.c +++ b/rewriter/tests/structs/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "structs.h" diff --git a/rewriter/tests/structs/structs.c b/rewriter/tests/structs/structs.c index 25e75dbce..6e195e3bf 100644 --- a/rewriter/tests/structs/structs.c +++ b/rewriter/tests/structs/structs.c @@ -1,5 +1,3 @@ -/* -*/ #include "structs.h" #include #include diff --git a/rewriter/tests/threads/library.c b/rewriter/tests/threads/library.c index fdf7025bf..a7465237b 100644 --- a/rewriter/tests/threads/library.c +++ b/rewriter/tests/threads/library.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "library.h" diff --git a/rewriter/tests/threads/main.c b/rewriter/tests/threads/main.c index 0d49f06ed..65487aec8 100644 --- a/rewriter/tests/threads/main.c +++ b/rewriter/tests/threads/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "library.h" diff --git a/rewriter/tests/tls_protected/library.c b/rewriter/tests/tls_protected/library.c index ff619f756..c4c318397 100644 --- a/rewriter/tests/tls_protected/library.c +++ b/rewriter/tests/tls_protected/library.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment #include "library.h" diff --git a/rewriter/tests/tls_protected/main.c b/rewriter/tests/tls_protected/main.c index 9ef4d2dfe..cd17140e1 100644 --- a/rewriter/tests/tls_protected/main.c +++ b/rewriter/tests/tls_protected/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include diff --git a/rewriter/tests/trusted_direct/main.c b/rewriter/tests/trusted_direct/main.c index 9c686a8c4..ba6439816 100644 --- a/rewriter/tests/trusted_direct/main.c +++ b/rewriter/tests/trusted_direct/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/trusted_direct/plugin.c b/rewriter/tests/trusted_direct/plugin.c index 13291a6b2..2ef8229a5 100644 --- a/rewriter/tests/trusted_direct/plugin.c +++ b/rewriter/tests/trusted_direct/plugin.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "exported_fn.h" diff --git a/rewriter/tests/trusted_indirect/main.c b/rewriter/tests/trusted_indirect/main.c index 00f2319ec..025e05d52 100644 --- a/rewriter/tests/trusted_indirect/main.c +++ b/rewriter/tests/trusted_indirect/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include "rand_op.h" diff --git a/rewriter/tests/trusted_indirect/rand_op.c b/rewriter/tests/trusted_indirect/rand_op.c index 62a5835c3..36f600edb 100644 --- a/rewriter/tests/trusted_indirect/rand_op.c +++ b/rewriter/tests/trusted_indirect/rand_op.c @@ -1,5 +1,3 @@ -/* -*/ #include #include diff --git a/rewriter/tests/two_keys_minimal/main.c b/rewriter/tests/two_keys_minimal/main.c index 7038942bb..8700e7a3b 100644 --- a/rewriter/tests/two_keys_minimal/main.c +++ b/rewriter/tests/two_keys_minimal/main.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment diff --git a/rewriter/tests/two_keys_minimal/plugin.c b/rewriter/tests/two_keys_minimal/plugin.c index 120c0658c..98eb49f67 100644 --- a/rewriter/tests/two_keys_minimal/plugin.c +++ b/rewriter/tests/two_keys_minimal/plugin.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment diff --git a/rewriter/tests/two_shared_ranges/main.c b/rewriter/tests/two_shared_ranges/main.c index 984be2271..61b2846e6 100644 --- a/rewriter/tests/two_shared_ranges/main.c +++ b/rewriter/tests/two_shared_ranges/main.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment diff --git a/rewriter/tests/two_shared_ranges/plugin.c b/rewriter/tests/two_shared_ranges/plugin.c index 38a302129..7a2a6fa2c 100644 --- a/rewriter/tests/two_shared_ranges/plugin.c +++ b/rewriter/tests/two_shared_ranges/plugin.c @@ -1,5 +1,3 @@ -/* -*/ // Check that readelf shows exactly one executable segment diff --git a/rewriter/tests/untrusted_indirect/foo.c b/rewriter/tests/untrusted_indirect/foo.c index 540dd9327..6b256a43b 100644 --- a/rewriter/tests/untrusted_indirect/foo.c +++ b/rewriter/tests/untrusted_indirect/foo.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include diff --git a/rewriter/tests/untrusted_indirect/main.c b/rewriter/tests/untrusted_indirect/main.c index b8b205925..8d56297d8 100644 --- a/rewriter/tests/untrusted_indirect/main.c +++ b/rewriter/tests/untrusted_indirect/main.c @@ -1,5 +1,3 @@ -/* -*/ #include #include #include From 5fff734586e6dbf06b1dfe0abf13e0d6e3c3c4e3 Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Tue, 24 Oct 2023 15:52:07 -0700 Subject: [PATCH 3/5] Remove lit configs --- rewriter/tests/CMakeLists.txt | 7 ---- rewriter/tests/ffmpeg/lit.local.cfg.py | 2 - rewriter/tests/header_includes/lit.local.cfg | 2 - rewriter/tests/libusb/lit.local.cfg.py | 2 - rewriter/tests/lit.cfg.py | 39 ------------------- rewriter/tests/lit.site.cfg.py.in | 41 -------------------- rewriter/tests/read_config/lit.local.cfg | 1 - 7 files changed, 94 deletions(-) delete mode 100644 rewriter/tests/ffmpeg/lit.local.cfg.py delete mode 100644 rewriter/tests/header_includes/lit.local.cfg delete mode 100644 rewriter/tests/libusb/lit.local.cfg.py delete mode 100644 rewriter/tests/lit.cfg.py delete mode 100644 rewriter/tests/lit.site.cfg.py.in delete mode 100644 rewriter/tests/read_config/lit.local.cfg diff --git a/rewriter/tests/CMakeLists.txt b/rewriter/tests/CMakeLists.txt index 802688a52..7433b9c9f 100644 --- a/rewriter/tests/CMakeLists.txt +++ b/rewriter/tests/CMakeLists.txt @@ -6,13 +6,6 @@ include("../../cmake/define-ia2-wrapper.cmake") include("../../cmake/define-test.cmake") include("../../cmake/add-tls-padded-library.cmake") -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py - MAIN_CONFIG - ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py - ) - set(IA2_TEST_DEPENDS ia2-rewriter) add_lit_testsuite(check-ia2 "Running the IA2 tests" diff --git a/rewriter/tests/ffmpeg/lit.local.cfg.py b/rewriter/tests/ffmpeg/lit.local.cfg.py deleted file mode 100644 index 6c4eb0acb..000000000 --- a/rewriter/tests/ffmpeg/lit.local.cfg.py +++ /dev/null @@ -1,2 +0,0 @@ -config.name = "ffmpeg" -config.suffixes = ['.test'] diff --git a/rewriter/tests/header_includes/lit.local.cfg b/rewriter/tests/header_includes/lit.local.cfg deleted file mode 100644 index bea52cba7..000000000 --- a/rewriter/tests/header_includes/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -config.suffixes = ['.c'] -config.excludes = ['liboption.c', 'impl.c'] diff --git a/rewriter/tests/libusb/lit.local.cfg.py b/rewriter/tests/libusb/lit.local.cfg.py deleted file mode 100644 index a0fffaa2e..000000000 --- a/rewriter/tests/libusb/lit.local.cfg.py +++ /dev/null @@ -1,2 +0,0 @@ -config.name = "libusb" -config.suffixes = ['.test'] diff --git a/rewriter/tests/lit.cfg.py b/rewriter/tests/lit.cfg.py deleted file mode 100644 index aefc3f11d..000000000 --- a/rewriter/tests/lit.cfg.py +++ /dev/null @@ -1,39 +0,0 @@ -# Configuration file for the LLVM lit test runner. -# Loosely based on the lit.cfg.py from LLVM - -import lit -from lit.llvm import llvm_config -from lit.llvm.subst import ToolSubst - -# name: The name of this test suite. -config.name = 'IA2' - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.ShTest(False) - -# suffixes: A list of file extensions to treat as test files. This is overriden -# by individual lit.local.cfg files in the test subdirectories. -config.suffixes = ['.c'] - -# excludes: A list of directories to exclude from the testsuite. The 'Inputs' -# subdirectories contain auxiliary inputs for various tests in their parent -# directories. -config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt', - 'libusb', 'ffmpeg', 'destructors'] - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -llvm_config.add_tool_substitutions([ToolSubst('ia2-rewriter')], search_dirs=config.ia2_obj_root) - -llvm_config.use_default_substitutions() -llvm_config.use_clang() - -config.substitutions.extend([ - ('%ia2_generate_checks', '%s/tests/generate-checks.sh' % config.ia2_src_root), - ('%ia2_include', '%s/../include' % config.ia2_src_root), - ('%binary_dir', config.ia2_obj_root), - ('%source_dir', config.ia2_src_root) -]) - -config.environment['LD_BIND_NOW'] = '1' diff --git a/rewriter/tests/lit.site.cfg.py.in b/rewriter/tests/lit.site.cfg.py.in deleted file mode 100644 index 0143b5db0..000000000 --- a/rewriter/tests/lit.site.cfg.py.in +++ /dev/null @@ -1,41 +0,0 @@ -@LIT_SITE_CFG_IN_HEADER@ - -import sys - -config.host_triple = "@LLVM_HOST_TRIPLE@" -config.target_triple = "@LLVM_TARGET_TRIPLE@" or "@TARGET_TRIPLE@" -config.ia2_src_root = r"@IA2_SOURCE_DIR@" -config.ia2_obj_root = r"@IA2_BINARY_DIR@" -config.llvm_tools_dir = r"@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = r"@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = r"@SHLIBDIR@" -config.llvm_shlib_ext = "@SHLIBEXT@" -config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" -config.llvm_exe_ext = "@EXEEXT@" -config.lit_tools_dir = r"@LLVM_LIT_TOOLS_DIR@" -config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" -config.python_executable = "@Python3_EXECUTABLE@" -config.gold_executable = "@GOLD_EXECUTABLE@" -config.ld64_executable = "@LD64_EXECUTABLE@" -config.native_target = "@LLVM_NATIVE_ARCH@" -config.host_os = "@HOST_OS@" -config.host_cc = "@HOST_CC@" -config.host_cxx = "@HOST_CXX@" - -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - -import lit.llvm -lit.llvm.initialize(lit_config, config) - -# Let the main config do the real work. -lit_config.load_config( - config, os.path.join(config.ia2_src_root, "tests/lit.cfg.py")) diff --git a/rewriter/tests/read_config/lit.local.cfg b/rewriter/tests/read_config/lit.local.cfg deleted file mode 100644 index 5b060f37b..000000000 --- a/rewriter/tests/read_config/lit.local.cfg +++ /dev/null @@ -1 +0,0 @@ -config.excludes = ['plugin.h'] From c7ed05460a8c62ab5c4c2bef7ac3bb25ab412005 Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Tue, 24 Oct 2023 17:30:47 -0700 Subject: [PATCH 4/5] Remove lit from CMake --- rewriter/CMakeLists.txt | 1 - rewriter/tests/CMakeLists.txt | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/rewriter/CMakeLists.txt b/rewriter/CMakeLists.txt index 98d710c75..0fdc5160d 100644 --- a/rewriter/CMakeLists.txt +++ b/rewriter/CMakeLists.txt @@ -6,7 +6,6 @@ message(STATUS "Found LLVM: ${LLVM_DIR} (found version \"${LLVM_PACKAGE_VERSION} find_package(Clang REQUIRED CONFIG) message(STATUS "Found Clang: ${Clang_DIR}") -# We use the lit CMake functions from LLVM list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") include(AddLLVM) diff --git a/rewriter/tests/CMakeLists.txt b/rewriter/tests/CMakeLists.txt index 7433b9c9f..f45fe4492 100644 --- a/rewriter/tests/CMakeLists.txt +++ b/rewriter/tests/CMakeLists.txt @@ -8,12 +8,7 @@ include("../../cmake/add-tls-padded-library.cmake") set(IA2_TEST_DEPENDS ia2-rewriter) -add_lit_testsuite(check-ia2 "Running the IA2 tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${IA2_TEST_DEPENDS} partition-alloc - ARGS "--verbose" - ) -set_target_properties(check-ia2 PROPERTIES FOLDER "tests") +add_custom_target(check-ia2) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From bd30cc5a45700b0243620b43de768c9c5774097f Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Tue, 24 Oct 2023 17:43:25 -0700 Subject: [PATCH 5/5] Remove output files --- .../tests/global_fn_ptr/Output/operations.out | 2 - .../tests/heap_two_keys/Output/clean_exit.out | 0 rewriter/tests/heap_two_keys/Output/fault.out | 1 - rewriter/tests/minimal/Output/minimal.out | 1 - rewriter/tests/mmap_loop/CMakeLists.txt | 3 - rewriter/tests/mmap_loop/Output/mmap_loop.out | 3 - .../tests/read_config/Output/read_config.out | 8 -- rewriter/tests/recursion/Output/recursion.out | 6 - rewriter/tests/ro_sharing/Output/main.out | 4 - rewriter/tests/ro_sharing/Output/plugin.out | 4 - .../tests/shared_data/Output/shared_data.out | 4 - .../should_segfault/Output/early_segfault.out | 2 - .../Output/should_segfault.out | 2 - rewriter/tests/sighandler/Output/main.out | 2 - rewriter/tests/structs/CMakeLists.txt | 3 - rewriter/tests/structs/Output/structs.out | 116 ------------------ rewriter/tests/threads/Output/threads.out | 18 --- .../Output/tls_protected_lib.out | 11 -- .../Output/tls_protected_main.out | 11 -- .../Output/trusted_direct.clean_exit.out | 2 - .../trusted_direct/Output/trusted_direct.out | 3 - .../Output/trusted_indirect.clean_exit.out | 8 -- .../Output/trusted_indirect.out | 9 -- .../two_keys_minimal/Output/clean_exit.out | 5 - .../tests/two_keys_minimal/Output/main.out | 6 - .../tests/two_keys_minimal/Output/plugin.out | 6 - .../two_shared_ranges/Output/clean_exit.out | 7 -- .../tests/two_shared_ranges/Output/main.out | 8 -- .../tests/two_shared_ranges/Output/plugin.out | 8 -- .../Output/untrusted_indirect.clean_exit.out | 4 - .../Output/untrusted_indirect.out | 5 - 31 files changed, 272 deletions(-) delete mode 100644 rewriter/tests/global_fn_ptr/Output/operations.out delete mode 100644 rewriter/tests/heap_two_keys/Output/clean_exit.out delete mode 100644 rewriter/tests/heap_two_keys/Output/fault.out delete mode 100644 rewriter/tests/minimal/Output/minimal.out delete mode 100644 rewriter/tests/mmap_loop/Output/mmap_loop.out delete mode 100644 rewriter/tests/read_config/Output/read_config.out delete mode 100644 rewriter/tests/recursion/Output/recursion.out delete mode 100644 rewriter/tests/ro_sharing/Output/main.out delete mode 100644 rewriter/tests/ro_sharing/Output/plugin.out delete mode 100644 rewriter/tests/shared_data/Output/shared_data.out delete mode 100644 rewriter/tests/should_segfault/Output/early_segfault.out delete mode 100644 rewriter/tests/should_segfault/Output/should_segfault.out delete mode 100644 rewriter/tests/sighandler/Output/main.out delete mode 100644 rewriter/tests/structs/Output/structs.out delete mode 100644 rewriter/tests/threads/Output/threads.out delete mode 100644 rewriter/tests/tls_protected/Output/tls_protected_lib.out delete mode 100644 rewriter/tests/tls_protected/Output/tls_protected_main.out delete mode 100644 rewriter/tests/trusted_direct/Output/trusted_direct.clean_exit.out delete mode 100644 rewriter/tests/trusted_direct/Output/trusted_direct.out delete mode 100644 rewriter/tests/trusted_indirect/Output/trusted_indirect.clean_exit.out delete mode 100644 rewriter/tests/trusted_indirect/Output/trusted_indirect.out delete mode 100644 rewriter/tests/two_keys_minimal/Output/clean_exit.out delete mode 100644 rewriter/tests/two_keys_minimal/Output/main.out delete mode 100644 rewriter/tests/two_keys_minimal/Output/plugin.out delete mode 100644 rewriter/tests/two_shared_ranges/Output/clean_exit.out delete mode 100644 rewriter/tests/two_shared_ranges/Output/main.out delete mode 100644 rewriter/tests/two_shared_ranges/Output/plugin.out delete mode 100644 rewriter/tests/untrusted_indirect/Output/untrusted_indirect.clean_exit.out delete mode 100644 rewriter/tests/untrusted_indirect/Output/untrusted_indirect.out diff --git a/rewriter/tests/global_fn_ptr/Output/operations.out b/rewriter/tests/global_fn_ptr/Output/operations.out deleted file mode 100644 index abb38b61f..000000000 --- a/rewriter/tests/global_fn_ptr/Output/operations.out +++ /dev/null @@ -1,2 +0,0 @@ -43312 = f(18923, 24389) -461513047 = f(18923, 24389) diff --git a/rewriter/tests/heap_two_keys/Output/clean_exit.out b/rewriter/tests/heap_two_keys/Output/clean_exit.out deleted file mode 100644 index e69de29bb..000000000 diff --git a/rewriter/tests/heap_two_keys/Output/fault.out b/rewriter/tests/heap_two_keys/Output/fault.out deleted file mode 100644 index 3dc5a4208..000000000 --- a/rewriter/tests/heap_two_keys/Output/fault.out +++ /dev/null @@ -1 +0,0 @@ -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/minimal/Output/minimal.out b/rewriter/tests/minimal/Output/minimal.out deleted file mode 100644 index 257cc5642..000000000 --- a/rewriter/tests/minimal/Output/minimal.out +++ /dev/null @@ -1 +0,0 @@ -foo diff --git a/rewriter/tests/mmap_loop/CMakeLists.txt b/rewriter/tests/mmap_loop/CMakeLists.txt index 338ab3103..200c6280a 100644 --- a/rewriter/tests/mmap_loop/CMakeLists.txt +++ b/rewriter/tests/mmap_loop/CMakeLists.txt @@ -1,6 +1,3 @@ -set(STDOUT_REF ${CMAKE_CURRENT_SOURCE_DIR}/Output/mmap_loop.out) -configure_file(${STDOUT_REF} ${CMAKE_CURRENT_BINARY_DIR}/mmap_loop.out) - define_shared_lib( SRCS mmap_loop.c PKEY 2 diff --git a/rewriter/tests/mmap_loop/Output/mmap_loop.out b/rewriter/tests/mmap_loop/Output/mmap_loop.out deleted file mode 100644 index a8185c24f..000000000 --- a/rewriter/tests/mmap_loop/Output/mmap_loop.out +++ /dev/null @@ -1,3 +0,0 @@ -program started -mmap buf -res=0 diff --git a/rewriter/tests/read_config/Output/read_config.out b/rewriter/tests/read_config/Output/read_config.out deleted file mode 100644 index cf77434c5..000000000 --- a/rewriter/tests/read_config/Output/read_config.out +++ /dev/null @@ -1,8 +0,0 @@ -name config1 -num_options 4 -debug_mode false -magic_val (deadbeef, ddccbbaa) -random_seed 42 -name builtin_config -num_options 3 -array [11, 22, 33] diff --git a/rewriter/tests/recursion/Output/recursion.out b/rewriter/tests/recursion/Output/recursion.out deleted file mode 100644 index 3e782d913..000000000 --- a/rewriter/tests/recursion/Output/recursion.out +++ /dev/null @@ -1,6 +0,0 @@ -recursion_main: 5 -recursion_dso: 4 -recursion_main: 3 -recursion_dso: 2 -recursion_main: 1 -recursion_dso: 0 diff --git a/rewriter/tests/ro_sharing/Output/main.out b/rewriter/tests/ro_sharing/Output/main.out deleted file mode 100644 index d1795ed72..000000000 --- a/rewriter/tests/ro_sharing/Output/main.out +++ /dev/null @@ -1,4 +0,0 @@ -read_main_string: this is the main binary's string - -read_main_uint: 0x9431233 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/ro_sharing/Output/plugin.out b/rewriter/tests/ro_sharing/Output/plugin.out deleted file mode 100644 index 6b0d50678..000000000 --- a/rewriter/tests/ro_sharing/Output/plugin.out +++ /dev/null @@ -1,4 +0,0 @@ -main: this is the plugin's string - -main: 0x730283 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/shared_data/Output/shared_data.out b/rewriter/tests/shared_data/Output/shared_data.out deleted file mode 100644 index 0c045db55..000000000 --- a/rewriter/tests/shared_data/Output/shared_data.out +++ /dev/null @@ -1,4 +0,0 @@ -read 23 from shared variable -writing 24 to shared variable -read 254 from shared variable -writing 255 to shared variable diff --git a/rewriter/tests/should_segfault/Output/early_segfault.out b/rewriter/tests/should_segfault/Output/early_segfault.out deleted file mode 100644 index 9dd7ff975..000000000 --- a/rewriter/tests/should_segfault/Output/early_segfault.out +++ /dev/null @@ -1,2 +0,0 @@ -TRUSTED: the secret is deadbeef -CHECK_VIOLATION: unexpected seg fault diff --git a/rewriter/tests/should_segfault/Output/should_segfault.out b/rewriter/tests/should_segfault/Output/should_segfault.out deleted file mode 100644 index 967225135..000000000 --- a/rewriter/tests/should_segfault/Output/should_segfault.out +++ /dev/null @@ -1,2 +0,0 @@ -TRUSTED: the secret is deadbeef -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/sighandler/Output/main.out b/rewriter/tests/sighandler/Output/main.out deleted file mode 100644 index a09f7a373..000000000 --- a/rewriter/tests/sighandler/Output/main.out +++ /dev/null @@ -1,2 +0,0 @@ -trap_handler: main_secret is 3 -trap_handler: lib_secret is CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/structs/CMakeLists.txt b/rewriter/tests/structs/CMakeLists.txt index d9e5f4239..ae76734fb 100644 --- a/rewriter/tests/structs/CMakeLists.txt +++ b/rewriter/tests/structs/CMakeLists.txt @@ -1,6 +1,3 @@ -set(STDOUT_REF ${CMAKE_CURRENT_SOURCE_DIR}/Output/structs.out) -configure_file(${STDOUT_REF} ${CMAKE_CURRENT_BINARY_DIR}/structs.out) - define_shared_lib( SRCS structs.c ) diff --git a/rewriter/tests/structs/Output/structs.out b/rewriter/tests/structs/Output/structs.out deleted file mode 100644 index a21a06947..000000000 --- a/rewriter/tests/structs/Output/structs.out +++ /dev/null @@ -1,116 +0,0 @@ -cksum_s1(s) = 179 (expected 179) -s.i1 = 3 (expected 3) -s.i2 = 96 (expected 96) -extract_s2(s) = 999.9900 (expected 999.9900) -s.i1 = 50 (expected 50) -s.c1 = 65 (expected 65) -s.u1 = 65379 (expected 65379) -cksum_s4(s) = 52881.2500 (expected 52881.2500) -s.f1 = 3.1400 (expected 3.1400) -s.f2 = 0.0016 (expected 0.0016) -s5 { 6976 0xb17ebee7 [78,45,32] 0xba5edba5edba5ed 390.5600 } -cksum_s5_f(s) = 390.5600 (expected 390.5600) -cksum_s5_z(s) = 839338293263499439 (expected 839338293263499439) -s.i1 = 31 (expected 31) -s.p1 = 0x4000030 (expected 0x4000030) -s.ac1[0] = 1 (expected 1) -s.ac1[1] = 2 (expected 2) -s.ac1[2] = 3 (expected 3) -s.p2 = 0xffffbeef (expected 0xffffbeef) -s.f1 = 98.7000 (expected 98.7000) -s.i1 = 99954 (expected 99954) -cksum_s6(s) = 1000374 (expected 1000374) -s.i1 = 101 (expected 101) -cksum_s6(s) = 1000379 (expected 1000379) -s.i1 = 8043 (expected 8043) -s.c1 = 4 (expected 4) -s.i2 = 695465 (expected 695465) -s.c2 = 100 (expected 100) -s.z1 = 155189248 (expected 155189248) -s.i1 = 4122 (expected 4122) -s.c1 = 15 (expected 15) -s.i2 = 347989 (expected 347989) -s.c2 = 58 (expected 58) -s.z1 = 78594624 (expected 78594624) -cksum_s7(s) = 4034059 (expected 4034059) -s.b1 = 1 (expected 1) -s.c1 = 55 (expected 55) -s.u1 = 454000 (expected 454000) -cksum_s8(s) = 999357496 (expected 999357496) -s.b1 = 1 (expected 1) -s.c1 = 15 (expected 15) -s.z1 = 454000 (expected 454000) -s.c2 = 13 (expected 13) -s.z2 = 9685031 (expected 9685031) -s.z3 = 62121255 (expected 62121255) -cksum_s9(s) = 00000000000000000000000000000fd3 (expected 00000000000000000000000000000fd3) -s.i1 = 96506328 (expected 96506328) -s.i2 = 1846 (expected 1846) -s.i3 = 3254 (expected 3254) -cksum_s10(s) = 000000000000000000000000026b9a66 (expected 000000000000000000000000026b9a66) -s.i1 = 00000000000000000000000005c091d8 (expected 00000000000000000000000005c091d8) -s.i2 = 00000000000000000000000000000736 (expected 00000000000000000000000000000736) -s.i3 = 00000000000000000000000000000cb6 (expected 00000000000000000000000000000cb6) -s.z1 = 6853785 (expected 6853785) -cksum_s11(s) = 2538 (expected 2538) -s.az1[0] = 1 (expected 1) -s.az1[1] = 2 (expected 2) -s.az1[2] = 3 (expected 3) -s.az1[3] = 4 (expected 4) -s.az1[4] = 5 (expected 5) -s.az1[5] = 6 (expected 6) -s.az1[6] = 7 (expected 7) -s.az1[7] = 8 (expected 8) -s.az1[8] = 9 (expected 9) -cksum_s12(s) = 2538 (expected 2538) -s.ac1[0] = 1 (expected 1) -s.ac1[1] = 2 (expected 2) -s.ac1[2] = 3 (expected 3) -s.ac1[3] = 4 (expected 4) -s.ac1[4] = 5 (expected 5) -s.ac1[5] = 6 (expected 6) -s.ac1[6] = 7 (expected 7) -s.ac1[7] = 8 (expected 8) -s.ac1[8] = 9 (expected 9) -cksum_s13(s) = -1288507668 (expected -1288507668) -s.x = 7fffeeeeddddccccbbbbaaaa99998888 (expected 7fffeeeeddddccccbbbbaaaa99998888) -cksum_s14(s) = 2 (expected 2) -s.u1 = 0 (expected 0) -s.u2 = 1 (expected 1) -s.u3 = 0 (expected 0) -s.u4 = 0 (expected 0) -s.u5 = 1 (expected 1) -s.u6 = 0 (expected 0) -s.u7 = 0 (expected 0) -s.u8 = 0 (expected 0) -s.u9 = 1 (expected 1) -s.u10 = 0 (expected 0) -s.u11 = 0 (expected 0) -s.u12 = 0 (expected 0) -s.u13 = 0 (expected 0) -s.u14 = 1 (expected 1) -s.u15 = 0 (expected 0) -s.u16 = 0 (expected 0) -s.u17 = 0 (expected 0) -s.u18 = 0 (expected 0) -s.u19 = 0 (expected 0) -s.u20 = 1 (expected 1) -s.u21 = 0 (expected 0) -s.u22 = 0 (expected 0) -s.u23 = 0 (expected 0) -s.u24 = 0 (expected 0) -s.u25 = 0 (expected 0) -s.u26 = 1 (expected 1) -s.u27 = 0 (expected 0) -s.u28 = 1 (expected 1) -s.u29 = 1 (expected 1) -s.u30 = 1 (expected 1) -s.u31 = 1 (expected 1) -s.u32 = 0 (expected 0) -s.field2 = 20000 (expected 20000) -s.field3 = 30000 (expected 30000) -s.field4 = 40000 (expected 40000) -s.field5 = 50000 (expected 50000) -s.field6 = 60000 (expected 60000) -s.field7 = 70000 (expected 70000) -s.field8 = 80000 (expected 80000) diff --git a/rewriter/tests/threads/Output/threads.out b/rewriter/tests/threads/Output/threads.out deleted file mode 100644 index e10e860e7..000000000 --- a/rewriter/tests/threads/Output/threads.out +++ /dev/null @@ -1,18 +0,0 @@ -main-module main pkru=55555550 -CHECK: library pkru fffffffc -CHECK-NEXT: main-module main pkru=fffffff0 -CHECK-DAG: library pkru fffffffc -tid 2 ptr=0x1 -CHECK-DAG: main-module thread pkru=fffffff0 -CHECK-DAG: data in library: 900 -CHECK-DAG: main data is 30 -CHECK-DAG: in lib, about to call fnptr; lib data: 900 -CHECK-DAG: library pkru fffffffc -tid 3 ptr=0x2 -CHECK-DAG: main-module thread pkru=fffffff0 -CHECK-DAG: main data is 30 -ptr is 0x1, formatting int: 000010cd -CHECK-DAG: library pkru fffffffc -ptr is 0x2, formatting int: 000010ce -CHECK-DAG: c1t3 accessing c1t1 thread-local: 50 -CHECK-NEXT: CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/tls_protected/Output/tls_protected_lib.out b/rewriter/tests/tls_protected/Output/tls_protected_lib.out deleted file mode 100644 index 461a5f43d..000000000 --- a/rewriter/tests/tls_protected/Output/tls_protected_lib.out +++ /dev/null @@ -1,11 +0,0 @@ -CHECK: errno=5, pkru= -CHECK-NEXT: library: lib secret is 1eaf1e55 -CHECK-NEXT: main: main secret is deadbeef -CHECK-NEXT: errno=5, pkru=fffffff0 -CHECK-NEXT: library: lib secret is 1eaf1e55 -CHECK-NEXT: errno=5, pkru=fffffff0 -CHECK-NEXT: pkru=fffffff0 -CHECK-NEXT: errno=5 -CHECK-NEXT: main: going to access lib secret -CHECK-NEXT: main: accessing lib secret at -CHECK-NEXT: CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/tls_protected/Output/tls_protected_main.out b/rewriter/tests/tls_protected/Output/tls_protected_main.out deleted file mode 100644 index 52707f357..000000000 --- a/rewriter/tests/tls_protected/Output/tls_protected_main.out +++ /dev/null @@ -1,11 +0,0 @@ -CHECK: errno=5, pkru= -CHECK-NEXT: library: lib secret is 1eaf1e55 -CHECK-NEXT: main: main secret is deadbeef -CHECK-NEXT: errno=5, pkru=fffffff0 -CHECK-NEXT: library: lib secret is 1eaf1e55 -CHECK-NEXT: errno=5, pkru=fffffff0 -CHECK-NEXT: pkru=fffffff0 -CHECK-NEXT: errno=5 -CHECK-NEXT: library: going to access main secret -CHECK-NEXT: library: accessing main secret at -CHECK-NEXT: CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/trusted_direct/Output/trusted_direct.clean_exit.out b/rewriter/tests/trusted_direct/Output/trusted_direct.clean_exit.out deleted file mode 100644 index 9c435f6f5..000000000 --- a/rewriter/tests/trusted_direct/Output/trusted_direct.clean_exit.out +++ /dev/null @@ -1,2 +0,0 @@ -start_plugin: this is defined in the plugin -print_message: the secret 0x9431233 is defined in the main binary diff --git a/rewriter/tests/trusted_direct/Output/trusted_direct.out b/rewriter/tests/trusted_direct/Output/trusted_direct.out deleted file mode 100644 index cc8880b83..000000000 --- a/rewriter/tests/trusted_direct/Output/trusted_direct.out +++ /dev/null @@ -1,3 +0,0 @@ -start_plugin: this is defined in the plugin -print_message: the secret 0x9431233 is defined in the main binary -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/trusted_indirect/Output/trusted_indirect.clean_exit.out b/rewriter/tests/trusted_indirect/Output/trusted_indirect.clean_exit.out deleted file mode 100644 index 1b6a4432b..000000000 --- a/rewriter/tests/trusted_indirect/Output/trusted_indirect.clean_exit.out +++ /dev/null @@ -1,8 +0,0 @@ -Got the function add from the library -add(987234, 142151) = 1129385 -mul(987234, 142151) = -1397620434 -div(987234, 142151) = 6 -Got the function sub from the library -sub(987234, 142151) = 845083 -mul(987234, 142151) = -1397620434 -div(987234, 142151) = 6 diff --git a/rewriter/tests/trusted_indirect/Output/trusted_indirect.out b/rewriter/tests/trusted_indirect/Output/trusted_indirect.out deleted file mode 100644 index 11192c6f3..000000000 --- a/rewriter/tests/trusted_indirect/Output/trusted_indirect.out +++ /dev/null @@ -1,9 +0,0 @@ -Got the function add from the library -add(987234, 142151) = 1129385 -mul(987234, 142151) = -1397620434 -div(987234, 142151) = 6 -Got the function sub from the library -sub(987234, 142151) = 845083 -mul(987234, 142151) = -1397620434 -div(987234, 142151) = 6 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/two_keys_minimal/Output/clean_exit.out b/rewriter/tests/two_keys_minimal/Output/clean_exit.out deleted file mode 100644 index 5bd7e4080..000000000 --- a/rewriter/tests/two_keys_minimal/Output/clean_exit.out +++ /dev/null @@ -1,5 +0,0 @@ -main: checking if the program can exit cleanly -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -print_message: this is defined in the main binary -print_message: the main secret is 9431233 diff --git a/rewriter/tests/two_keys_minimal/Output/main.out b/rewriter/tests/two_keys_minimal/Output/main.out deleted file mode 100644 index c88df501c..000000000 --- a/rewriter/tests/two_keys_minimal/Output/main.out +++ /dev/null @@ -1,6 +0,0 @@ -main: checking if the main secret is safe -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -print_message: this is defined in the main binary -print_message: the main secret is 9431233 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/two_keys_minimal/Output/plugin.out b/rewriter/tests/two_keys_minimal/Output/plugin.out deleted file mode 100644 index 6e3427b07..000000000 --- a/rewriter/tests/two_keys_minimal/Output/plugin.out +++ /dev/null @@ -1,6 +0,0 @@ -main: checking if the plugin secret is safe -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -print_message: this is defined in the main binary -print_message: the main secret is 9431233 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/two_shared_ranges/Output/clean_exit.out b/rewriter/tests/two_shared_ranges/Output/clean_exit.out deleted file mode 100644 index c583b8ca7..000000000 --- a/rewriter/tests/two_shared_ranges/Output/clean_exit.out +++ /dev/null @@ -1,7 +0,0 @@ -main: checking if the program can exit cleanly -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -start_plugin: the main shared data is b75784ee -print_message: this is defined in the main binary -print_message: the main secret is 9431233 -print_message: the plugin shared data is 415ea635 diff --git a/rewriter/tests/two_shared_ranges/Output/main.out b/rewriter/tests/two_shared_ranges/Output/main.out deleted file mode 100644 index bf0862a03..000000000 --- a/rewriter/tests/two_shared_ranges/Output/main.out +++ /dev/null @@ -1,8 +0,0 @@ -main: checking if the main secret is safe -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -start_plugin: the main shared data is b75784ee -print_message: this is defined in the main binary -print_message: the main secret is 9431233 -print_message: the plugin shared data is 415ea635 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/two_shared_ranges/Output/plugin.out b/rewriter/tests/two_shared_ranges/Output/plugin.out deleted file mode 100644 index c7e926816..000000000 --- a/rewriter/tests/two_shared_ranges/Output/plugin.out +++ /dev/null @@ -1,8 +0,0 @@ -main: checking if the plugin secret is safe -start_plugin: this is defined in the plugin -start_plugin: the plugin secret is 78341244 -start_plugin: the main shared data is b75784ee -print_message: this is defined in the main binary -print_message: the main secret is 9431233 -print_message: the plugin shared data is 415ea635 -CHECK_VIOLATION: seg faulted as expected diff --git a/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.clean_exit.out b/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.clean_exit.out deleted file mode 100644 index 7760c6224..000000000 --- a/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.clean_exit.out +++ /dev/null @@ -1,4 +0,0 @@ -TRUSTED: the secret is 0xcafed00d -0x1 -0x4 -TRUSTED: oops we leaked the address of the secret diff --git a/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.out b/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.out deleted file mode 100644 index a928fdec8..000000000 --- a/rewriter/tests/untrusted_indirect/Output/untrusted_indirect.out +++ /dev/null @@ -1,5 +0,0 @@ -TRUSTED: the secret is 0xcafed00d -0x1 -0x4 -TRUSTED: oops we leaked the address of the secret -CHECK_VIOLATION: seg faulted as expected