1 // This header provides replacements for certain libc functions. It is necessary
2 // in order to safely run the tests on aarch64, because the system libc might
3 // not have been compiled with -ffixed-x18.
13 size_t scs_strlen(const char *p
) {
20 // We mark this function as noinline to make sure that its callers do not
21 // become leaf functions as a result of inlining. This is because we want to
22 // make sure that we generate the correct code for non-leaf functions.
24 __attribute__((noinline
)) void scs_fputs_stdout(const char *p
) {
26 "mov x0, #1\n" // stdout
29 "mov x8, #64\n" // write
32 : "x0", "x1", "x2", "x8");
36 #error Unsupported platform