Debian Codegraph @

gcc/testsuite/jit.dg/test-special-chars.c

raw
1 #include <stdlib.h>
2 #include <stdio.h>
3
4 #include "libgccjit.h"
5
6 #include "harness.h"
7
8 void
9 create_code (gcc_jit_context *ctxt, void *user_data)
10 {
11 gcc_jit_context_set_str_option (ctxt,
12 GCC_JIT_STR_OPTION_SPECIAL_CHARS_IN_FUNC_NAMES, "$.");
13
14 /* Let's try to inject the equivalent of:
15 void
16 name$with.special_chars (void)
17 {
18 }
19 */
20 gcc_jit_type *void_type =
21 gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID);
22
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_type,
28 "name$with.special_chars",
29 0, NULL,
30 0);
31
32 gcc_jit_block *block = gcc_jit_function_new_block (test_fn, NULL);
33 gcc_jit_block_end_with_void_return (
34 block, NULL);
35 }
36
37 void
38 verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
39 {
40 CHECK_NON_NULL (result);
41 }