]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add missing cast-void-not-allowed.c-expected
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 14 Sep 2021 21:28:43 +0000 (23:28 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 14 Sep 2021 23:12:22 +0000 (01:12 +0200)
tests/semantic/cast-void-not-allowed.c-expected [new file with mode: 0644]

diff --git a/tests/semantic/cast-void-not-allowed.c-expected b/tests/semantic/cast-void-not-allowed.c-expected
new file mode 100644 (file)
index 0000000..93f9145
--- /dev/null
@@ -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 <glib.h>
+
+#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;
+}
+