* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
[official-gcc.git] / gcc / testsuite / jit.dg / test-error-get-type-bad-enum.c
blob67b712ee1850915b3433165959dde2704ff422e4
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 /* Trigger an API error by passing bad data. */
12 gcc_jit_context_get_type (ctxt, 42);
15 void
16 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
18 /* Ensure that the bad API usage prevents the API giving a bogus
19 result back. */
20 CHECK_VALUE (result, NULL);
22 /* Verify that the correct error message was emitted. */
23 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
24 ("gcc_jit_context_get_type:"
25 " unrecognized value for enum gcc_jit_types: 42"));