aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/jit.dg
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2015-01-09 20:10:11 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2015-01-09 20:10:11 +0000
commitccce3b2ac3c9352501278d36b3c79f049234870b (patch)
tree61e9e361de747f905be63bd0d96940d2f0d1c39b /gcc/testsuite/jit.dg
parent486b97f297eb20c5b72140ea257ff63143a69ab7 (diff)
downloadgcc-ccce3b2ac3c9352501278d36b3c79f049234870b.zip
gcc-ccce3b2ac3c9352501278d36b3c79f049234870b.tar.gz
gcc-ccce3b2ac3c9352501278d36b3c79f049234870b.tar.bz2
New jit API entrypoint: gcc_jit_context_new_rvalue_from_long
gcc/jit/ChangeLog: * docs/cp/topics/expressions.rst (Simple expressions): Use ":c:type:" for C types. Document new overload of gcc::jit::context::new_rvalue. * docs/topics/expressions.rst (Simple expressions): Use ":c:type:" for C types. Document new entrypoint gcc_jit_context_new_rvalue_from_long. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-playback.c: Within namespace gcc::jit::playback... (context::new_rvalue_from_int): Eliminate in favor of... (context::new_rvalue_from_const <int>): ...this. (context::new_rvalue_from_double): Eliminate in favor of... (context::new_rvalue_from_const <double>): ...this. (context::new_rvalue_from_const <long>): New. (context::new_rvalue_from_ptr): Eliminate in favor of... (context::new_rvalue_from_const <void *>): ...this. * jit-playback.h: Within namespace gcc::jit::playback... (context::new_rvalue_from_int): Eliminate in favor of... (context::new_rvalue_from_const <HOST_TYPE>): ...this. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise. * jit-recording.c: Within namespace gcc::jit::recording... (context::new_rvalue_from_int): Eliminate. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise. (class memento_of_new_rvalue_from_const <int>): Add explicit specialization. (class memento_of_new_rvalue_from_const <long>): Likewise. (class memento_of_new_rvalue_from_const <double>): Likewise. (class memento_of_new_rvalue_from_const <void *>): Likewise. (memento_of_new_rvalue_from_int::replay_into): Generalize into... (memento_of_new_rvalue_from_const <HOST_TYPE>::replay_into): ...this... (memento_of_new_rvalue_from_double::replay_into): ...allowing this... (memento_of_new_rvalue_from_ptr::replay_into): ...and this to be deleted. (memento_of_new_rvalue_from_int::make_debug_string): Convert to... (memento_of_new_rvalue_from_const <int>::make_debug_string): ...this. (memento_of_new_rvalue_from_double::make_debug_string): Convert to... (memento_of_new_rvalue_from_const <double>::make_debug_string): ...this. (memento_of_new_rvalue_from_ptr::make_debug_string) Convert to... (memento_of_new_rvalue_from_const <void *>::make_debug_string): ...this. (memento_of_new_rvalue_from_const <long>::make_debug_string): New function. * jit-recording.h: Within namespace gcc::jit::recording... (context::new_rvalue_from_int): Eliminate. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise, all in favor of... (context::new_rvalue_from_const <HOST_TYPE>): New family of methods. (class memento_of_new_rvalue_from_int): Eliminate. (class memento_of_new_rvalue_from_double): Likewise. (class memento_of_new_rvalue_from_ptr): Likewise. (class memento_of_new_rvalue_from_const <HOST_TYPE>): New family of rvalue subclasses. * libgccjit++.h (gccjit::context::new_rvalue): New overload, for "long". * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for rewriting of recording::context::new_rvalue_from_int to recording::context::new_rvalue_from_const <int>. (gcc_jit_context_new_rvalue_from_long): New API entrypoint. (gcc_jit_context_new_rvalue_from_double): Update for rewriting of recording::context::new_rvalue_from_double to recording::context::new_rvalue_from_const <double>. (gcc_jit_context_new_rvalue_from_ptr): Update for rewriting of recording::context::new_rvalue_from_ptr to recording::context::new_rvalue_from_const <void *>. * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API entrypoint. * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise. gcc/testsuite/ChangeLog: * jit.dg/all-non-failing-tests.h: Add test-constants.c. * jit.dg/test-combination.c (create_code): Likewise. (verify_code): Likewise. * jit.dg/test-constants.c: New test case. * jit.dg/test-threads.c: Add test-constants.c. From-SVN: r219401
Diffstat (limited to 'gcc/testsuite/jit.dg')
-rw-r--r--gcc/testsuite/jit.dg/all-non-failing-tests.h7
-rw-r--r--gcc/testsuite/jit.dg/test-combination.c2
-rw-r--r--gcc/testsuite/jit.dg/test-threads.c3
3 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h
index beb3d13..14211af 100644
--- a/gcc/testsuite/jit.dg/all-non-failing-tests.h
+++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h
@@ -57,6 +57,13 @@
#undef create_code
#undef verify_code
+/* test-constants.c */
+#define create_code create_code_constants
+#define verify_code verify_code_constants
+#include "test-constants.c"
+#undef create_code
+#undef verify_code
+
/* test-dot-product.c */
#define create_code create_code_dot_product
#define verify_code verify_code_dot_product
diff --git a/gcc/testsuite/jit.dg/test-combination.c b/gcc/testsuite/jit.dg/test-combination.c
index e99f4d0..5131613 100644
--- a/gcc/testsuite/jit.dg/test-combination.c
+++ b/gcc/testsuite/jit.dg/test-combination.c
@@ -22,6 +22,7 @@ create_code (gcc_jit_context *ctxt, void * user_data)
create_code_arrays (ctxt, user_data);
create_code_calling_external_function (ctxt, user_data);
create_code_calling_function_ptr (ctxt, user_data);
+ create_code_constants (ctxt, user_data);
create_code_dot_product (ctxt, user_data);
create_code_expressions (ctxt, user_data);
create_code_factorial (ctxt, user_data);
@@ -50,6 +51,7 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
verify_code_arrays (ctxt, result);
verify_code_calling_external_function (ctxt, result);
verify_code_calling_function_ptr (ctxt, result);
+ verify_code_constants (ctxt, result);
verify_code_dot_product (ctxt, result);
verify_code_expressions (ctxt, result);
verify_code_factorial (ctxt, result);
diff --git a/gcc/testsuite/jit.dg/test-threads.c b/gcc/testsuite/jit.dg/test-threads.c
index cd5ef6a..13e414db 100644
--- a/gcc/testsuite/jit.dg/test-threads.c
+++ b/gcc/testsuite/jit.dg/test-threads.c
@@ -122,6 +122,9 @@ const struct testcase testcases[] = {
{"calling_function_ptr",
create_code_calling_function_ptr,
verify_code_calling_function_ptr},
+ {"constants",
+ create_code_constants,
+ verify_code_constants},
{"dot_product",
create_code_dot_product,
verify_code_dot_product},