-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Add criterion-free minimal test for ARM
- Loading branch information
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Build the wrapped lib | ||
define_shared_lib(SRCS minimal.c) | ||
|
||
# Build the test | ||
define_test( | ||
SRCS main.c | ||
NEEDS_LD_WRAP | ||
) | ||
|
||
# Build the wrapper lib | ||
define_ia2_wrapper() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma once | ||
|
||
// This function does nothing | ||
void foo(); | ||
|
||
// This returns an integer | ||
int return_val(); | ||
|
||
// This takes an integer | ||
void arg1(int x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
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;' | ||
*/ | ||
|
||
// Check that readelf shows exactly one executable segment | ||
|
||
#include "minimal.h" | ||
#include <ia2.h> | ||
#include <stdio.h> | ||
|
||
INIT_RUNTIME(1); | ||
#define IA2_COMPARTMENT 1 | ||
#include <ia2_compartment_init.inc> | ||
|
||
int main() { | ||
printf("Calling foo"); | ||
foo(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
RUN: cat minimal_call_gates_1.ld | FileCheck --check-prefix=LINKARGS %s | ||
*/ | ||
|
||
#include "minimal.h" | ||
#include <stdio.h> | ||
|
||
// LINKARGS: --wrap=arg1 | ||
void arg1(int x) { | ||
printf("arg1"); | ||
} | ||
|
||
// LINKARGS: --wrap=foo | ||
void foo() { | ||
printf("foo"); | ||
} | ||
|
||
// LINKARGS: --wrap=return_val | ||
int return_val() { | ||
printf("return_val"); | ||
return 1; | ||
} | ||
|