From: Rico Tzschichholz Date: Tue, 14 Sep 2021 21:28:43 +0000 (+0200) Subject: tests: Add missing cast-void-not-allowed.c-expected X-Git-Tag: 0.54.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17a848662c80fb42c0fb7e693a39d9cea2b67677;p=thirdparty%2Fvala.git tests: Add missing cast-void-not-allowed.c-expected --- diff --git a/tests/semantic/cast-void-not-allowed.c-expected b/tests/semantic/cast-void-not-allowed.c-expected new file mode 100644 index 000000000..93f91458f --- /dev/null +++ b/tests/semantic/cast-void-not-allowed.c-expected @@ -0,0 +1,50 @@ +/* semantic_cast_void_not_allowed.c generated by valac, the Vala compiler + * generated from semantic_cast_void_not_allowed.vala, do not modify */ + +#include + +#if !defined(VALA_EXTERN) +#if defined(_MSC_VER) +#define VALA_EXTERN __declspec(dllexport) extern +#elif __GNUC__ >= 4 +#define VALA_EXTERN __attribute__((visibility("default"))) extern +#else +#define VALA_EXTERN extern +#endif +#endif + +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +VALA_EXTERN gboolean success; +gboolean success = FALSE; + +VALA_EXTERN gboolean foo (void); +static void _vala_main (void); + +gboolean +foo (void) +{ + gboolean result = FALSE; + success = TRUE; + result = TRUE; + return result; +} + +static void +_vala_main (void) +{ + foo (); + _vala_assert (success, "success"); +} + +int +main (int argc, + char ** argv) +{ + _vala_main (); + return 0; +} +