rs6000: Fix wrong RTL patterns for vector merge high/low word on LE
[official-gcc.git] / gcc / testsuite / jit.dg / test-error-new-function-bad-kind.c
blobf9772de2b6f90d0a054cd0bea7bbf76d0dfd206b
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 *int_type =
12 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT);
14 /* Trigger an API error by passing bad data. */
15 (void)gcc_jit_context_new_function (
16 ctxt,
17 NULL,
19 /* Non-valid enum value: */
20 (enum gcc_jit_function_kind)42,
22 int_type, /* gcc_jit_type *return_type, */
23 "foo", /* const char *name, */
24 0, /* int num_params, */
25 NULL, /* gcc_jit_param **params, */
26 0); /* int is_variadic */
29 void
30 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
32 /* Ensure that the bad API usage prevents the API giving a bogus
33 result back. */
34 CHECK_VALUE (result, NULL);
36 /* Verify that the correct error message was emitted. */
37 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
38 ("gcc_jit_context_new_function:"
39 " unrecognized value for enum gcc_jit_function_kind: 42"));