diff options
Diffstat (limited to 'roms/skiboot/ccan/build_assert/test')
4 files changed, 38 insertions, 0 deletions
diff --git a/roms/skiboot/ccan/build_assert/test/compile_fail-expr.c b/roms/skiboot/ccan/build_assert/test/compile_fail-expr.c new file mode 100644 index 000000000..109215b8a --- /dev/null +++ b/roms/skiboot/ccan/build_assert/test/compile_fail-expr.c @@ -0,0 +1,10 @@ +#include <ccan/build_assert/build_assert.h> + +int main(int argc, char *argv[]) +{ +#ifdef FAIL + return BUILD_ASSERT_OR_ZERO(1 == 0); +#else + return 0; +#endif +} diff --git a/roms/skiboot/ccan/build_assert/test/compile_fail.c b/roms/skiboot/ccan/build_assert/test/compile_fail.c new file mode 100644 index 000000000..37d95eddc --- /dev/null +++ b/roms/skiboot/ccan/build_assert/test/compile_fail.c @@ -0,0 +1,9 @@ +#include <ccan/build_assert/build_assert.h> + +int main(int argc, char *argv[]) +{ +#ifdef FAIL + BUILD_ASSERT(1 == 0); +#endif + return 0; +} diff --git a/roms/skiboot/ccan/build_assert/test/compile_ok.c b/roms/skiboot/ccan/build_assert/test/compile_ok.c new file mode 100644 index 000000000..4105484d1 --- /dev/null +++ b/roms/skiboot/ccan/build_assert/test/compile_ok.c @@ -0,0 +1,7 @@ +#include <ccan/build_assert/build_assert.h> + +int main(int argc, char *argv[]) +{ + BUILD_ASSERT(1 == 1); + return 0; +} diff --git a/roms/skiboot/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c b/roms/skiboot/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c new file mode 100644 index 000000000..77bf94c8a --- /dev/null +++ b/roms/skiboot/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c @@ -0,0 +1,12 @@ +#include <ccan/build_assert/build_assert.h> +#include <ccan/tap/tap.h> + +int __attribute__((const)) main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + plan_tests(1); + ok1(BUILD_ASSERT_OR_ZERO(1 == 1) == 0); + return exit_status(); +} |