jit: handle equality of function pointer types
[official-gcc.git] / gcc / testsuite / jit.dg / test-error-gcc_jit_type_get_vector-bad-type.c
blob59aed337184052b6befc925cc86087de15d2a1b9
1 #include <stdlib.h>
2 #include <stdio.h>
4 #include "libgccjit.h"
6 #include "harness.h"
8 void
9 create_code (gcc_jit_context *ctxt, void *user_data)
11 gcc_jit_type *void_type =
12 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
14 /* Trigger an API error by passing a bad type. */
15 (void)gcc_jit_type_get_vector (void_type, 4);
18 void
19 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
21 /* Ensure that the bad API usage prevents the API giving a bogus
22 result back. */
23 CHECK_VALUE (result, NULL);
25 /* Verify that the correct error message was emitted. */
26 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
27 ("gcc_jit_type_get_vector:"
28 " type is not integral or floating point: void"));