1 /* { dg-do compile { target x86_64-*-* } } */
8 #define TEST_ESCHEWS_SET_OPTIONS
9 static void set_options (gcc_jit_context
*ctxt
, const char *argv0
)
12 gcc_jit_context_set_int_option(ctxt
, GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL
, 2);
15 #define TEST_COMPILING_TO_FILE
16 #define OUTPUT_KIND GCC_JIT_OUTPUT_KIND_ASSEMBLER
17 #define OUTPUT_FILENAME "output-of-test-cold-attribute.c.s"
21 create_code (gcc_jit_context
*ctxt
, void *user_data
)
23 /* Let's try to inject the equivalent of:
25 __attribute__ ((cold))
32 gcc_jit_type
*int_type
=
33 gcc_jit_context_get_type (ctxt
, GCC_JIT_TYPE_INT
);
35 gcc_jit_function
*func_t
=
36 gcc_jit_context_new_function (ctxt
, NULL
,
37 GCC_JIT_FUNCTION_EXPORTED
,
42 gcc_jit_function_add_attribute(func_t
, GCC_JIT_FN_ATTRIBUTE_COLD
);
43 gcc_jit_block
*block
= gcc_jit_function_new_block (func_t
, NULL
);
44 gcc_jit_rvalue
*ret
= gcc_jit_context_new_rvalue_from_int (ctxt
,
48 gcc_jit_block_end_with_return (block
, NULL
, ret
);
51 /* { dg-final { jit-verify-output-file-was-created "" } } */
52 /* { dg-final { jit-verify-assembler-output "orl" } } */