libgo: update to Go1.10beta1
[official-gcc.git] / gcc / testsuite / jit.dg / test-error-unterminated-block.c
blob491f09f12a31194270341937717260d80af00081
1 #include <math.h>
2 #include <stdlib.h>
3 #include <stdio.h>
5 #include "libgccjit.h"
7 #include "harness.h"
9 void
10 create_code (gcc_jit_context *ctxt, void *user_data)
12 /* Let's try to inject the equivalent of:
13 void
14 test_fn ()
16 initial:
18 with an unterminated block.
20 gcc_jit_type *void_t =
21 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
23 /* Build the test_fn. */
24 gcc_jit_function *test_fn =
25 gcc_jit_context_new_function (ctxt, NULL,
26 GCC_JIT_FUNCTION_EXPORTED,
27 void_t,
28 "test_fn",
29 0, NULL,
30 0);
31 (void)gcc_jit_function_new_block (test_fn, "initial");
32 /* Error: the above block isn't terminated. */
35 void
36 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
38 CHECK_VALUE (result, NULL);
40 CHECK_STRING_VALUE (gcc_jit_context_get_first_error (ctxt),
41 "unterminated block in test_fn: initial");