We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parents6a43f3c +0d861b7 commit3149201Copy full SHA for 3149201
runners/bench_runner.c
@@ -123,8 +123,13 @@ typedef struct bench_id {
123
124
125
// bench suites are linked into a custom ld section
126
+#if defined(__APPLE__)
127
+externstructbench_suite__start__bench_suites __asm("section$start$__DATA$_bench_suites");
128
+externstructbench_suite__stop__bench_suites __asm("section$end$__DATA$_bench_suites");
129
+#else
130
externstructbench_suite__start__bench_suites;
131
externstructbench_suite__stop__bench_suites;
132
+#endif
133
134
conststructbench_suite*bench_suites=&__start__bench_suites;
135
#defineBENCH_SUITE_COUNT \
runners/test_runner.c
@@ -136,8 +136,13 @@ typedef struct test_id {
136
137
138
// test suites are linked into a custom ld section
139
140
+externstructtest_suite__start__test_suites __asm("section$start$__DATA$_test_suites");
141
+externstructtest_suite__stop__test_suites __asm("section$end$__DATA$_test_suites");
142
143
externstructtest_suite__start__test_suites;
144
externstructtest_suite__stop__test_suites;
145
146
147
conststructtest_suite*test_suites=&__start__test_suites;
148
#defineTEST_SUITE_COUNT \
scripts/bench.py
@@ -404,12 +404,15 @@ def write_case_functions(f, suite, case):
404
f.writeln()
405
406
# create suite struct
407
-#
+f.writeln('#if defined(__APPLE__)')
408
+f.writeln('__attribute__((section("__DATA,_bench_suites")))')
409
+f.writeln('#else')
410
# note we place this in the custom bench_suites section with
411
# minimum alignment, otherwise GCC ups the alignment to
412
# 32-bytes for some reason
413
f.writeln('__attribute__((section("_bench_suites"), '
414
'aligned(1)))')
415
+f.writeln('#endif')
416
f.writeln('const struct bench_suite __bench__%s__suite = {'
417
%suite.name)
418
f.writeln(4*' '+'.name = "%s",'%suite.name)
scripts/test.py
@@ -412,12 +412,15 @@ def write_case_functions(f, suite, case):
+f.writeln('__attribute__((section("__DATA,_test_suites")))')
# note we place this in the custom test_suites section with
419
420
421
f.writeln('__attribute__((section("_test_suites"), '
422
423
424
f.writeln('const struct test_suite __test__%s__suite = {'
425
426