Convert infer c++ tests to new format

Reviewed By: jberdine

Differential Revision: D3803636

fbshipit-source-id: 5cc201d
master
Cristiano Calcagno 8 years ago committed by Facebook Github Bot 6
parent ab70143e1b
commit 0b7ea202db

@ -12,6 +12,7 @@ DIRECT_TESTS=
TARGETS_TO_TEST= TARGETS_TO_TEST=
ifeq ($(BUILD_C_ANALYZERS),yes) ifeq ($(BUILD_C_ANALYZERS),yes)
TARGETS_TO_TEST += c cpp TARGETS_TO_TEST += c cpp
DIRECT_TESTS += cpp_infer_test
endif endif
ifeq ($(BUILD_JAVA_ANALYZERS),yes) ifeq ($(BUILD_JAVA_ANALYZERS),yes)
TARGETS_TO_TEST += java TARGETS_TO_TEST += java
@ -97,6 +98,9 @@ endif
ocaml_unit_test: test_this_build ocaml_unit_test: test_this_build
$(TEST_BUILD_DIR)/unit/inferunit.byte $(TEST_BUILD_DIR)/unit/inferunit.byte
cpp_infer_test:
make -C ./infer/tests/codetoanalyze/cpp/errors test
java_checkers_test: java_checkers_test:
make -C ./infer/tests/codetoanalyze/java/checkers test make -C ./infer/tests/codetoanalyze/java/checkers test

@ -191,3 +191,21 @@ let stats () => {
Config.developer_mode ? Some (Marshal.data_size (Marshal.to_bytes attr_tbl []) 0 / 1024) : None; Config.developer_mode ? Some (Marshal.data_size (Marshal.to_bytes attr_tbl []) 0 / 1024) : None;
{num_bindings, num_buckets, max_bucket_length, serialized_size_kb} {num_bindings, num_buckets, max_bucket_length, serialized_size_kb}
}; };
/* Find the file where the procedure is defined according to the attributes,
if a cfg for that file exist. */
let file_defining_procedure pname =>
switch (load_attributes pname) {
| None => None
| Some proc_attributes =>
let loc = proc_attributes.ProcAttributes.loc;
let source_file = loc.file;
let source_dir = DB.source_dir_from_source_file source_file;
let cfg_fname = DB.source_dir_get_internal_file source_dir ".cfg";
let cfg_fname_exists = Sys.file_exists (DB.filename_to_string cfg_fname);
if cfg_fname_exists {
Some source_file
} else {
None
}
};

@ -41,6 +41,10 @@ let get_correct_type_from_objc_class_name: Typename.t => option Typ.t;
/** Returns true if the method is defined as a C++ model */ /** Returns true if the method is defined as a C++ model */
let pname_is_cpp_model: Procname.t => bool; let pname_is_cpp_model: Procname.t => bool;
/* Find the file where the procedure is defined according to the attributes,
if a cfg for that file exist. */
let file_defining_procedure: Procname.t => option DB.source_file;
let is_whitelisted_cpp_method: string => bool; let is_whitelisted_cpp_method: string => bool;
type t; type t;

@ -73,6 +73,14 @@ let add_node g n defined::defined =>
Procname.Hash.add g.node_map n info Procname.Hash.add g.node_map n info
}; };
let remove_node_defined g n =>
try {
let info = Procname.Hash.find g.node_map n;
info.defined = false
} {
| Not_found => ()
};
let add_defined_node g n => add_node g n defined::true; let add_defined_node g n => add_node g n defined::true;

@ -119,6 +119,10 @@ let load_from_file: DB.filename => option t;
let node_defined: t => Procname.t => bool; let node_defined: t => Procname.t => bool;
/** Remove the defined flag from a node, if it exists. */
let remove_node_defined: t => Procname.t => unit;
/** Print the current call graph as a dotty file. If the filename is [None], /** Print the current call graph as a dotty file. If the filename is [None],
use the current file dir inside the DB dir. */ use the current file dir inside the DB dir. */
let save_call_graph_dotty: option DB.filename => (Procname.t => list 'a) => t => unit; let save_call_graph_dotty: option DB.filename => (Procname.t => list 'a) => t => unit;

@ -54,7 +54,7 @@ let analyze_exe_env exe_env => {
/** Create an exe_env from a cluster. */ /** Create an exe_env from a cluster. */
let exe_env_from_cluster cluster => { let exe_env_from_cluster cluster => {
let _exe_env = Exe_env.create (); let _exe_env = Exe_env.create ();
ignore (Exe_env.add_cg _exe_env cluster); Exe_env.add_cg _exe_env cluster;
Exe_env.freeze _exe_env Exe_env.freeze _exe_env
}; };

@ -619,6 +619,11 @@ and changed_files_index =
CLOpt.mk_string_opt ~long:"changed-files-index" ~exes:CLOpt.[Toplevel] ~meta:"file" CLOpt.mk_string_opt ~long:"changed-files-index" ~exes:CLOpt.[Toplevel] ~meta:"file"
"Specify the file containing the list of files from which reactive analysis should start" "Specify the file containing the list of files from which reactive analysis should start"
and check_duplicate_symbols =
CLOpt.mk_bool ~long:"check-duplicate-symbols"
~exes:CLOpt.[Analyze]
"Check if a symbol with the same name is defined in more than one file."
and clang_include_to_override = and clang_include_to_override =
CLOpt.mk_string_opt ~long:"clang-include-to-override" ~meta:"dir" CLOpt.mk_string_opt ~long:"clang-include-to-override" ~meta:"dir"
"Use this option in the uncommon case where the normal compilation process overrides the \ "Use this option in the uncommon case where the normal compilation process overrides the \
@ -639,10 +644,6 @@ and cluster =
CLOpt.mk_string_opt ~deprecated:["cluster"] ~long:"cluster" CLOpt.mk_string_opt ~deprecated:["cluster"] ~long:"cluster"
~meta:"file" "Specify a .cluster file to be analyzed" ~meta:"file" "Specify a .cluster file to be analyzed"
and code_query =
CLOpt.mk_string_opt ~deprecated:["codequery"] ~long:"code-query"
~meta:"query" "Execute the code query"
(** Continue the capture for reactive mode: (** Continue the capture for reactive mode:
If a procedure was changed beforehand, keep the changed marking. *) If a procedure was changed beforehand, keep the changed marking. *)
and continue = and continue =
@ -1360,6 +1361,7 @@ and bugs_txt = !bugs_txt
and bugs_xml = !bugs_xml and bugs_xml = !bugs_xml
and changed_files_index = !changed_files_index and changed_files_index = !changed_files_index
and calls_csv = !calls_csv and calls_csv = !calls_csv
and check_duplicate_symbols = !check_duplicate_symbols
and checkers = !checkers and checkers = !checkers
(** should the checkers be run? *) (** should the checkers be run? *)
@ -1367,7 +1369,6 @@ and checkers_enabled = not (!eradicate || !crashcontext || !quandary)
and clang_include_to_override = !clang_include_to_override and clang_include_to_override = !clang_include_to_override
and clang_lang = !clang_lang and clang_lang = !clang_lang
and cluster_cmdline = !cluster and cluster_cmdline = !cluster
and code_query = !code_query
and continue_capture = !continue and continue_capture = !continue
and copy_propagation = !copy_propagation and copy_propagation = !copy_propagation
and crashcontext = !crashcontext and crashcontext = !crashcontext

@ -164,12 +164,12 @@ val bugs_txt : outfile option
val bugs_xml : outfile option val bugs_xml : outfile option
val changed_files_index : string option val changed_files_index : string option
val calls_csv : outfile option val calls_csv : outfile option
val check_duplicate_symbols : bool
val checkers : bool val checkers : bool
val checkers_enabled : bool val checkers_enabled : bool
val clang_include_to_override : string option val clang_include_to_override : string option
val clang_lang : clang_lang val clang_lang : clang_lang
val cluster_cmdline : string option val cluster_cmdline : string option
val code_query : string option
val continue_capture : bool val continue_capture : bool
val copy_propagation : bool val copy_propagation : bool
val crashcontext : bool val crashcontext : bool

@ -73,38 +73,31 @@ let add_cg (exe_env: t) (source_dir : DB.source_dir) =
let cg_fname = DB.source_dir_get_internal_file source_dir ".cg" in let cg_fname = DB.source_dir_get_internal_file source_dir ".cg" in
match Cg.load_from_file cg_fname with match Cg.load_from_file cg_fname with
| None -> | None ->
L.stderr "cannot load %s@." (DB.filename_to_string cg_fname); L.stderr "cannot load %s@." (DB.filename_to_string cg_fname)
None
| Some cg -> | Some cg ->
let source = Cg.get_source cg in let source = Cg.get_source cg in
exe_env.source_files <- DB.SourceFileSet.add source exe_env.source_files; exe_env.source_files <- DB.SourceFileSet.add source exe_env.source_files;
let nLOC = Cg.get_nLOC cg in let nLOC = Cg.get_nLOC cg in
Cg.extend exe_env.cg cg;
let file_data = new_file_data source nLOC cg_fname in let file_data = new_file_data source nLOC cg_fname in
let defined_procs = Cg.get_defined_nodes cg in let defined_procs = Cg.get_defined_nodes cg in
(* Find the file where `pname` is defined according to the attributes,
if a cfg for that file exist. *)
let defined_in_according_to_attributes pname =
match AttributesTable.load_attributes pname with
| None ->
None
| Some proc_attributes ->
let loc = proc_attributes.ProcAttributes.loc in
let source_file = loc.Location.file in
let source_dir = DB.source_dir_from_source_file source_file in
let cfg_fname = DB.source_dir_get_internal_file source_dir ".cfg" in
let cfg_fname_exists = Sys.file_exists (DB.filename_to_string cfg_fname) in
if cfg_fname_exists
then Some source_file
else None in
IList.iter IList.iter
(fun pname -> (fun pname ->
if (defined_in_according_to_attributes pname = None) (match AttributesTable.file_defining_procedure pname with
then Procname.Hash.replace exe_env.proc_map pname file_data) | None ->
Procname.Hash.replace exe_env.proc_map pname file_data
| Some source_defined ->
let multiply_defined = DB.source_file_compare source source_defined <> 0 in
if multiply_defined then Cg.remove_node_defined cg pname;
if Config.check_duplicate_symbols &&
multiply_defined then
L.stderr "@.DUPLICATE_SYMBOLS source: %s source_defined:%s pname:%a@."
(DB.source_file_to_string source)
(DB.source_file_to_string source_defined)
Procname.pp pname
))
defined_procs; defined_procs;
Some cg Cg.extend exe_env.cg cg
(** get the global call graph *) (** get the global call graph *)
let get_cg exe_env = let get_cg exe_env =

@ -26,7 +26,7 @@ val create : unit -> initial
(** add call graph from the source dir in the spec db, (** add call graph from the source dir in the spec db,
with relative tenv and cfg, to the execution environment *) with relative tenv and cfg, to the execution environment *)
val add_cg : initial -> DB.source_dir -> Cg.t option val add_cg : initial -> DB.source_dir -> unit
(** get the global call graph *) (** get the global call graph *)
val get_cg : t -> Cg.t val get_cg : t -> Cg.t

@ -458,10 +458,15 @@ let write_html_file linereader filename cfg =
let (fd, fmt) = let (fd, fmt) =
Io_infer.Html.create DB.Results_dir.Abs_source_dir [".."; fname_encoding] in Io_infer.Html.create DB.Results_dir.Abs_source_dir [".."; fname_encoding] in
let do_proc proof_cover table_nodes_at_linenum global_err_log proc_name proc_desc = let do_proc proof_cover table_nodes_at_linenum global_err_log proc_name proc_desc =
(* add the err_log of this proc to [global_err_log] *)
let proc_loc = (Cfg.Procdesc.get_loc proc_desc) in let proc_loc = (Cfg.Procdesc.get_loc proc_desc) in
if Cfg.Procdesc.is_defined proc_desc && let process_proc =
(DB.source_file_equal proc_loc.Location.file !DB.current_source) then Cfg.Procdesc.is_defined proc_desc &&
DB.source_file_equal proc_loc.Location.file !DB.current_source &&
match AttributesTable.file_defining_procedure proc_name with
| None -> true
| Some source_file ->
DB.source_file_equal source_file (Cfg.Procdesc.get_loc proc_desc).file in
if process_proc then
begin begin
IList.iter (process_node table_nodes_at_linenum) (Cfg.Procdesc.get_nodes proc_desc); IList.iter (process_node table_nodes_at_linenum) (Cfg.Procdesc.get_nodes proc_desc);
match Specs.get_summary proc_name with match Specs.get_summary proc_name with

@ -9,7 +9,6 @@ java_test(
java_test( java_test(
name='cpp_tests', name='cpp_tests',
deps=[ deps=[
'//infer/tests/endtoend:cpp_endtoend_tests',
'//infer/tests/frontend:cpp_frontend_tests', '//infer/tests/frontend:cpp_frontend_tests',
], ],
) )

@ -0,0 +1,58 @@
# Copyright (c) 2016 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
ROOT_DIR = ../../../../..
include $(ROOT_DIR)/Makefile.config
OPTIONS = -x c++ -std=c++11 -isystem$(CLANG_INCLUDES)/c++/v1/ -c
default: compile
print: analyze
$(INFERPRINT_BIN) -q -a $(ANALYZER) --issues-tests issues.exp.test
LC_ALL=C sort -o issues.exp.test issues.exp.test
test: analyze print
make clean
diff -u issues.exp issues.exp.test
rm issues.exp.test
ANALYZER = infer
FILES = \
attributes/*.cpp \
conditional/*.cpp \
constructors/*.cpp \
c_tests/*.cpp \
exceptions/*.cpp \
include_header/header.h \
include_header/include_templ.cpp \
lambda/*.cpp \
memory_leaks/*.cpp \
methods/*.cpp \
models/*.cpp \
namespace/*.cpp \
nestedoperators/*.cpp \
npe/*.cpp \
numeric/*.cpp \
reference/*.cpp \
resource_leaks/*.cpp \
smart_ptr/*.cpp \
subtyping/*.cpp \
templates/*.cpp \
types/*.cpp \
vector/*.cpp \
compile:
clang $(OPTIONS) $(FILES)
analyze:
$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cpp --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt
grep "DUPLICATE_SYMBOLS" duplicates.txt; true
clean:
rm -rf *.o infer-out duplicates.txt

@ -0,0 +1 @@
../../frontend/attributes/deprecated_hack.cpp

@ -0,0 +1 @@
../../frontend/conditional/lvalue_conditional.cpp

@ -0,0 +1 @@
../../frontend/constructors/constructor_init.cpp

@ -0,0 +1 @@
../../frontend/constructors/constructor_new.cpp

@ -0,0 +1 @@
../../frontend/constructors/constructor_with_body.cpp

@ -0,0 +1 @@
../../frontend/constructors/copy_move_constructor.cpp

@ -0,0 +1 @@
../../frontend/constructors/temp_object.cpp

@ -0,0 +1 @@
../../frontend/exceptions/Exceptions.cpp

@ -0,0 +1,27 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace header {
struct A {
int div0() { return 1 / 0; }
};
template <class T>
struct B {
int div0() { return 1 / 0; }
};
int div0_fun() { return 1 / 0; }
template <class T>
int div0_templ() {
return 1 / 0;
}
}

@ -0,0 +1,27 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace header2 {
struct A {
int div0() { return 1 / 0; }
};
template <class T>
struct B {
int div0() { return 1 / 0; }
};
int div0_fun() { return 1 / 0; }
template <class T>
int div0_templ() {
return 1 / 0;
}
}

@ -0,0 +1,25 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "header2.h"
// instantiate templates to produce bug reports for them
void div0_B_int() {
B<int> b;
b.div0();
}
void div0_B_A() {
B<A> b;
b.div0();
}
void div0_templ_int() { div0_templ<int>(); }
int div0_templ_A() { div0_templ<A>(); }

@ -0,0 +1,272 @@
attributes/deprecated_hack.cpp, derefFirstArg2_null_deref, 2, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, derefFirstArg3_null_deref, 2, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, derefFirstArg_null_deref, 2, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, getPtr_null_deref1, 3, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, getPtr_null_deref2, 3, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, getRef_null_deref1, 3, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, getRef_null_deref2, 3, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, operator_star_null_deref1, 3, NULL_DEREFERENCE
attributes/deprecated_hack.cpp, operator_star_null_deref2, 3, NULL_DEREFERENCE
c_tests/c_bugs.cpp, crash_fgetc, 4, NULL_DEREFERENCE
c_tests/c_bugs.cpp, crash_getc, 4, NULL_DEREFERENCE
c_tests/c_bugs.cpp, malloc_fail_gets_reported, 2, NULL_DEREFERENCE
c_tests/c_bugs.cpp, malloc_memory_leak_is_reported, 0, MEMORY_LEAK
c_tests/c_bugs.cpp, memcpy_spec_is_found, 3, NULL_DEREFERENCE
c_tests/c_bugs.cpp, resource_leak_is_reported, 0, RESOURCE_LEAK
c_tests/c_bugs.cpp, resource_leak_is_reported, 0, RETURN_VALUE_IGNORED
conditional/lvalue_conditional.cpp, div0_assign_conditional, 0, DIVIDE_BY_ZERO
conditional/lvalue_conditional.cpp, div0_choose_lvalue, 0, DIVIDE_BY_ZERO
conditional/lvalue_conditional.cpp, div0_choose_rvalue, 0, DIVIDE_BY_ZERO
conditional/lvalue_conditional.cpp, div0_temp_lvalue, 0, DIVIDE_BY_ZERO
constructors/constructor_init.cpp, delegate_constr_f2_div0, 3, DIVIDE_BY_ZERO
constructors/constructor_init.cpp, delegate_constr_f_div0, 3, DIVIDE_BY_ZERO
constructors/constructor_init.cpp, f2_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_init.cpp, f_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_init.cpp, t_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::array_of_class_with_not_constant_size, 1, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::array_of_person_with_constant_size, 0, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::constructor_1_arg_new_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::constructor_1_arg_new_div0, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::constructor_3_args_new_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::constructor_3_args_new_div0, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::constructor_nodes, 3, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::constructor_nodes, 3, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::float_init_number, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::float_init_number, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_array, 4, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_array, 4, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_array_init, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_array_init, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_init_empty, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_init_empty, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_init_empty_list, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_init_empty_list_new, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_init_empty_list_new, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_init_nodes, 3, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_init_nodes, 4, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_init_nodes, 4, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::int_init_number, 2, DIVIDE_BY_ZERO
constructors/constructor_new.cpp, constructor_new::int_init_number, 2, MEMORY_LEAK
constructors/constructor_new.cpp, constructor_new::matrix_of_person, 2, MEMORY_LEAK
constructors/constructor_with_body.cpp, constructor_with_body::test_div0, 2, DIVIDE_BY_ZERO
constructors/constructor_with_body.cpp, constructor_with_body::test_div0_default_constructor, 2, DIVIDE_BY_ZERO
constructors/copy_move_constructor.cpp, copy_move_constructor::copyX_div0, 4, DIVIDE_BY_ZERO
constructors/copy_move_constructor.cpp, copy_move_constructor::copyY_div0, 4, DIVIDE_BY_ZERO
constructors/copy_move_constructor.cpp, copy_move_constructor::moveX_div0, 0, DIVIDE_BY_ZERO
constructors/copy_move_constructor.cpp, copy_move_constructor::moveY_div0, 0, DIVIDE_BY_ZERO
constructors/copy_move_constructor.cpp, copy_move_constructor::moveY_moveY_copyY_div0, 3, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::assign_temp_div0, 2, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::getX_field_div0, 0, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::getX_method_div0, 0, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::temp_field2_div0, 0, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::temp_field_div0, 0, DIVIDE_BY_ZERO
constructors/temp_object.cpp, temp_object::temp_method_div0, 0, DIVIDE_BY_ZERO
exceptions/Exceptions.cpp, call_deref_with_null, 0, NULL_DEREFERENCE
include_header/header.h, header::A_div0, 0, DIVIDE_BY_ZERO
include_header/header.h, header::div0_fun, 0, DIVIDE_BY_ZERO
include_header/header2.h, header2::B<A>_div0, 0, DIVIDE_BY_ZERO
include_header/header2.h, header2::B<int>_div0, 0, DIVIDE_BY_ZERO
include_header/header2.h, header2::div0_templ<A>, 1, DIVIDE_BY_ZERO
include_header/header2.h, header2::div0_templ<int>, 1, DIVIDE_BY_ZERO
lambda/lambda1.cpp, bar, 5, DIVIDE_BY_ZERO
lambda/lambda1.cpp, foo, 3, DIVIDE_BY_ZERO
lambda/lambda1.cpp, foo::lambda_lambda_lambda1.cpp:19:17_operator(), 0, DIVIDE_BY_ZERO
memory_leaks/array_leak.cpp, leak, 4, MEMORY_LEAK
memory_leaks/object_leak.cpp, object_leak, 0, MEMORY_LEAK
memory_leaks/raii_malloc.cpp, memory_leak, 0, MEMORY_LEAK
methods/conversion_operator.cpp, conversion_operator::branch_div0, 4, DIVIDE_BY_ZERO
methods/conversion_operator.cpp, conversion_operator::y_branch_div0, 6, DIVIDE_BY_ZERO
methods/static.cpp, div0_class, 0, DIVIDE_BY_ZERO
methods/static.cpp, div0_instance, 2, DIVIDE_BY_ZERO
methods/virtual_methods.cpp, poly_area, 3, DIVIDE_BY_ZERO
methods/virtual_methods.cpp, rect_area, 4, DIVIDE_BY_ZERO
methods/virtual_methods.cpp, tri_area, 5, DIVIDE_BY_ZERO
methods/virtual_methods.cpp, tri_not_virtual_area, 5, DIVIDE_BY_ZERO
models/move.cpp, move::div0_moved_from, 3, DIVIDE_BY_ZERO
models/move.cpp, move::div0_moved_to, 3, DIVIDE_BY_ZERO
namespace/function.cpp, div0_namespace_resolution, 0, DIVIDE_BY_ZERO
namespace/function.cpp, div0_using, 2, DIVIDE_BY_ZERO
namespace/global_variable.cpp, div0_namepace_res, 3, DIVIDE_BY_ZERO
namespace/global_variable.cpp, div0_static_field, 3, DIVIDE_BY_ZERO
namespace/global_variable.cpp, div0_static_field_member_access, 3, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, conditional_init_div0, 2, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, function_call_init_div0, 2, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, reference_init_div0, 5, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, simple_inif_elseif_div0, 6, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, simple_init_div0, 4, DIVIDE_BY_ZERO
nestedoperators/var_decl_inside_if.cpp, simple_init_null_deref, 4, NULL_DEREFERENCE
npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_field_deref, 2, NULL_DEREFERENCE
npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_method_deref, 2, NULL_DEREFERENCE
npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_method_deref2, 2, NULL_DEREFERENCE
npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_result_method_null_deref, 4, NULL_DEREFERENCE
npe/method_call.cpp, npe_call, 2, NULL_DEREFERENCE
npe/method_call.cpp, npe_call_after_call, 0, NULL_DEREFERENCE
npe/method_call.cpp, npe_call_with_forward_declaration, 1, NULL_DEREFERENCE
npe/npe_added_to_b1.cpp, npe_added_to_b1::causes_npe, 2, NULL_DEREFERENCE
npe/npe_added_to_b1.cpp, npe_added_to_b1::causes_npe_person, 2, NULL_DEREFERENCE
npe/null_returned_by_method.cpp, testNullDeref, 3, NULL_DEREFERENCE
npe/object_deref.cpp, object_deref::derefNullField, 2, NULL_DEREFERENCE
npe/skip_function_with_const_formals.cpp, const_skip2_then_split_case, 5, MEMORY_LEAK
npe/skip_function_with_const_formals.cpp, const_skip_then_split_case, 6, MEMORY_LEAK
npe/skip_function_with_const_formals.cpp, skip_then_split_case, 2, MEMORY_LEAK
npe/skip_function_with_const_formals.cpp, skip_then_split_case, 5, NULL_DEREFERENCE
npe/skip_function_with_const_formals.cpp, typedef_skip_then_split_case, 2, MEMORY_LEAK
npe/skip_function_with_const_formals.cpp, typedef_skip_then_split_case, 4, NULL_DEREFERENCE
numeric/min_max.cpp, max_X_inv_div0, 2, DIVIDE_BY_ZERO
numeric/min_max.cpp, max_int_div0, 0, DIVIDE_BY_ZERO
numeric/min_max.cpp, min_X_div0, 2, DIVIDE_BY_ZERO
numeric/min_max.cpp, min_int_div0, 0, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ptr_F_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ptr_I_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ptr_getF_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ptr_getI_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ref_F_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ref_I_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ref_getF_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::ref_getI_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::val_F_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::val_I_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::val_getF_div0, 5, DIVIDE_BY_ZERO
reference/reference_field.cpp, reference_field::val_getI_div0, 5, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, field_div0_ptr, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, field_div0_ref, 2, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, get_global_ptr_div0_field, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, get_global_ptr_div0_method, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, get_global_ref_div0_field, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, get_global_ref_div0_method, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, method_div0_ptr, 3, DIVIDE_BY_ZERO
reference/reference_struct_e2e.cpp, method_div0_ref, 2, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ptr_div0, 4, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ptr_div0_function, 3, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ptr_div0_function_temp_var, 4, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ref_div0, 4, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ref_div0_function, 3, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ref_div0_function_temp_var, 4, DIVIDE_BY_ZERO
reference/reference_type_e2e.cpp, ref_div0_nested_assignment, 6, DIVIDE_BY_ZERO
reference/temporary_lvalue.cpp, div0_function_param_cast, 0, DIVIDE_BY_ZERO
reference/temporary_lvalue.cpp, div0_init_expr, 2, DIVIDE_BY_ZERO
reference/temporary_lvalue.cpp, div0_no_const_ref, 2, DIVIDE_BY_ZERO
resource_leaks/raii.cpp, resource_leak, 7, RESOURCE_LEAK
smart_ptr/deref_after_move_example.cpp, deref_after_mode_example::deref_after_move_crash, 4, NULL_DEREFERENCE
smart_ptr/deref_after_move_example.cpp, deref_after_mode_example::deref_after_move_ok, 4, MEMORY_LEAK
smart_ptr/deref_after_move_example.cpp, deref_after_mode_example::deref_ok, 3, MEMORY_LEAK
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_base1_null_f1_deref, 6, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_base1_nullptr_deref, 0, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_base2_null_f1_deref, 6, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_base2_nullptr_deref, 0, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived1_null_f1_deref, 6, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived1_nullptr_deref, 0, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived2_null_f1_deref, 6, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived2_nullptr_deref, 0, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived3_null_f1_deref, 6, NULL_DEREFERENCE
smart_ptr/shared_ptr_constructors.cpp, shared_ptr_constructors::get_from_derived3_nullptr_deref, 0, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::empty_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::empty_ptr_field_deref, 2, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::empty_ptr_field_deref2, 2, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::empty_ptr_method_deref, 2, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::nullptr_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref, 2, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref, 3, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref2, 2, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref2, 3, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref2, 4, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref, 4, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref2, 5, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_null_deref, 3, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_null_deref, 4, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_ok_deref, 6, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_copy_null_deref, 3, NULL_DEREFERENCE
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_copy_ok_deref, 4, MEMORY_LEAK
smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_move_null_deref, 3, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_array_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_ptr_field_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_ptr_field_deref2, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_ptr_method_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::nullptr_array_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::nullptr_ptr_deref, 2, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref, 2, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref, 3, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref2, 2, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref2, 3, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref2, 4, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref, 4, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref2, 5, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_null_deref, 3, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_null_deref, 4, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_ok_deref, 6, MEMORY_LEAK
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_copy_null_deref, 3, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_null_deref, 3, NULL_DEREFERENCE
smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_ok_deref, 4, MEMORY_LEAK
subtyping/cast_with_enforce.cpp, cast_with_enforce::cast_with_npe, 3, NULL_DEREFERENCE
subtyping/dynamic_cast.cpp, dynamic__cast::rightPointerCast, 4, DIVIDE_BY_ZERO
subtyping/dynamic_cast.cpp, dynamic__cast::rightPointerCast, 4, MEMORY_LEAK
subtyping/dynamic_cast.cpp, dynamic__cast::rightReferenceCast, 2, MEMORY_LEAK
subtyping/dynamic_cast.cpp, dynamic__cast::wrongCastOfArgumentPointer, 2, DIVIDE_BY_ZERO
subtyping/dynamic_cast.cpp, dynamic__cast::wrongCastOfArgumentReference, 2, CLASS_CAST_EXCEPTION
subtyping/dynamic_cast.cpp, dynamic__cast::wrongPointerCast, 2, MEMORY_LEAK
subtyping/dynamic_cast.cpp, dynamic__cast::wrongPointerCast, 6, DIVIDE_BY_ZERO
subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCast, 3, CLASS_CAST_EXCEPTION
subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCastNotAssigned, 3, CLASS_CAST_EXCEPTION
subtyping/subtyping_check.cpp, B_setFG, 4, DIVIDE_BY_ZERO
templates/class_template_instantiate.cpp, ExecStore<Choose2>_call_div, 2, DIVIDE_BY_ZERO
templates/class_template_instantiate.cpp, choose1_div0, 0, DIVIDE_BY_ZERO
templates/class_template_instantiate.cpp, choose2_div0_extra, 0, DIVIDE_BY_ZERO
templates/function.cpp, function::createAndDiv<X3>, 1, DIVIDE_BY_ZERO
templates/function.cpp, function::div0_create_and_get_val, 1, DIVIDE_BY_ZERO
templates/function.cpp, function::div0_get_val, 3, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_10args, 0, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_1arg, 0, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_3args1, 0, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_3args2, 0, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_3args3, 0, DIVIDE_BY_ZERO
templates/function_pack.cpp, div0_3args4, 0, DIVIDE_BY_ZERO
templates/method.cpp, method::div0_getter, 3, DIVIDE_BY_ZERO
templates/method.cpp, method::div0_getter_templ, 4, DIVIDE_BY_ZERO
templates/method.cpp, method::div0_getter_templ2, 4, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_b1, 2, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_b1_s, 3, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_b2, 2, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_cast, 3, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_cast_ref, 3, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_s, 2, DIVIDE_BY_ZERO
types/inheritance_field.cpp, div0_s_b1, 3, DIVIDE_BY_ZERO
types/operator_overload.cpp, div0_function_op, 3, DIVIDE_BY_ZERO
types/operator_overload.cpp, div0_inheritted_op, 2, DIVIDE_BY_ZERO
types/operator_overload.cpp, div0_method, 3, DIVIDE_BY_ZERO
types/operator_overload.cpp, div0_method_op, 3, DIVIDE_BY_ZERO
types/operator_overload.cpp, div0_method_op_ptr, 0, DIVIDE_BY_ZERO
types/return_struct.cpp, return_struct::get_div0, 2, DIVIDE_BY_ZERO
types/return_struct.cpp, return_struct::get_field_div0, 2, DIVIDE_BY_ZERO
types/return_struct.cpp, return_struct::get_method_div0, 0, DIVIDE_BY_ZERO
types/struct_forward_declare.cpp, struct_forward_declare::X_Y_div0, 7, DIVIDE_BY_ZERO
types/struct_forward_declare.cpp, struct_forward_declare::X_div0, 3, DIVIDE_BY_ZERO
types/struct_forward_declare.cpp, struct_forward_declare::X_ptr_div0, 2, DIVIDE_BY_ZERO
types/struct_forward_declare.cpp, struct_forward_declare::Z_div0, 3, DIVIDE_BY_ZERO
types/struct_forward_declare.cpp, struct_forward_declare::Z_ptr_div0, 5, DIVIDE_BY_ZERO
types/struct_pass_by_value.cpp, struct_pass_by_value::field_div0, 3, DIVIDE_BY_ZERO
types/struct_pass_by_value.cpp, struct_pass_by_value::param_get_copied_div0, 3, DIVIDE_BY_ZERO
types/struct_pass_by_value.cpp, struct_pass_by_value::temp_div0, 0, DIVIDE_BY_ZERO
types/struct_pass_by_value.cpp, struct_pass_by_value::var_div0, 2, DIVIDE_BY_ZERO
types/typeid_expr.cpp, employee_typeid, 3, MEMORY_LEAK
types/typeid_expr.cpp, employee_typeid, 4, DIVIDE_BY_ZERO
types/typeid_expr.cpp, person_ptr_typeid, 2, MEMORY_LEAK
types/typeid_expr.cpp, person_ptr_typeid, 3, DIVIDE_BY_ZERO
types/typeid_expr.cpp, person_typeid, 3, MEMORY_LEAK
types/typeid_expr.cpp, person_typeid, 6, DIVIDE_BY_ZERO
types/typeid_expr.cpp, person_typeid_name, 3, MEMORY_LEAK
types/typeid_expr.cpp, person_typeid_name, 4, MEMORY_LEAK
types/typeid_expr.cpp, person_typeid_name, 8, DIVIDE_BY_ZERO
types/typeid_expr.cpp, template_type_id_person, 2, MEMORY_LEAK
types/typeid_expr.cpp, template_type_id_person, 5, DIVIDE_BY_ZERO
types/typeid_expr.cpp, template_typeid<Person>, 2, MEMORY_LEAK
vector/empty_access.cpp, access_empty, 2, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, assign_empty, 4, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, clear_empty, 3, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, copy_empty, 3, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, empty_check_access_empty, 2, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, getter_empty, 0, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, size_check0_empty, 2, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, vector_as_param_by_value_empty, 2, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, vector_as_param_clear, 3, EMPTY_VECTOR_ACCESS
vector/empty_access.cpp, vector_as_param_empty, 2, EMPTY_VECTOR_ACCESS

@ -0,0 +1 @@
../../frontend/lambda/lambda1.cpp

@ -15,7 +15,4 @@ class Rectangle {
int area(void) { return width * height; } int area(void) { return width * height; }
}; };
int main() { void object_leak() { Rectangle* bar = new Rectangle(5, 6); }
Rectangle* bar = new Rectangle(5, 6);
return 0;
}

@ -0,0 +1 @@
../../frontend/methods/conversion_operator.cpp

@ -0,0 +1 @@
../../frontend/methods/static.cpp

@ -0,0 +1 @@
../../frontend/methods/virtual_methods.cpp

@ -9,6 +9,8 @@
#include <utility> #include <utility>
namespace move {
struct X { struct X {
X() : f(1) {} X() : f(1) {}
X(X&& x) { X(X&& x) {
@ -41,3 +43,4 @@ int div0_moved_to() {
X x2 = std::move(x1); X x2 = std::move(x1);
return 1 / (x2.f - 1); return 1 / (x2.f - 1);
} }
}

@ -0,0 +1 @@
../../frontend/namespace/function.cpp

@ -0,0 +1 @@
../../frontend/namespace/global_variable.cpp

@ -0,0 +1 @@
../../frontend/nestedoperators/var_decl_inside_if.cpp

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace boxed_ptr {
struct X { struct X {
int field; int field;
int* getPtr() { return &field; } int* getPtr() { return &field; }
@ -62,3 +64,4 @@ void smart_ptr_result_method_ok_deref() {
p.data = &x; p.data = &x;
int f = *(p.get()->getPtr()); int f = *(p.get()->getPtr());
} }
}

@ -9,6 +9,8 @@
#include <memory> #include <memory>
namespace npe_added_to_b1 {
int deref_ref(std::shared_ptr<int>& p) { return *p; } int deref_ref(std::shared_ptr<int>& p) { return *p; }
int causes_npe() { int causes_npe() {
@ -28,3 +30,4 @@ int causes_npe_person() {
Person p; Person p;
return deref_person(p); return deref_person(p);
} }
}

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace object_deref {
class X { class X {
public: public:
int field; int field;
@ -26,3 +28,4 @@ void derefNonNullField() {
X* x = getNonNull(); X* x = getNonNull();
int c = x->field; int c = x->field;
} }
}

@ -0,0 +1 @@
../../frontend/reference/reference_field.cpp

@ -0,0 +1 @@
../../frontend/reference/reference_struct_e2e.cpp

@ -0,0 +1 @@
../../frontend/reference/reference_type_e2e.cpp

@ -0,0 +1 @@
../../frontend/reference/temporary_lvalue.cpp

@ -35,5 +35,3 @@ void no_resource_leak(const char* filename) {
OpenFile f(filename); OpenFile f(filename);
return; return;
} }
int main() {}

@ -9,6 +9,8 @@
#include <memory> #include <memory>
namespace deref_after_mode_example {
struct Person { struct Person {
std::unique_ptr<int> age{new int(35)}; std::unique_ptr<int> age{new int(35)};
std::unique_ptr<int> move_age() { return std::move(age); } std::unique_ptr<int> move_age() { return std::move(age); }
@ -32,3 +34,4 @@ int deref_after_move_ok() {
auto x = p.move_age(); auto x = p.move_age();
return *x; return *x;
} }
}

@ -9,6 +9,8 @@
#include <memory> #include <memory>
namespace shared_ptr_constructors {
struct Base { struct Base {
int* f1; int* f1;
}; };
@ -95,3 +97,4 @@ void get_from_derived3_null_f1_deref() {
b.f1 = nullptr; b.f1 = nullptr;
int r = *(p->f1); int r = *(p->f1);
} }
}

@ -9,6 +9,8 @@
#include <memory> #include <memory>
namespace shared_ptr {
struct X { struct X {
int field; int field;
int get() { return field; } int get() { return field; }
@ -127,3 +129,4 @@ int shared_ptr_check_null2(std::shared_ptr<int> p) {
return 1; return 1;
return *p; return *p;
} }
}

@ -9,6 +9,8 @@
#include <memory> #include <memory>
namespace unique_ptr {
struct X { struct X {
int field; int field;
int get() { return field; } int get() { return field; }
@ -117,3 +119,4 @@ int unique_ptr_move_null_deref() {
std::unique_ptr<int> p2 = std::move(p1); std::unique_ptr<int> p2 = std::move(p1);
return *p1; return *p1;
} }
}

@ -9,6 +9,8 @@
#include <stdexcept> #include <stdexcept>
namespace cast_with_enforce {
class WrongParameterException : public std::runtime_error { class WrongParameterException : public std::runtime_error {
public: public:
WrongParameterException(bool e, const char* msg) : std::runtime_error(msg){}; WrongParameterException(bool e, const char* msg) : std::runtime_error(msg){};
@ -53,3 +55,4 @@ int cast_with_npe() {
auto derived = dynamic_cast<Derived*>(&base); auto derived = dynamic_cast<Derived*>(&base);
return derived->a; // npe return derived->a; // npe
} }
}

@ -1,50 +1,50 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
38 [label="38: DeclStmt \n _fun_Base_Base(&base:class Base *) [line 52]\n " shape="box"] 38 [label="38: DeclStmt \n _fun_cast_with_enforce::Base_Base(&base:class cast_with_enforce::Base *) [line 54]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: DeclStmt \n n$2=_fun___cast(&base:class Base *,sizeof(class Derived ( sub )(cast)):void ) [line 53]\n *&derived:class Derived *=n$2 [line 53]\n " shape="box"] 37 [label="37: DeclStmt \n n$2=_fun___cast(&base:class cast_with_enforce::Base *,sizeof(class cast_with_enforce::Derived ( sub )(cast)):void ) [line 55]\n *&derived:class cast_with_enforce::Derived *=n$2 [line 55]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: Return Stmt \n n$0=*&derived:class Derived * [line 54]\n n$1=*n$0.a:int [line 54]\n *&return:int =n$1 [line 54]\n " shape="box"] 36 [label="36: Return Stmt \n n$0=*&derived:class cast_with_enforce::Derived * [line 56]\n n$1=*n$0.a:int [line 56]\n *&return:int =n$1 [line 56]\n " shape="box"]
36 -> 35 ; 36 -> 35 ;
35 [label="35: Exit cast_with_npe \n " color=yellow style=filled] 35 [label="35: Exit cast_with_enforce::cast_with_npe \n " color=yellow style=filled]
34 [label="34: Start cast_with_npe\nFormals: \nLocals: derived:class Derived * base:class Base \n DECLARE_LOCALS(&return,&derived,&base); [line 51]\n " color=yellow style=filled] 34 [label="34: Start cast_with_enforce::cast_with_npe\nFormals: \nLocals: derived:class cast_with_enforce::Derived * base:class cast_with_enforce::Base \n DECLARE_LOCALS(&return,&derived,&base); [line 53]\n " color=yellow style=filled]
34 -> 38 ; 34 -> 38 ;
33 [label="33: DeclStmt \n _fun_Base_Base(&base:class Base *) [line 44]\n " shape="box"] 33 [label="33: DeclStmt \n _fun_cast_with_enforce::Base_Base(&base:class cast_with_enforce::Base *) [line 46]\n " shape="box"]
33 -> 32 ; 33 -> 32 ;
32 [label="32: DeclStmt \n n$10=_fun___cast(&base:class Base *,sizeof(class Derived ( sub )(cast)):void ) [line 45]\n *&derived:class Derived *=n$10 [line 45]\n " shape="box"] 32 [label="32: DeclStmt \n n$10=_fun___cast(&base:class cast_with_enforce::Base *,sizeof(class cast_with_enforce::Derived ( sub )(cast)):void ) [line 47]\n *&derived:class cast_with_enforce::Derived *=n$10 [line 47]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: DeclStmt \n *&_tmp:class Derived *&=&derived [line 46]\n " shape="box"] 31 [label="31: DeclStmt \n *&_tmp:class cast_with_enforce::Derived *&=&derived [line 48]\n " shape="box"]
31 -> 27 ; 31 -> 27 ;
31 -> 28 ; 31 -> 28 ;
30 [label="30: ConditinalStmt Branch \n _fun_WrongParameterException_WrongParameterException(&0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException *,\"derived\":_Bool ,\"Base is not Derived\":char *) [line 46]\n _fun_WrongParameterException_WrongParameterException(&0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException *,&0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException &) [line 46]\n _fun___infer_objc_cpp_throw(&0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException ) [line 46]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *&=-1 [line 46]\n " shape="box"] 30 [label="30: ConditinalStmt Branch \n _fun_cast_with_enforce::WrongParameterException_WrongParameterException(&0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException *,\"derived\":_Bool ,\"Base is not Derived\":char *) [line 48]\n _fun_cast_with_enforce::WrongParameterException_WrongParameterException(&0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException *,&0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException &) [line 48]\n _fun___infer_objc_cpp_throw(&0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException ) [line 48]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *&=-1 [line 48]\n " shape="box"]
30 -> 26 ; 30 -> 26 ;
29 [label="29: ConditinalStmt Branch \n n$5=*&_tmp:class Derived *& [line 46]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *&=n$5 [line 46]\n " shape="box"] 29 [label="29: ConditinalStmt Branch \n n$5=*&_tmp:class cast_with_enforce::Derived *& [line 48]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *&=n$5 [line 48]\n " shape="box"]
29 -> 26 ; 29 -> 26 ;
28 [label="28: Prune (false branch) \n n$3=*&_tmp:class Derived *& [line 46]\n n$4=*n$3:class Derived * [line 46]\n PRUNE((n$4 == 0), false); [line 46]\n " shape="invhouse"] 28 [label="28: Prune (false branch) \n n$3=*&_tmp:class cast_with_enforce::Derived *& [line 48]\n n$4=*n$3:class cast_with_enforce::Derived * [line 48]\n PRUNE((n$4 == 0), false); [line 48]\n " shape="invhouse"]
28 -> 30 ; 28 -> 30 ;
27 [label="27: Prune (true branch) \n n$3=*&_tmp:class Derived *& [line 46]\n n$4=*n$3:class Derived * [line 46]\n PRUNE((n$4 != 0), true); [line 46]\n " shape="invhouse"] 27 [label="27: Prune (true branch) \n n$3=*&_tmp:class cast_with_enforce::Derived *& [line 48]\n n$4=*n$3:class cast_with_enforce::Derived * [line 48]\n PRUNE((n$4 != 0), true); [line 48]\n " shape="invhouse"]
27 -> 29 ; 27 -> 29 ;
@ -52,39 +52,39 @@ digraph iCFG {
26 -> 25 ; 26 -> 25 ;
25 [label="25: Return Stmt \n n$0=*&derived:class Derived * [line 47]\n n$1=*n$0.a:int [line 47]\n *&return:int =n$1 [line 47]\n " shape="box"] 25 [label="25: Return Stmt \n n$0=*&derived:class cast_with_enforce::Derived * [line 49]\n n$1=*n$0.a:int [line 49]\n *&return:int =n$1 [line 49]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit cast_with_npe_avoided_by_enforce \n " color=yellow style=filled] 24 [label="24: Exit cast_with_enforce::cast_with_npe_avoided_by_enforce \n " color=yellow style=filled]
23 [label="23: Start cast_with_npe_avoided_by_enforce\nFormals: \nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *& 0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException 0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException _tmp:class Derived *& derived:class Derived * base:class Base \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$2,&0$?%__sil_tmp__temp_construct_n$6,&0$?%__sil_tmpSIL_materialize_temp__n$7,&_tmp,&derived,&base); [line 43]\n " color=yellow style=filled] 23 [label="23: Start cast_with_enforce::cast_with_npe_avoided_by_enforce\nFormals: \nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *& 0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException 0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException _tmp:class cast_with_enforce::Derived *& derived:class cast_with_enforce::Derived * base:class cast_with_enforce::Base \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$2,&0$?%__sil_tmp__temp_construct_n$6,&0$?%__sil_tmpSIL_materialize_temp__n$7,&_tmp,&derived,&base); [line 45]\n " color=yellow style=filled]
23 -> 33 ; 23 -> 33 ;
22 [label="22: DeclStmt \n n$10=*&certificate:class Base & [line 38]\n n$11=_fun___cast(n$10:class Base *,sizeof(class Derived ( sub )(cast)):void ) [line 38]\n *&cert:class Derived *=n$11 [line 38]\n " shape="box"] 22 [label="22: DeclStmt \n n$10=*&certificate:class cast_with_enforce::Base & [line 40]\n n$11=_fun___cast(n$10:class cast_with_enforce::Base *,sizeof(class cast_with_enforce::Derived ( sub )(cast)):void ) [line 40]\n *&cert:class cast_with_enforce::Derived *=n$11 [line 40]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: DeclStmt \n *&_tmp:class Derived *&=&cert [line 39]\n " shape="box"] 21 [label="21: DeclStmt \n *&_tmp:class cast_with_enforce::Derived *&=&cert [line 41]\n " shape="box"]
21 -> 17 ; 21 -> 17 ;
21 -> 18 ; 21 -> 18 ;
20 [label="20: ConditinalStmt Branch \n _fun_WrongParameterException_WrongParameterException(&0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException *,\"cert\":_Bool ,\"Base is not Derived\":char *) [line 39]\n _fun_WrongParameterException_WrongParameterException(&0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException *,&0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException &) [line 39]\n _fun___infer_objc_cpp_throw(&0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException ) [line 39]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *&=-1 [line 39]\n " shape="box"] 20 [label="20: ConditinalStmt Branch \n _fun_cast_with_enforce::WrongParameterException_WrongParameterException(&0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException *,\"cert\":_Bool ,\"Base is not Derived\":char *) [line 41]\n _fun_cast_with_enforce::WrongParameterException_WrongParameterException(&0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException *,&0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException &) [line 41]\n _fun___infer_objc_cpp_throw(&0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException ) [line 41]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *&=-1 [line 41]\n " shape="box"]
20 -> 16 ; 20 -> 16 ;
19 [label="19: ConditinalStmt Branch \n n$5=*&_tmp:class Derived *& [line 39]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *&=n$5 [line 39]\n " shape="box"] 19 [label="19: ConditinalStmt Branch \n n$5=*&_tmp:class cast_with_enforce::Derived *& [line 41]\n *&0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *&=n$5 [line 41]\n " shape="box"]
19 -> 16 ; 19 -> 16 ;
18 [label="18: Prune (false branch) \n n$3=*&_tmp:class Derived *& [line 39]\n n$4=*n$3:class Derived * [line 39]\n PRUNE((n$4 == 0), false); [line 39]\n " shape="invhouse"] 18 [label="18: Prune (false branch) \n n$3=*&_tmp:class cast_with_enforce::Derived *& [line 41]\n n$4=*n$3:class cast_with_enforce::Derived * [line 41]\n PRUNE((n$4 == 0), false); [line 41]\n " shape="invhouse"]
18 -> 20 ; 18 -> 20 ;
17 [label="17: Prune (true branch) \n n$3=*&_tmp:class Derived *& [line 39]\n n$4=*n$3:class Derived * [line 39]\n PRUNE((n$4 != 0), true); [line 39]\n " shape="invhouse"] 17 [label="17: Prune (true branch) \n n$3=*&_tmp:class cast_with_enforce::Derived *& [line 41]\n n$4=*n$3:class cast_with_enforce::Derived * [line 41]\n PRUNE((n$4 != 0), true); [line 41]\n " shape="invhouse"]
17 -> 19 ; 17 -> 19 ;
@ -92,57 +92,57 @@ digraph iCFG {
16 -> 15 ; 16 -> 15 ;
15 [label="15: Return Stmt \n n$0=*&cert:class Derived * [line 40]\n n$1=*n$0.a:int [line 40]\n *&return:int =n$1 [line 40]\n " shape="box"] 15 [label="15: Return Stmt \n n$0=*&cert:class cast_with_enforce::Derived * [line 42]\n n$1=*n$0.a:int [line 42]\n *&return:int =n$1 [line 42]\n " shape="box"]
15 -> 14 ; 15 -> 14 ;
14 [label="14: Exit cast_with_no_npe \n " color=yellow style=filled] 14 [label="14: Exit cast_with_enforce::cast_with_no_npe \n " color=yellow style=filled]
13 [label="13: Start cast_with_no_npe\nFormals: certificate:class Base &\nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$2:class Derived *& 0$?%__sil_tmp__temp_construct_n$6:class WrongParameterException 0$?%__sil_tmpSIL_materialize_temp__n$7:class WrongParameterException _tmp:class Derived *& cert:class Derived * \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$2,&0$?%__sil_tmp__temp_construct_n$6,&0$?%__sil_tmpSIL_materialize_temp__n$7,&_tmp,&cert); [line 37]\n " color=yellow style=filled] 13 [label="13: Start cast_with_enforce::cast_with_no_npe\nFormals: certificate:class cast_with_enforce::Base &\nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$2:class cast_with_enforce::Derived *& 0$?%__sil_tmp__temp_construct_n$6:class cast_with_enforce::WrongParameterException 0$?%__sil_tmpSIL_materialize_temp__n$7:class cast_with_enforce::WrongParameterException _tmp:class cast_with_enforce::Derived *& cert:class cast_with_enforce::Derived * \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$2,&0$?%__sil_tmp__temp_construct_n$6,&0$?%__sil_tmpSIL_materialize_temp__n$7,&_tmp,&cert); [line 39]\n " color=yellow style=filled]
13 -> 22 ; 13 -> 22 ;
12 [label="12: Exit Base_Base \n " color=yellow style=filled] 12 [label="12: Exit cast_with_enforce::Base_Base \n " color=yellow style=filled]
11 [label="11: Start Base_Base\nFormals: this:class Base *\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] 11 [label="11: Start cast_with_enforce::Base_Base\nFormals: this:class cast_with_enforce::Base *\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled]
11 -> 12 ; 11 -> 12 ;
10 [label="10: Exit Base_dummy \n " color=yellow style=filled] 10 [label="10: Exit cast_with_enforce::Base_dummy \n " color=yellow style=filled]
9 [label="9: Start Base_dummy\nFormals: this:class Base *\nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled] 9 [label="9: Start cast_with_enforce::Base_dummy\nFormals: this:class cast_with_enforce::Base *\nLocals: \n DECLARE_LOCALS(&return); [line 29]\n " color=yellow style=filled]
9 -> 10 ; 9 -> 10 ;
8 [label="8: Exit WrongParameterException_~WrongParameterException \n " color=yellow style=filled] 8 [label="8: Exit cast_with_enforce::WrongParameterException_~WrongParameterException \n " color=yellow style=filled]
7 [label="7: Start WrongParameterException_~WrongParameterException\nFormals: this:class WrongParameterException *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 7 [label="7: Start cast_with_enforce::WrongParameterException_~WrongParameterException\nFormals: this:class cast_with_enforce::WrongParameterException *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
7 -> 8 ; 7 -> 8 ;
6 [label="6: Constructor Init \n n$0=*&this:class WrongParameterException * [line 12]\n n$1=*&__param_0:class WrongParameterException & [line 12]\n _fun_std::runtime_error_runtime_error(n$0:class WrongParameterException *,n$1:class std::runtime_error &) [line 12]\n " shape="box"] 6 [label="6: Constructor Init \n n$0=*&this:class cast_with_enforce::WrongParameterException * [line 14]\n n$1=*&__param_0:class cast_with_enforce::WrongParameterException & [line 14]\n _fun_std::runtime_error_runtime_error(n$0:class cast_with_enforce::WrongParameterException *,n$1:class std::runtime_error &) [line 14]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit WrongParameterException_WrongParameterException \n " color=yellow style=filled] 5 [label="5: Exit cast_with_enforce::WrongParameterException_WrongParameterException \n " color=yellow style=filled]
4 [label="4: Start WrongParameterException_WrongParameterException\nFormals: this:class WrongParameterException * __param_0:class WrongParameterException &\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 4 [label="4: Start cast_with_enforce::WrongParameterException_WrongParameterException\nFormals: this:class cast_with_enforce::WrongParameterException * __param_0:class cast_with_enforce::WrongParameterException &\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: Constructor Init \n n$0=*&this:class WrongParameterException * [line 14]\n n$1=*&msg:char * [line 14]\n _fun_std::runtime_error_runtime_error(n$0:class WrongParameterException *,n$1:char *) [line 14]\n " shape="box"] 3 [label="3: Constructor Init \n n$0=*&this:class cast_with_enforce::WrongParameterException * [line 16]\n n$1=*&msg:char * [line 16]\n _fun_std::runtime_error_runtime_error(n$0:class cast_with_enforce::WrongParameterException *,n$1:char *) [line 16]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit WrongParameterException_WrongParameterException \n " color=yellow style=filled] 2 [label="2: Exit cast_with_enforce::WrongParameterException_WrongParameterException \n " color=yellow style=filled]
1 [label="1: Start WrongParameterException_WrongParameterException\nFormals: this:class WrongParameterException * e:_Bool msg:char *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] 1 [label="1: Start cast_with_enforce::WrongParameterException_WrongParameterException\nFormals: this:class cast_with_enforce::WrongParameterException * e:_Bool msg:char *\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace dynamic__cast {
class Base { class Base {
virtual void dummy() {} virtual void dummy() {}
@ -73,3 +75,4 @@ void wrongReferenceCastNotAssigned() {
Base& pdd = *pbb; Base& pdd = *pbb;
dynamic_cast<Derived&>(pdd); dynamic_cast<Derived&>(pdd);
} }
}

@ -0,0 +1 @@
../../frontend/templates/class_template_instantiate.cpp

@ -0,0 +1 @@
../../frontend/templates/function.cpp

@ -0,0 +1 @@
../../frontend/templates/function_pack.cpp

@ -0,0 +1 @@
../../frontend/templates/method.cpp

@ -0,0 +1 @@
../../frontend/types/inheritance_field.cpp

@ -0,0 +1 @@
../../frontend/types/operator_overload.cpp

@ -0,0 +1 @@
../../frontend/types/return_struct.cpp

@ -0,0 +1 @@
../../frontend/types/struct_forward_declare.cpp

@ -0,0 +1 @@
../../frontend/types/struct_pass_by_value.cpp

@ -0,0 +1 @@
../../frontend/types/typeid_expr.cpp

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace constructor_new {
class Person { class Person {
public: public:
Person() { x = 0; } Person() { x = 0; }
@ -97,3 +99,4 @@ void matrix_of_person() {
Person** tarray = new Person*[10]; Person** tarray = new Person*[10];
tarray[0] = new Person[10]; tarray[0] = new Person[10];
} }
}

@ -1,52 +1,52 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
97 [label="97: DeclStmt \n n$2=_fun___new_array((sizeof(class Person *) * 10):unsigned long ) [line 97]\n *&tarray:class Person **=n$2 [line 97]\n " shape="box"] 97 [label="97: DeclStmt \n n$2=_fun___new_array((sizeof(class constructor_new::Person *) * 10):unsigned long ) [line 99]\n *&tarray:class constructor_new::Person **=n$2 [line 99]\n " shape="box"]
97 -> 96 ; 97 -> 96 ;
96 [label="96: BinaryOperatorStmt: Assign \n n$0=*&tarray:class Person ** [line 98]\n n$1=_fun___new_array((sizeof(class Person ) * 10):unsigned long ) [line 98]\n _fun_Person_Person(n$1[0]:class Person *) [line 98]\n _fun_Person_Person(n$1[1]:class Person *) [line 98]\n _fun_Person_Person(n$1[2]:class Person *) [line 98]\n _fun_Person_Person(n$1[3]:class Person *) [line 98]\n _fun_Person_Person(n$1[4]:class Person *) [line 98]\n _fun_Person_Person(n$1[5]:class Person *) [line 98]\n _fun_Person_Person(n$1[6]:class Person *) [line 98]\n _fun_Person_Person(n$1[7]:class Person *) [line 98]\n _fun_Person_Person(n$1[8]:class Person *) [line 98]\n _fun_Person_Person(n$1[9]:class Person *) [line 98]\n *n$0[0]:class Person *=n$1 [line 98]\n " shape="box"] 96 [label="96: BinaryOperatorStmt: Assign \n n$0=*&tarray:class constructor_new::Person ** [line 100]\n n$1=_fun___new_array((sizeof(class constructor_new::Person ) * 10):unsigned long ) [line 100]\n _fun_constructor_new::Person_Person(n$1[0]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[1]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[2]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[3]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[4]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[5]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[6]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[7]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[8]:class constructor_new::Person *) [line 100]\n _fun_constructor_new::Person_Person(n$1[9]:class constructor_new::Person *) [line 100]\n *n$0[0]:class constructor_new::Person *=n$1 [line 100]\n " shape="box"]
96 -> 95 ; 96 -> 95 ;
95 [label="95: Exit matrix_of_person \n " color=yellow style=filled] 95 [label="95: Exit constructor_new::matrix_of_person \n " color=yellow style=filled]
94 [label="94: Start matrix_of_person\nFormals: \nLocals: tarray:class Person ** \n DECLARE_LOCALS(&return,&tarray); [line 96]\n " color=yellow style=filled] 94 [label="94: Start constructor_new::matrix_of_person\nFormals: \nLocals: tarray:class constructor_new::Person ** \n DECLARE_LOCALS(&return,&tarray); [line 98]\n " color=yellow style=filled]
94 -> 97 ; 94 -> 97 ;
93 [label="93: DeclStmt \n n$0=_fun___new_array((sizeof(class Person ) * 10):unsigned long ) [line 93]\n _fun_Person_Person(n$0[0]:class Person *) [line 93]\n _fun_Person_Person(n$0[1]:class Person *) [line 93]\n _fun_Person_Person(n$0[2]:class Person *) [line 93]\n _fun_Person_Person(n$0[3]:class Person *) [line 93]\n _fun_Person_Person(n$0[4]:class Person *) [line 93]\n _fun_Person_Person(n$0[5]:class Person *) [line 93]\n _fun_Person_Person(n$0[6]:class Person *) [line 93]\n _fun_Person_Person(n$0[7]:class Person *) [line 93]\n _fun_Person_Person(n$0[8]:class Person *) [line 93]\n _fun_Person_Person(n$0[9]:class Person *) [line 93]\n *&tarray:class Person *=n$0 [line 93]\n " shape="box"] 93 [label="93: DeclStmt \n n$0=_fun___new_array((sizeof(class constructor_new::Person ) * 10):unsigned long ) [line 95]\n _fun_constructor_new::Person_Person(n$0[0]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[1]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[2]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[3]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[4]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[5]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[6]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[7]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[8]:class constructor_new::Person *) [line 95]\n _fun_constructor_new::Person_Person(n$0[9]:class constructor_new::Person *) [line 95]\n *&tarray:class constructor_new::Person *=n$0 [line 95]\n " shape="box"]
93 -> 92 ; 93 -> 92 ;
92 [label="92: Exit array_of_person_with_constant_size \n " color=yellow style=filled] 92 [label="92: Exit constructor_new::array_of_person_with_constant_size \n " color=yellow style=filled]
91 [label="91: Start array_of_person_with_constant_size\nFormals: \nLocals: tarray:class Person * \n DECLARE_LOCALS(&return,&tarray); [line 93]\n " color=yellow style=filled] 91 [label="91: Start constructor_new::array_of_person_with_constant_size\nFormals: \nLocals: tarray:class constructor_new::Person * \n DECLARE_LOCALS(&return,&tarray); [line 95]\n " color=yellow style=filled]
91 -> 93 ; 91 -> 93 ;
90 [label="90: DeclStmt \n n$2=*&0$?%__sil_tmpSIL_temp_conditional___n$0:int [line 89]\n n$3=_fun___new_array((sizeof(class Person ) * n$2):unsigned long ) [line 89]\n *&tarray:class Person *=n$3 [line 89]\n " shape="box"] 90 [label="90: DeclStmt \n n$2=*&0$?%__sil_tmpSIL_temp_conditional___n$0:int [line 91]\n n$3=_fun___new_array((sizeof(class constructor_new::Person ) * n$2):unsigned long ) [line 91]\n *&tarray:class constructor_new::Person *=n$3 [line 91]\n " shape="box"]
90 -> 83 ; 90 -> 83 ;
89 [label="89: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int =3 [line 89]\n " shape="box"] 89 [label="89: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int =3 [line 91]\n " shape="box"]
89 -> 84 ; 89 -> 84 ;
88 [label="88: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int =5 [line 89]\n " shape="box"] 88 [label="88: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int =5 [line 91]\n " shape="box"]
88 -> 84 ; 88 -> 84 ;
87 [label="87: Prune (false branch) \n PRUNE(((n$1 == 5) == 0), false); [line 89]\n " shape="invhouse"] 87 [label="87: Prune (false branch) \n PRUNE(((n$1 == 5) == 0), false); [line 91]\n " shape="invhouse"]
87 -> 89 ; 87 -> 89 ;
86 [label="86: Prune (true branch) \n PRUNE(((n$1 == 5) != 0), true); [line 89]\n " shape="invhouse"] 86 [label="86: Prune (true branch) \n PRUNE(((n$1 == 5) != 0), true); [line 91]\n " shape="invhouse"]
86 -> 88 ; 86 -> 88 ;
85 [label="85: BinaryOperatorStmt: EQ \n n$1=_fun_getValue(5:int ) [line 89]\n " shape="box"] 85 [label="85: BinaryOperatorStmt: EQ \n n$1=_fun_constructor_new::getValue(5:int ) [line 91]\n " shape="box"]
85 -> 86 ; 85 -> 86 ;
@ -55,49 +55,49 @@ digraph iCFG {
84 -> 90 ; 84 -> 90 ;
83 [label="83: Exit array_of_class_with_not_constant_size \n " color=yellow style=filled] 83 [label="83: Exit constructor_new::array_of_class_with_not_constant_size \n " color=yellow style=filled]
82 [label="82: Start array_of_class_with_not_constant_size\nFormals: \nLocals: tarray:class Person * 0$?%__sil_tmpSIL_temp_conditional___n$0:int \n DECLARE_LOCALS(&return,&tarray,&0$?%__sil_tmpSIL_temp_conditional___n$0); [line 88]\n " color=yellow style=filled] 82 [label="82: Start constructor_new::array_of_class_with_not_constant_size\nFormals: \nLocals: tarray:class constructor_new::Person * 0$?%__sil_tmpSIL_temp_conditional___n$0:int \n DECLARE_LOCALS(&return,&tarray,&0$?%__sil_tmpSIL_temp_conditional___n$0); [line 90]\n " color=yellow style=filled]
82 -> 85 ; 82 -> 85 ;
81 [label="81: DeclStmt \n n$10=_fun___new_array((sizeof(int ) * 100):unsigned long ) [line 83]\n *n$10[0]:int =1 [line 83]\n *n$10[1]:int =2 [line 83]\n *n$10[2]:int =3 [line 83]\n *n$10[3]:int =4 [line 83]\n *n$10[4]:int =5 [line 83]\n *n$10[5]:int =6 [line 83]\n *n$10[6]:int =7 [line 83]\n *n$10[7]:int =8 [line 83]\n *n$10[8]:int =9 [line 83]\n *n$10[9]:int =10 [line 83]\n *&arr:int *=n$10 [line 83]\n " shape="box"] 81 [label="81: DeclStmt \n n$10=_fun___new_array((sizeof(int ) * 100):unsigned long ) [line 85]\n *n$10[0]:int =1 [line 85]\n *n$10[1]:int =2 [line 85]\n *n$10[2]:int =3 [line 85]\n *n$10[3]:int =4 [line 85]\n *n$10[4]:int =5 [line 85]\n *n$10[5]:int =6 [line 85]\n *n$10[6]:int =7 [line 85]\n *n$10[7]:int =8 [line 85]\n *n$10[8]:int =9 [line 85]\n *n$10[9]:int =10 [line 85]\n *&arr:int *=n$10 [line 85]\n " shape="box"]
81 -> 80 ; 81 -> 80 ;
80 [label="80: Return Stmt \n n$0=*&arr:int * [line 84]\n n$1=*n$0[0]:int [line 84]\n n$2=*&arr:int * [line 84]\n n$3=*n$2[1]:int [line 84]\n n$4=*&arr:int * [line 84]\n n$5=*n$4[2]:int [line 84]\n n$6=*&arr:int * [line 84]\n n$7=*n$6[3]:int [line 84]\n n$8=*&arr:int * [line 84]\n n$9=*n$8[4]:int [line 84]\n *&return:int =(1 / (((((n$1 + n$3) + n$5) + n$7) + n$9) - 15)) [line 84]\n " shape="box"] 80 [label="80: Return Stmt \n n$0=*&arr:int * [line 86]\n n$1=*n$0[0]:int [line 86]\n n$2=*&arr:int * [line 86]\n n$3=*n$2[1]:int [line 86]\n n$4=*&arr:int * [line 86]\n n$5=*n$4[2]:int [line 86]\n n$6=*&arr:int * [line 86]\n n$7=*n$6[3]:int [line 86]\n n$8=*&arr:int * [line 86]\n n$9=*n$8[4]:int [line 86]\n *&return:int =(1 / (((((n$1 + n$3) + n$5) + n$7) + n$9) - 15)) [line 86]\n " shape="box"]
80 -> 79 ; 80 -> 79 ;
79 [label="79: Exit int_array_init \n " color=yellow style=filled] 79 [label="79: Exit constructor_new::int_array_init \n " color=yellow style=filled]
78 [label="78: Start int_array_init\nFormals: \nLocals: arr:int * \n DECLARE_LOCALS(&return,&arr); [line 82]\n " color=yellow style=filled] 78 [label="78: Start constructor_new::int_array_init\nFormals: \nLocals: arr:int * \n DECLARE_LOCALS(&return,&arr); [line 84]\n " color=yellow style=filled]
78 -> 81 ; 78 -> 81 ;
77 [label="77: DeclStmt \n n$9=*&0$?%__sil_tmpSIL_temp_conditional___n$6:int [line 76]\n n$10=_fun___new_array((sizeof(int ) * n$9):unsigned long ) [line 76]\n *&x2:int *=n$10 [line 76]\n " shape="box"] 77 [label="77: DeclStmt \n n$9=*&0$?%__sil_tmpSIL_temp_conditional___n$6:int [line 78]\n n$10=_fun___new_array((sizeof(int ) * n$9):unsigned long ) [line 78]\n *&x2:int *=n$10 [line 78]\n " shape="box"]
77 -> 70 ; 77 -> 70 ;
76 [label="76: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$6:int =3 [line 76]\n " shape="box"] 76 [label="76: ConditinalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$6:int =3 [line 78]\n " shape="box"]
76 -> 71 ; 76 -> 71 ;
75 [label="75: ConditinalStmt Branch \n n$8=_fun_getValue(5:int ) [line 76]\n *&0$?%__sil_tmpSIL_temp_conditional___n$6:int =n$8 [line 76]\n " shape="box"] 75 [label="75: ConditinalStmt Branch \n n$8=_fun_constructor_new::getValue(5:int ) [line 78]\n *&0$?%__sil_tmpSIL_temp_conditional___n$6:int =n$8 [line 78]\n " shape="box"]
75 -> 71 ; 75 -> 71 ;
74 [label="74: Prune (false branch) \n PRUNE((n$7 == 0), false); [line 76]\n " shape="invhouse"] 74 [label="74: Prune (false branch) \n PRUNE((n$7 == 0), false); [line 78]\n " shape="invhouse"]
74 -> 76 ; 74 -> 76 ;
73 [label="73: Prune (true branch) \n PRUNE((n$7 != 0), true); [line 76]\n " shape="invhouse"] 73 [label="73: Prune (true branch) \n PRUNE((n$7 != 0), true); [line 78]\n " shape="invhouse"]
73 -> 75 ; 73 -> 75 ;
72 [label="72: Call _fun_getValue \n n$7=_fun_getValue(5:int ) [line 76]\n " shape="box"] 72 [label="72: Call _fun_constructor_new::getValue \n n$7=_fun_constructor_new::getValue(5:int ) [line 78]\n " shape="box"]
72 -> 73 ; 72 -> 73 ;
@ -106,50 +106,50 @@ digraph iCFG {
71 -> 77 ; 71 -> 77 ;
70 [label="70: BinaryOperatorStmt: Assign \n n$5=*&x2:int * [line 77]\n *n$5[0]:int =1 [line 77]\n " shape="box"] 70 [label="70: BinaryOperatorStmt: Assign \n n$5=*&x2:int * [line 79]\n *n$5[0]:int =1 [line 79]\n " shape="box"]
70 -> 69 ; 70 -> 69 ;
69 [label="69: BinaryOperatorStmt: Assign \n n$4=*&x2:int * [line 78]\n *n$4[1]:int =2 [line 78]\n " shape="box"] 69 [label="69: BinaryOperatorStmt: Assign \n n$4=*&x2:int * [line 80]\n *n$4[1]:int =2 [line 80]\n " shape="box"]
69 -> 68 ; 69 -> 68 ;
68 [label="68: Return Stmt \n n$0=*&x2:int * [line 79]\n n$1=*n$0[0]:int [line 79]\n n$2=*&x2:int * [line 79]\n n$3=*n$2[1]:int [line 79]\n *&return:int =(1 / ((n$1 + n$3) - 3)) [line 79]\n " shape="box"] 68 [label="68: Return Stmt \n n$0=*&x2:int * [line 81]\n n$1=*n$0[0]:int [line 81]\n n$2=*&x2:int * [line 81]\n n$3=*n$2[1]:int [line 81]\n *&return:int =(1 / ((n$1 + n$3) - 3)) [line 81]\n " shape="box"]
68 -> 67 ; 68 -> 67 ;
67 [label="67: Exit int_array \n " color=yellow style=filled] 67 [label="67: Exit constructor_new::int_array \n " color=yellow style=filled]
66 [label="66: Start int_array\nFormals: \nLocals: x2:int * 0$?%__sil_tmpSIL_temp_conditional___n$6:int \n DECLARE_LOCALS(&return,&x2,&0$?%__sil_tmpSIL_temp_conditional___n$6); [line 75]\n " color=yellow style=filled] 66 [label="66: Start constructor_new::int_array\nFormals: \nLocals: x2:int * 0$?%__sil_tmpSIL_temp_conditional___n$6:int \n DECLARE_LOCALS(&return,&x2,&0$?%__sil_tmpSIL_temp_conditional___n$6); [line 77]\n " color=yellow style=filled]
66 -> 72 ; 66 -> 72 ;
65 [label="65: DeclStmt \n *&z:int =6 [line 70]\n " shape="box"] 65 [label="65: DeclStmt \n *&z:int =6 [line 72]\n " shape="box"]
65 -> 59 ; 65 -> 59 ;
64 [label="64: DeclStmt \n n$2=_fun___new(sizeof(class Person ):unsigned long ) [line 71]\n n$7=*&0$?%__sil_tmpSIL_temp_conditional___n$3:int [line 71]\n _fun_Person_Person(n$2:class Person *,n$7:int ) [line 71]\n *&p:class Person *=n$2 [line 71]\n " shape="box"] 64 [label="64: DeclStmt \n n$2=_fun___new(sizeof(class constructor_new::Person ):unsigned long ) [line 73]\n n$7=*&0$?%__sil_tmpSIL_temp_conditional___n$3:int [line 73]\n _fun_constructor_new::Person_Person(n$2:class constructor_new::Person *,n$7:int ) [line 73]\n *&p:class constructor_new::Person *=n$2 [line 73]\n " shape="box"]
64 -> 57 ; 64 -> 57 ;
63 [label="63: ConditinalStmt Branch \n n$6=*&z:int [line 71]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =(1 + n$6) [line 71]\n " shape="box"] 63 [label="63: ConditinalStmt Branch \n n$6=*&z:int [line 73]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =(1 + n$6) [line 73]\n " shape="box"]
63 -> 58 ; 63 -> 58 ;
62 [label="62: ConditinalStmt Branch \n n$5=_fun_getValue(1:int ) [line 71]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =n$5 [line 71]\n " shape="box"] 62 [label="62: ConditinalStmt Branch \n n$5=_fun_constructor_new::getValue(1:int ) [line 73]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =n$5 [line 73]\n " shape="box"]
62 -> 58 ; 62 -> 58 ;
61 [label="61: Prune (false branch) \n PRUNE((n$4 == 0), false); [line 71]\n " shape="invhouse"] 61 [label="61: Prune (false branch) \n PRUNE((n$4 == 0), false); [line 73]\n " shape="invhouse"]
61 -> 63 ; 61 -> 63 ;
60 [label="60: Prune (true branch) \n PRUNE((n$4 != 0), true); [line 71]\n " shape="invhouse"] 60 [label="60: Prune (true branch) \n PRUNE((n$4 != 0), true); [line 73]\n " shape="invhouse"]
60 -> 62 ; 60 -> 62 ;
59 [label="59: Call _fun_getValue \n n$4=_fun_getValue(0:int ) [line 71]\n " shape="box"] 59 [label="59: Call _fun_constructor_new::getValue \n n$4=_fun_constructor_new::getValue(0:int ) [line 73]\n " shape="box"]
59 -> 60 ; 59 -> 60 ;
@ -158,46 +158,46 @@ digraph iCFG {
58 -> 64 ; 58 -> 64 ;
57 [label="57: Return Stmt \n n$0=*&p:class Person * [line 72]\n n$1=*n$0.x:int [line 72]\n *&return:int =(1 / (n$1 - 7)) [line 72]\n " shape="box"] 57 [label="57: Return Stmt \n n$0=*&p:class constructor_new::Person * [line 74]\n n$1=*n$0.x:int [line 74]\n *&return:int =(1 / (n$1 - 7)) [line 74]\n " shape="box"]
57 -> 56 ; 57 -> 56 ;
56 [label="56: Exit constructor_nodes \n " color=yellow style=filled] 56 [label="56: Exit constructor_new::constructor_nodes \n " color=yellow style=filled]
55 [label="55: Start constructor_nodes\nFormals: \nLocals: p:class Person * 0$?%__sil_tmpSIL_temp_conditional___n$3:int z:int \n DECLARE_LOCALS(&return,&p,&0$?%__sil_tmpSIL_temp_conditional___n$3,&z); [line 69]\n " color=yellow style=filled] 55 [label="55: Start constructor_new::constructor_nodes\nFormals: \nLocals: p:class constructor_new::Person * 0$?%__sil_tmpSIL_temp_conditional___n$3:int z:int \n DECLARE_LOCALS(&return,&p,&0$?%__sil_tmpSIL_temp_conditional___n$3,&z); [line 71]\n " color=yellow style=filled]
55 -> 65 ; 55 -> 65 ;
54 [label="54: DeclStmt \n *&z:int =6 [line 63]\n " shape="box"] 54 [label="54: DeclStmt \n *&z:int =6 [line 65]\n " shape="box"]
54 -> 53 ; 54 -> 53 ;
53 [label="53: DeclStmt \n n$9=_fun___new(sizeof(int ):unsigned long ) [line 64]\n n$10=_fun_getValue(4:int ) [line 64]\n *n$9:int =n$10 [line 64]\n *&y:int *=n$9 [line 64]\n " shape="box"] 53 [label="53: DeclStmt \n n$9=_fun___new(sizeof(int ):unsigned long ) [line 66]\n n$10=_fun_constructor_new::getValue(4:int ) [line 66]\n *n$9:int =n$10 [line 66]\n *&y:int *=n$9 [line 66]\n " shape="box"]
53 -> 47 ; 53 -> 47 ;
52 [label="52: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 65]\n n$8=*&0$?%__sil_tmpSIL_temp_conditional___n$3:int [line 65]\n *n$2:int =n$8 [line 65]\n *&x:int *=n$2 [line 65]\n " shape="box"] 52 [label="52: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 67]\n n$8=*&0$?%__sil_tmpSIL_temp_conditional___n$3:int [line 67]\n *n$2:int =n$8 [line 67]\n *&x:int *=n$2 [line 67]\n " shape="box"]
52 -> 45 ; 52 -> 45 ;
51 [label="51: ConditinalStmt Branch \n n$6=*&y:int * [line 65]\n n$7=*n$6:int [line 65]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =(1 + n$7) [line 65]\n " shape="box"] 51 [label="51: ConditinalStmt Branch \n n$6=*&y:int * [line 67]\n n$7=*n$6:int [line 67]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =(1 + n$7) [line 67]\n " shape="box"]
51 -> 46 ; 51 -> 46 ;
50 [label="50: ConditinalStmt Branch \n n$5=_fun_getValue(1:int ) [line 65]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =n$5 [line 65]\n " shape="box"] 50 [label="50: ConditinalStmt Branch \n n$5=_fun_constructor_new::getValue(1:int ) [line 67]\n *&0$?%__sil_tmpSIL_temp_conditional___n$3:int =n$5 [line 67]\n " shape="box"]
50 -> 46 ; 50 -> 46 ;
49 [label="49: Prune (false branch) \n PRUNE((n$4 == 0), false); [line 65]\n " shape="invhouse"] 49 [label="49: Prune (false branch) \n PRUNE((n$4 == 0), false); [line 67]\n " shape="invhouse"]
49 -> 51 ; 49 -> 51 ;
48 [label="48: Prune (true branch) \n PRUNE((n$4 != 0), true); [line 65]\n " shape="invhouse"] 48 [label="48: Prune (true branch) \n PRUNE((n$4 != 0), true); [line 67]\n " shape="invhouse"]
48 -> 50 ; 48 -> 50 ;
47 [label="47: Call _fun_getValue \n n$4=_fun_getValue(0:int ) [line 65]\n " shape="box"] 47 [label="47: Call _fun_constructor_new::getValue \n n$4=_fun_constructor_new::getValue(0:int ) [line 67]\n " shape="box"]
47 -> 48 ; 47 -> 48 ;
@ -206,171 +206,171 @@ digraph iCFG {
46 -> 52 ; 46 -> 52 ;
45 [label="45: Return Stmt \n n$0=*&x:int * [line 66]\n n$1=*n$0:int [line 66]\n *&return:int =(1 / (n$1 - 5)) [line 66]\n " shape="box"] 45 [label="45: Return Stmt \n n$0=*&x:int * [line 68]\n n$1=*n$0:int [line 68]\n *&return:int =(1 / (n$1 - 5)) [line 68]\n " shape="box"]
45 -> 44 ; 45 -> 44 ;
44 [label="44: Exit int_init_nodes \n " color=yellow style=filled] 44 [label="44: Exit constructor_new::int_init_nodes \n " color=yellow style=filled]
43 [label="43: Start int_init_nodes\nFormals: \nLocals: x:int * 0$?%__sil_tmpSIL_temp_conditional___n$3:int y:int * z:int \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_temp_conditional___n$3,&y,&z); [line 62]\n " color=yellow style=filled] 43 [label="43: Start constructor_new::int_init_nodes\nFormals: \nLocals: x:int * 0$?%__sil_tmpSIL_temp_conditional___n$3:int y:int * z:int \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_temp_conditional___n$3,&y,&z); [line 64]\n " color=yellow style=filled]
43 -> 54 ; 43 -> 54 ;
42 [label="42: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 58]\n *n$2:int =0 [line 58]\n *&x1:int *=n$2 [line 58]\n " shape="box"] 42 [label="42: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 60]\n *n$2:int =0 [line 60]\n *&x1:int *=n$2 [line 60]\n " shape="box"]
42 -> 41 ; 42 -> 41 ;
41 [label="41: Return Stmt \n n$0=*&x1:int * [line 59]\n n$1=*n$0:int [line 59]\n *&return:int =(1 / n$1) [line 59]\n " shape="box"] 41 [label="41: Return Stmt \n n$0=*&x1:int * [line 61]\n n$1=*n$0:int [line 61]\n *&return:int =(1 / n$1) [line 61]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: Exit int_init_empty_list_new \n " color=yellow style=filled] 40 [label="40: Exit constructor_new::int_init_empty_list_new \n " color=yellow style=filled]
39 [label="39: Start int_init_empty_list_new\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 57]\n " color=yellow style=filled] 39 [label="39: Start constructor_new::int_init_empty_list_new\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 59]\n " color=yellow style=filled]
39 -> 42 ; 39 -> 42 ;
38 [label="38: DeclStmt \n *&x1:int =0 [line 53]\n " shape="box"] 38 [label="38: DeclStmt \n *&x1:int =0 [line 55]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: Return Stmt \n n$0=*&x1:int [line 54]\n *&return:int =(1 / n$0) [line 54]\n " shape="box"] 37 [label="37: Return Stmt \n n$0=*&x1:int [line 56]\n *&return:int =(1 / n$0) [line 56]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: Exit int_init_empty_list \n " color=yellow style=filled] 36 [label="36: Exit constructor_new::int_init_empty_list \n " color=yellow style=filled]
35 [label="35: Start int_init_empty_list\nFormals: \nLocals: x1:int \n DECLARE_LOCALS(&return,&x1); [line 52]\n " color=yellow style=filled] 35 [label="35: Start constructor_new::int_init_empty_list\nFormals: \nLocals: x1:int \n DECLARE_LOCALS(&return,&x1); [line 54]\n " color=yellow style=filled]
35 -> 38 ; 35 -> 38 ;
34 [label="34: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 48]\n *n$2:int =0 [line 48]\n *&x1:int *=n$2 [line 48]\n " shape="box"] 34 [label="34: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 50]\n *n$2:int =0 [line 50]\n *&x1:int *=n$2 [line 50]\n " shape="box"]
34 -> 33 ; 34 -> 33 ;
33 [label="33: Return Stmt \n n$0=*&x1:int * [line 49]\n n$1=*n$0:int [line 49]\n *&return:int =(1 / n$1) [line 49]\n " shape="box"] 33 [label="33: Return Stmt \n n$0=*&x1:int * [line 51]\n n$1=*n$0:int [line 51]\n *&return:int =(1 / n$1) [line 51]\n " shape="box"]
33 -> 32 ; 33 -> 32 ;
32 [label="32: Exit int_init_empty \n " color=yellow style=filled] 32 [label="32: Exit constructor_new::int_init_empty \n " color=yellow style=filled]
31 [label="31: Start int_init_empty\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 47]\n " color=yellow style=filled] 31 [label="31: Start constructor_new::int_init_empty\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 49]\n " color=yellow style=filled]
31 -> 34 ; 31 -> 34 ;
30 [label="30: DeclStmt \n n$2=_fun___new(sizeof(float ):unsigned long ) [line 43]\n *n$2:float =5.400000 [line 43]\n *&x1:float *=n$2 [line 43]\n " shape="box"] 30 [label="30: DeclStmt \n n$2=_fun___new(sizeof(float ):unsigned long ) [line 45]\n *n$2:float =5.400000 [line 45]\n *&x1:float *=n$2 [line 45]\n " shape="box"]
30 -> 29 ; 30 -> 29 ;
29 [label="29: Return Stmt \n n$0=*&x1:float * [line 44]\n n$1=*n$0:float [line 44]\n *&return:float =(1 / (n$1 - 5.400000)) [line 44]\n " shape="box"] 29 [label="29: Return Stmt \n n$0=*&x1:float * [line 46]\n n$1=*n$0:float [line 46]\n *&return:float =(1 / (n$1 - 5.400000)) [line 46]\n " shape="box"]
29 -> 28 ; 29 -> 28 ;
28 [label="28: Exit float_init_number \n " color=yellow style=filled] 28 [label="28: Exit constructor_new::float_init_number \n " color=yellow style=filled]
27 [label="27: Start float_init_number\nFormals: \nLocals: x1:float * \n DECLARE_LOCALS(&return,&x1); [line 42]\n " color=yellow style=filled] 27 [label="27: Start constructor_new::float_init_number\nFormals: \nLocals: x1:float * \n DECLARE_LOCALS(&return,&x1); [line 44]\n " color=yellow style=filled]
27 -> 30 ; 27 -> 30 ;
26 [label="26: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 38]\n *n$2:int =5 [line 38]\n *&x1:int *=n$2 [line 38]\n " shape="box"] 26 [label="26: DeclStmt \n n$2=_fun___new(sizeof(int ):unsigned long ) [line 40]\n *n$2:int =5 [line 40]\n *&x1:int *=n$2 [line 40]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: Return Stmt \n n$0=*&x1:int * [line 39]\n n$1=*n$0:int [line 39]\n *&return:int =(1 / (n$1 - 5)) [line 39]\n " shape="box"] 25 [label="25: Return Stmt \n n$0=*&x1:int * [line 41]\n n$1=*n$0:int [line 41]\n *&return:int =(1 / (n$1 - 5)) [line 41]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit int_init_number \n " color=yellow style=filled] 24 [label="24: Exit constructor_new::int_init_number \n " color=yellow style=filled]
23 [label="23: Start int_init_number\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 37]\n " color=yellow style=filled] 23 [label="23: Start constructor_new::int_init_number\nFormals: \nLocals: x1:int * \n DECLARE_LOCALS(&return,&x1); [line 39]\n " color=yellow style=filled]
23 -> 26 ; 23 -> 26 ;
22 [label="22: DeclStmt \n n$2=_fun___new(sizeof(class Person ):unsigned long ) [line 33]\n _fun_Person_Person(n$2:class Person *,5:int ,6:int ,7:int ) [line 33]\n *&p:class Person *=n$2 [line 33]\n " shape="box"] 22 [label="22: DeclStmt \n n$2=_fun___new(sizeof(class constructor_new::Person ):unsigned long ) [line 35]\n _fun_constructor_new::Person_Person(n$2:class constructor_new::Person *,5:int ,6:int ,7:int ) [line 35]\n *&p:class constructor_new::Person *=n$2 [line 35]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Return Stmt \n n$0=*&p:class Person * [line 34]\n n$1=*n$0.z:int [line 34]\n *&return:int =(1 / (n$1 - 7)) [line 34]\n " shape="box"] 21 [label="21: Return Stmt \n n$0=*&p:class constructor_new::Person * [line 36]\n n$1=*n$0.z:int [line 36]\n *&return:int =(1 / (n$1 - 7)) [line 36]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit constructor_3_args_new_div0 \n " color=yellow style=filled] 20 [label="20: Exit constructor_new::constructor_3_args_new_div0 \n " color=yellow style=filled]
19 [label="19: Start constructor_3_args_new_div0\nFormals: \nLocals: p:class Person * \n DECLARE_LOCALS(&return,&p); [line 32]\n " color=yellow style=filled] 19 [label="19: Start constructor_new::constructor_3_args_new_div0\nFormals: \nLocals: p:class constructor_new::Person * \n DECLARE_LOCALS(&return,&p); [line 34]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: DeclStmt \n n$2=_fun___new(sizeof(class Person ):unsigned long ) [line 28]\n _fun_Person_Person(n$2:class Person *,5:int ) [line 28]\n *&p:class Person *=n$2 [line 28]\n " shape="box"] 18 [label="18: DeclStmt \n n$2=_fun___new(sizeof(class constructor_new::Person ):unsigned long ) [line 30]\n _fun_constructor_new::Person_Person(n$2:class constructor_new::Person *,5:int ) [line 30]\n *&p:class constructor_new::Person *=n$2 [line 30]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Return Stmt \n n$0=*&p:class Person * [line 29]\n n$1=*n$0.x:int [line 29]\n *&return:int =(1 / (n$1 - 5)) [line 29]\n " shape="box"] 17 [label="17: Return Stmt \n n$0=*&p:class constructor_new::Person * [line 31]\n n$1=*n$0.x:int [line 31]\n *&return:int =(1 / (n$1 - 5)) [line 31]\n " shape="box"]
17 -> 16 ; 17 -> 16 ;
16 [label="16: Exit constructor_1_arg_new_div0 \n " color=yellow style=filled] 16 [label="16: Exit constructor_new::constructor_1_arg_new_div0 \n " color=yellow style=filled]
15 [label="15: Start constructor_1_arg_new_div0\nFormals: \nLocals: p:class Person * \n DECLARE_LOCALS(&return,&p); [line 27]\n " color=yellow style=filled] 15 [label="15: Start constructor_new::constructor_1_arg_new_div0\nFormals: \nLocals: p:class constructor_new::Person * \n DECLARE_LOCALS(&return,&p); [line 29]\n " color=yellow style=filled]
15 -> 18 ; 15 -> 18 ;
14 [label="14: Return Stmt \n n$0=*&x:int [line 25]\n *&return:int =n$0 [line 25]\n " shape="box"] 14 [label="14: Return Stmt \n n$0=*&x:int [line 27]\n *&return:int =n$0 [line 27]\n " shape="box"]
14 -> 13 ; 14 -> 13 ;
13 [label="13: Exit getValue \n " color=yellow style=filled] 13 [label="13: Exit constructor_new::getValue \n " color=yellow style=filled]
12 [label="12: Start getValue\nFormals: x:int \nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] 12 [label="12: Start constructor_new::getValue\nFormals: x:int \nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled]
12 -> 14 ; 12 -> 14 ;
11 [label="11: BinaryOperatorStmt: Assign \n n$4=*&this:class Person * [line 16]\n n$5=*&i:int [line 16]\n *n$4.x:int =n$5 [line 16]\n " shape="box"] 11 [label="11: BinaryOperatorStmt: Assign \n n$4=*&this:class constructor_new::Person * [line 18]\n n$5=*&i:int [line 18]\n *n$4.x:int =n$5 [line 18]\n " shape="box"]
11 -> 10 ; 11 -> 10 ;
10 [label="10: BinaryOperatorStmt: Assign \n n$2=*&this:class Person * [line 17]\n n$3=*&j:int [line 17]\n *n$2.y:int =n$3 [line 17]\n " shape="box"] 10 [label="10: BinaryOperatorStmt: Assign \n n$2=*&this:class constructor_new::Person * [line 19]\n n$3=*&j:int [line 19]\n *n$2.y:int =n$3 [line 19]\n " shape="box"]
10 -> 9 ; 10 -> 9 ;
9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class Person * [line 18]\n n$1=*&k:int [line 18]\n *n$0.z:int =n$1 [line 18]\n " shape="box"] 9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class constructor_new::Person * [line 20]\n n$1=*&k:int [line 20]\n *n$0.z:int =n$1 [line 20]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit Person_Person \n " color=yellow style=filled] 8 [label="8: Exit constructor_new::Person_Person \n " color=yellow style=filled]
7 [label="7: Start Person_Person\nFormals: this:class Person * i:int j:int k:int \nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 7 [label="7: Start constructor_new::Person_Person\nFormals: this:class constructor_new::Person * i:int j:int k:int \nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
7 -> 11 ; 7 -> 11 ;
6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class Person * [line 13]\n n$1=*&i:int [line 13]\n *n$0.x:int =n$1 [line 13]\n " shape="box"] 6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class constructor_new::Person * [line 15]\n n$1=*&i:int [line 15]\n *n$0.x:int =n$1 [line 15]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit Person_Person \n " color=yellow style=filled] 5 [label="5: Exit constructor_new::Person_Person \n " color=yellow style=filled]
4 [label="4: Start Person_Person\nFormals: this:class Person * i:int \nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] 4 [label="4: Start constructor_new::Person_Person\nFormals: this:class constructor_new::Person * i:int \nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class Person * [line 12]\n *n$0.x:int =0 [line 12]\n " shape="box"] 3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class constructor_new::Person * [line 14]\n *n$0.x:int =0 [line 14]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit Person_Person \n " color=yellow style=filled] 2 [label="2: Exit constructor_new::Person_Person \n " color=yellow style=filled]
1 [label="1: Start Person_Person\nFormals: this:class Person *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 1 [label="1: Start constructor_new::Person_Person\nFormals: this:class constructor_new::Person *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace constructor_with_body {
class X { class X {
int f; int f;
void init() { f = 0; } void init() { f = 0; }
@ -39,3 +41,4 @@ void test_div1() {
X x(0, 1); X x(0, 1);
x.div(); x.div();
} }
}

@ -1,99 +1,99 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
26 [label="26: DeclStmt \n _fun_X_X(&x:class X *,0:int ,1:int ) [line 39]\n " shape="box"] 26 [label="26: DeclStmt \n _fun_constructor_with_body::X_X(&x:class constructor_with_body::X *,0:int ,1:int ) [line 41]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: Call _fun_X_div \n _=*&x:class X [line 40]\n n$1=_fun_X_div(&x:class X &) [line 40]\n " shape="box"] 25 [label="25: Call _fun_constructor_with_body::X_div \n _=*&x:class constructor_with_body::X [line 42]\n n$1=_fun_constructor_with_body::X_div(&x:class constructor_with_body::X &) [line 42]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit test_div1 \n " color=yellow style=filled] 24 [label="24: Exit constructor_with_body::test_div1 \n " color=yellow style=filled]
23 [label="23: Start test_div1\nFormals: \nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 38]\n " color=yellow style=filled] 23 [label="23: Start constructor_with_body::test_div1\nFormals: \nLocals: x:class constructor_with_body::X \n DECLARE_LOCALS(&return,&x); [line 40]\n " color=yellow style=filled]
23 -> 26 ; 23 -> 26 ;
22 [label="22: DeclStmt \n _fun_X_X(&x:class X *) [line 34]\n " shape="box"] 22 [label="22: DeclStmt \n _fun_constructor_with_body::X_X(&x:class constructor_with_body::X *) [line 36]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Call _fun_X_div \n _=*&x:class X [line 35]\n n$1=_fun_X_div(&x:class X &) [line 35]\n " shape="box"] 21 [label="21: Call _fun_constructor_with_body::X_div \n _=*&x:class constructor_with_body::X [line 37]\n n$1=_fun_constructor_with_body::X_div(&x:class constructor_with_body::X &) [line 37]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit test_div0_default_constructor \n " color=yellow style=filled] 20 [label="20: Exit constructor_with_body::test_div0_default_constructor \n " color=yellow style=filled]
19 [label="19: Start test_div0_default_constructor\nFormals: \nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 33]\n " color=yellow style=filled] 19 [label="19: Start constructor_with_body::test_div0_default_constructor\nFormals: \nLocals: x:class constructor_with_body::X \n DECLARE_LOCALS(&return,&x); [line 35]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: DeclStmt \n _fun_X_X(&x:class X *,-2:int ,2:int ) [line 29]\n " shape="box"] 18 [label="18: DeclStmt \n _fun_constructor_with_body::X_X(&x:class constructor_with_body::X *,-2:int ,2:int ) [line 31]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Call _fun_X_div \n _=*&x:class X [line 30]\n n$1=_fun_X_div(&x:class X &) [line 30]\n " shape="box"] 17 [label="17: Call _fun_constructor_with_body::X_div \n _=*&x:class constructor_with_body::X [line 32]\n n$1=_fun_constructor_with_body::X_div(&x:class constructor_with_body::X &) [line 32]\n " shape="box"]
17 -> 16 ; 17 -> 16 ;
16 [label="16: Exit test_div0 \n " color=yellow style=filled] 16 [label="16: Exit constructor_with_body::test_div0 \n " color=yellow style=filled]
15 [label="15: Start test_div0\nFormals: \nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 28]\n " color=yellow style=filled] 15 [label="15: Start constructor_with_body::test_div0\nFormals: \nLocals: x:class constructor_with_body::X \n DECLARE_LOCALS(&return,&x); [line 30]\n " color=yellow style=filled]
15 -> 18 ; 15 -> 18 ;
14 [label="14: DeclStmt \n n$4=*&a:int [line 23]\n n$5=*&b:int [line 23]\n *&c:int =(n$4 + n$5) [line 23]\n " shape="box"] 14 [label="14: DeclStmt \n n$4=*&a:int [line 25]\n n$5=*&b:int [line 25]\n *&c:int =(n$4 + n$5) [line 25]\n " shape="box"]
14 -> 13 ; 14 -> 13 ;
13 [label="13: Call _fun_X_init \n n$2=*&this:class X * [line 24]\n _=*n$2:class X [line 24]\n _fun_X_init(n$2:class X *) [line 24]\n " shape="box"] 13 [label="13: Call _fun_constructor_with_body::X_init \n n$2=*&this:class constructor_with_body::X * [line 26]\n _=*n$2:class constructor_with_body::X [line 26]\n _fun_constructor_with_body::X_init(n$2:class constructor_with_body::X *) [line 26]\n " shape="box"]
13 -> 12 ; 13 -> 12 ;
12 [label="12: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 25]\n n$1=*&c:int [line 25]\n *n$0.f:int =n$1 [line 25]\n " shape="box"] 12 [label="12: BinaryOperatorStmt: Assign \n n$0=*&this:class constructor_with_body::X * [line 27]\n n$1=*&c:int [line 27]\n *n$0.f:int =n$1 [line 27]\n " shape="box"]
12 -> 11 ; 12 -> 11 ;
11 [label="11: Exit X_X \n " color=yellow style=filled] 11 [label="11: Exit constructor_with_body::X_X \n " color=yellow style=filled]
10 [label="10: Start X_X\nFormals: this:class X * a:int b:int \nLocals: c:int \n DECLARE_LOCALS(&return,&c); [line 22]\n " color=yellow style=filled] 10 [label="10: Start constructor_with_body::X_X\nFormals: this:class constructor_with_body::X * a:int b:int \nLocals: c:int \n DECLARE_LOCALS(&return,&c); [line 24]\n " color=yellow style=filled]
10 -> 14 ; 10 -> 14 ;
9 [label="9: Return Stmt \n n$0=*&this:class X * [line 19]\n n$1=*n$0.f:int [line 19]\n *&return:int =(1 / n$1) [line 19]\n " shape="box"] 9 [label="9: Return Stmt \n n$0=*&this:class constructor_with_body::X * [line 21]\n n$1=*n$0.f:int [line 21]\n *&return:int =(1 / n$1) [line 21]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit X_div \n " color=yellow style=filled] 8 [label="8: Exit constructor_with_body::X_div \n " color=yellow style=filled]
7 [label="7: Start X_div\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 7 [label="7: Start constructor_with_body::X_div\nFormals: this:class constructor_with_body::X *\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
7 -> 9 ; 7 -> 9 ;
6 [label="6: Call _fun_X_init \n n$0=*&this:class X * [line 15]\n _=*n$0:class X [line 15]\n _fun_X_init(n$0:class X *) [line 15]\n " shape="box"] 6 [label="6: Call _fun_constructor_with_body::X_init \n n$0=*&this:class constructor_with_body::X * [line 17]\n _=*n$0:class constructor_with_body::X [line 17]\n _fun_constructor_with_body::X_init(n$0:class constructor_with_body::X *) [line 17]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit X_X \n " color=yellow style=filled] 5 [label="5: Exit constructor_with_body::X_X \n " color=yellow style=filled]
4 [label="4: Start X_X\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 4 [label="4: Start constructor_with_body::X_X\nFormals: this:class constructor_with_body::X *\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 12]\n *n$0.f:int =0 [line 12]\n " shape="box"] 3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class constructor_with_body::X * [line 14]\n *n$0.f:int =0 [line 14]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_init \n " color=yellow style=filled] 2 [label="2: Exit constructor_with_body::X_init \n " color=yellow style=filled]
1 [label="1: Start X_init\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 1 [label="1: Start constructor_with_body::X_init\nFormals: this:class constructor_with_body::X *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace copy_move_constructor {
// NOTE: that test will break if we start doing copy elision // NOTE: that test will break if we start doing copy elision
// will have default copy/move constructors - used to test // will have default copy/move constructors - used to test
// whether they get translated correctly // whether they get translated correctly
@ -77,3 +79,4 @@ int copyY_moveY_div1() {
int d2 = 1 / getY(2).f; int d2 = 1 / getY(2).f;
return d1 + d2; return d1 + d2;
} }
}

@ -1,247 +1,247 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
65 [label="65: DeclStmt \n _fun_Y_Y(&y1:class Y *) [line 73]\n " shape="box"] 65 [label="65: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y1:class copy_move_constructor::Y *) [line 75]\n " shape="box"]
65 -> 64 ; 65 -> 64 ;
64 [label="64: BinaryOperatorStmt: Assign \n *&y1.f:int =1 [line 74]\n " shape="box"] 64 [label="64: BinaryOperatorStmt: Assign \n *&y1.f:int =1 [line 76]\n " shape="box"]
64 -> 63 ; 64 -> 63 ;
63 [label="63: DeclStmt \n _fun_Y_Y(&y2:class Y *,&y1:class Y &) [line 75]\n " shape="box"] 63 [label="63: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y2:class copy_move_constructor::Y *,&y1:class copy_move_constructor::Y &) [line 77]\n " shape="box"]
63 -> 62 ; 63 -> 62 ;
62 [label="62: DeclStmt \n n$5=*&y2.f:int [line 76]\n *&d1:int =(1 / n$5) [line 76]\n " shape="box"] 62 [label="62: DeclStmt \n n$5=*&y2.f:int [line 78]\n *&d1:int =(1 / n$5) [line 78]\n " shape="box"]
62 -> 61 ; 62 -> 61 ;
61 [label="61: DeclStmt \n _fun_getY(2:int ,&0$?%__sil_tmp__temp_return_n$3:class Y *) [line 77]\n n$4=*&0$?%__sil_tmp__temp_return_n$3.f:int [line 77]\n *&d2:int =(1 / n$4) [line 77]\n " shape="box"] 61 [label="61: DeclStmt \n _fun_copy_move_constructor::getY(2:int ,&0$?%__sil_tmp__temp_return_n$3:class copy_move_constructor::Y *) [line 79]\n n$4=*&0$?%__sil_tmp__temp_return_n$3.f:int [line 79]\n *&d2:int =(1 / n$4) [line 79]\n " shape="box"]
61 -> 60 ; 61 -> 60 ;
60 [label="60: Return Stmt \n n$0=*&d1:int [line 78]\n n$1=*&d2:int [line 78]\n *&return:int =(n$0 + n$1) [line 78]\n " shape="box"] 60 [label="60: Return Stmt \n n$0=*&d1:int [line 80]\n n$1=*&d2:int [line 80]\n *&return:int =(n$0 + n$1) [line 80]\n " shape="box"]
60 -> 59 ; 60 -> 59 ;
59 [label="59: Exit copyY_moveY_div1 \n " color=yellow style=filled] 59 [label="59: Exit copy_move_constructor::copyY_moveY_div1 \n " color=yellow style=filled]
58 [label="58: Start copyY_moveY_div1\nFormals: \nLocals: d2:int 0$?%__sil_tmp__temp_return_n$3:class Y d1:int y2:class Y y1:class Y \n DECLARE_LOCALS(&return,&d2,&0$?%__sil_tmp__temp_return_n$3,&d1,&y2,&y1); [line 72]\n " color=yellow style=filled] 58 [label="58: Start copy_move_constructor::copyY_moveY_div1\nFormals: \nLocals: d2:int 0$?%__sil_tmp__temp_return_n$3:class copy_move_constructor::Y d1:int y2:class copy_move_constructor::Y y1:class copy_move_constructor::Y \n DECLARE_LOCALS(&return,&d2,&0$?%__sil_tmp__temp_return_n$3,&d1,&y2,&y1); [line 74]\n " color=yellow style=filled]
58 -> 65 ; 58 -> 65 ;
57 [label="57: DeclStmt \n _fun_X_X(&x1:class X *) [line 64]\n " shape="box"] 57 [label="57: DeclStmt \n _fun_copy_move_constructor::X_X(&x1:class copy_move_constructor::X *) [line 66]\n " shape="box"]
57 -> 56 ; 57 -> 56 ;
56 [label="56: BinaryOperatorStmt: Assign \n *&x1.f:int =1 [line 65]\n " shape="box"] 56 [label="56: BinaryOperatorStmt: Assign \n *&x1.f:int =1 [line 67]\n " shape="box"]
56 -> 55 ; 56 -> 55 ;
55 [label="55: DeclStmt \n _fun_X_X(&x2:class X *,&x1:class X &) [line 66]\n " shape="box"] 55 [label="55: DeclStmt \n _fun_copy_move_constructor::X_X(&x2:class copy_move_constructor::X *,&x1:class copy_move_constructor::X &) [line 68]\n " shape="box"]
55 -> 54 ; 55 -> 54 ;
54 [label="54: DeclStmt \n n$5=*&x2.f:int [line 67]\n *&d1:int =(1 / n$5) [line 67]\n " shape="box"] 54 [label="54: DeclStmt \n n$5=*&x2.f:int [line 69]\n *&d1:int =(1 / n$5) [line 69]\n " shape="box"]
54 -> 53 ; 54 -> 53 ;
53 [label="53: DeclStmt \n _fun_getX(1:int ,&0$?%__sil_tmp__temp_return_n$3:class X *) [line 68]\n n$4=*&0$?%__sil_tmp__temp_return_n$3.f:int [line 68]\n *&d2:int =(1 / n$4) [line 68]\n " shape="box"] 53 [label="53: DeclStmt \n _fun_copy_move_constructor::getX(1:int ,&0$?%__sil_tmp__temp_return_n$3:class copy_move_constructor::X *) [line 70]\n n$4=*&0$?%__sil_tmp__temp_return_n$3.f:int [line 70]\n *&d2:int =(1 / n$4) [line 70]\n " shape="box"]
53 -> 52 ; 53 -> 52 ;
52 [label="52: Return Stmt \n n$0=*&d1:int [line 69]\n n$1=*&d2:int [line 69]\n *&return:int =(n$0 + n$1) [line 69]\n " shape="box"] 52 [label="52: Return Stmt \n n$0=*&d1:int [line 71]\n n$1=*&d2:int [line 71]\n *&return:int =(n$0 + n$1) [line 71]\n " shape="box"]
52 -> 51 ; 52 -> 51 ;
51 [label="51: Exit copyX_moveX_div1 \n " color=yellow style=filled] 51 [label="51: Exit copy_move_constructor::copyX_moveX_div1 \n " color=yellow style=filled]
50 [label="50: Start copyX_moveX_div1\nFormals: \nLocals: d2:int 0$?%__sil_tmp__temp_return_n$3:class X d1:int x2:class X x1:class X \n DECLARE_LOCALS(&return,&d2,&0$?%__sil_tmp__temp_return_n$3,&d1,&x2,&x1); [line 63]\n " color=yellow style=filled] 50 [label="50: Start copy_move_constructor::copyX_moveX_div1\nFormals: \nLocals: d2:int 0$?%__sil_tmp__temp_return_n$3:class copy_move_constructor::X d1:int x2:class copy_move_constructor::X x1:class copy_move_constructor::X \n DECLARE_LOCALS(&return,&d2,&0$?%__sil_tmp__temp_return_n$3,&d1,&x2,&x1); [line 65]\n " color=yellow style=filled]
50 -> 57 ; 50 -> 57 ;
49 [label="49: DeclStmt \n _fun_getY(2:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class Y *) [line 58]\n _fun_Y_Y(&y1:class Y *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class Y &) [line 58]\n " shape="box"] 49 [label="49: DeclStmt \n _fun_copy_move_constructor::getY(2:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class copy_move_constructor::Y *) [line 60]\n _fun_copy_move_constructor::Y_Y(&y1:class copy_move_constructor::Y *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class copy_move_constructor::Y &) [line 60]\n " shape="box"]
49 -> 48 ; 49 -> 48 ;
48 [label="48: DeclStmt \n _fun_Y_Y(&y2:class Y *,&y1:class Y &) [line 59]\n " shape="box"] 48 [label="48: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y2:class copy_move_constructor::Y *,&y1:class copy_move_constructor::Y &) [line 61]\n " shape="box"]
48 -> 47 ; 48 -> 47 ;
47 [label="47: Return Stmt \n n$0=*&y2.f:int [line 60]\n *&return:int =(1 / n$0) [line 60]\n " shape="box"] 47 [label="47: Return Stmt \n n$0=*&y2.f:int [line 62]\n *&return:int =(1 / n$0) [line 62]\n " shape="box"]
47 -> 46 ; 47 -> 46 ;
46 [label="46: Exit moveY_moveY_copyY_div0 \n " color=yellow style=filled] 46 [label="46: Exit copy_move_constructor::moveY_moveY_copyY_div0 \n " color=yellow style=filled]
45 [label="45: Start moveY_moveY_copyY_div0\nFormals: \nLocals: y2:class Y y1:class Y 0$?%__sil_tmpSIL_materialize_temp__n$1:class Y \n DECLARE_LOCALS(&return,&y2,&y1,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 57]\n " color=yellow style=filled] 45 [label="45: Start copy_move_constructor::moveY_moveY_copyY_div0\nFormals: \nLocals: y2:class copy_move_constructor::Y y1:class copy_move_constructor::Y 0$?%__sil_tmpSIL_materialize_temp__n$1:class copy_move_constructor::Y \n DECLARE_LOCALS(&return,&y2,&y1,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 59]\n " color=yellow style=filled]
45 -> 49 ; 45 -> 49 ;
44 [label="44: Return Stmt \n _fun_getY(1:int ,&0$?%__sil_tmp__temp_return_n$1:class Y *) [line 55]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 55]\n *&return:int =(1 / n$2) [line 55]\n " shape="box"] 44 [label="44: Return Stmt \n _fun_copy_move_constructor::getY(1:int ,&0$?%__sil_tmp__temp_return_n$1:class copy_move_constructor::Y *) [line 57]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 57]\n *&return:int =(1 / n$2) [line 57]\n " shape="box"]
44 -> 43 ; 44 -> 43 ;
43 [label="43: Exit moveY_div0 \n " color=yellow style=filled] 43 [label="43: Exit copy_move_constructor::moveY_div0 \n " color=yellow style=filled]
42 [label="42: Start moveY_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class Y \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 55]\n " color=yellow style=filled] 42 [label="42: Start copy_move_constructor::moveY_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class copy_move_constructor::Y \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 57]\n " color=yellow style=filled]
42 -> 44 ; 42 -> 44 ;
41 [label="41: DeclStmt \n _fun_Y_Y(&y1:class Y *) [line 49]\n " shape="box"] 41 [label="41: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y1:class copy_move_constructor::Y *) [line 51]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: BinaryOperatorStmt: Assign \n *&y1.f:int =0 [line 50]\n " shape="box"] 40 [label="40: BinaryOperatorStmt: Assign \n *&y1.f:int =0 [line 52]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: DeclStmt \n _fun_Y_Y(&y2:class Y *,&y1:class Y &) [line 51]\n " shape="box"] 39 [label="39: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y2:class copy_move_constructor::Y *,&y1:class copy_move_constructor::Y &) [line 53]\n " shape="box"]
39 -> 38 ; 39 -> 38 ;
38 [label="38: Return Stmt \n n$0=*&y2.f:int [line 52]\n *&return:int =(1 / n$0) [line 52]\n " shape="box"] 38 [label="38: Return Stmt \n n$0=*&y2.f:int [line 54]\n *&return:int =(1 / n$0) [line 54]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: Exit copyY_div0 \n " color=yellow style=filled] 37 [label="37: Exit copy_move_constructor::copyY_div0 \n " color=yellow style=filled]
36 [label="36: Start copyY_div0\nFormals: \nLocals: y2:class Y y1:class Y \n DECLARE_LOCALS(&return,&y2,&y1); [line 48]\n " color=yellow style=filled] 36 [label="36: Start copy_move_constructor::copyY_div0\nFormals: \nLocals: y2:class copy_move_constructor::Y y1:class copy_move_constructor::Y \n DECLARE_LOCALS(&return,&y2,&y1); [line 50]\n " color=yellow style=filled]
36 -> 41 ; 36 -> 41 ;
35 [label="35: Return Stmt \n _fun_getX(0:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 46]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 46]\n *&return:int =(1 / n$2) [line 46]\n " shape="box"] 35 [label="35: Return Stmt \n _fun_copy_move_constructor::getX(0:int ,&0$?%__sil_tmp__temp_return_n$1:class copy_move_constructor::X *) [line 48]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 48]\n *&return:int =(1 / n$2) [line 48]\n " shape="box"]
35 -> 34 ; 35 -> 34 ;
34 [label="34: Exit moveX_div0 \n " color=yellow style=filled] 34 [label="34: Exit copy_move_constructor::moveX_div0 \n " color=yellow style=filled]
33 [label="33: Start moveX_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 46]\n " color=yellow style=filled] 33 [label="33: Start copy_move_constructor::moveX_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class copy_move_constructor::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 48]\n " color=yellow style=filled]
33 -> 35 ; 33 -> 35 ;
32 [label="32: DeclStmt \n _fun_X_X(&x1:class X *) [line 40]\n " shape="box"] 32 [label="32: DeclStmt \n _fun_copy_move_constructor::X_X(&x1:class copy_move_constructor::X *) [line 42]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: BinaryOperatorStmt: Assign \n *&x1.f:int =0 [line 41]\n " shape="box"] 31 [label="31: BinaryOperatorStmt: Assign \n *&x1.f:int =0 [line 43]\n " shape="box"]
31 -> 30 ; 31 -> 30 ;
30 [label="30: DeclStmt \n _fun_X_X(&x2:class X *,&x1:class X &) [line 42]\n " shape="box"] 30 [label="30: DeclStmt \n _fun_copy_move_constructor::X_X(&x2:class copy_move_constructor::X *,&x1:class copy_move_constructor::X &) [line 44]\n " shape="box"]
30 -> 29 ; 30 -> 29 ;
29 [label="29: Return Stmt \n n$0=*&x2.f:int [line 43]\n *&return:int =(1 / n$0) [line 43]\n " shape="box"] 29 [label="29: Return Stmt \n n$0=*&x2.f:int [line 45]\n *&return:int =(1 / n$0) [line 45]\n " shape="box"]
29 -> 28 ; 29 -> 28 ;
28 [label="28: Exit copyX_div0 \n " color=yellow style=filled] 28 [label="28: Exit copy_move_constructor::copyX_div0 \n " color=yellow style=filled]
27 [label="27: Start copyX_div0\nFormals: \nLocals: x2:class X x1:class X \n DECLARE_LOCALS(&return,&x2,&x1); [line 39]\n " color=yellow style=filled] 27 [label="27: Start copy_move_constructor::copyX_div0\nFormals: \nLocals: x2:class copy_move_constructor::X x1:class copy_move_constructor::X \n DECLARE_LOCALS(&return,&x2,&x1); [line 41]\n " color=yellow style=filled]
27 -> 32 ; 27 -> 32 ;
26 [label="26: DeclStmt \n _fun_Y_Y(&y:class Y *) [line 34]\n " shape="box"] 26 [label="26: DeclStmt \n _fun_copy_move_constructor::Y_Y(&y:class copy_move_constructor::Y *) [line 36]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: BinaryOperatorStmt: Assign \n n$1=*&f:int [line 35]\n *&y.f:int =n$1 [line 35]\n " shape="box"] 25 [label="25: BinaryOperatorStmt: Assign \n n$1=*&f:int [line 37]\n *&y.f:int =n$1 [line 37]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Return Stmt \n n$0=*&__return_param:class Y * [line 36]\n _fun_Y_Y(n$0:class Y *,&y:class Y &) [line 36]\n " shape="box"] 24 [label="24: Return Stmt \n n$0=*&__return_param:class copy_move_constructor::Y * [line 38]\n _fun_copy_move_constructor::Y_Y(n$0:class copy_move_constructor::Y *,&y:class copy_move_constructor::Y &) [line 38]\n " shape="box"]
24 -> 23 ; 24 -> 23 ;
23 [label="23: Exit getY \n " color=yellow style=filled] 23 [label="23: Exit copy_move_constructor::getY \n " color=yellow style=filled]
22 [label="22: Start getY\nFormals: f:int __return_param:class Y *\nLocals: y:class Y \n DECLARE_LOCALS(&return,&y); [line 33]\n " color=yellow style=filled] 22 [label="22: Start copy_move_constructor::getY\nFormals: f:int __return_param:class copy_move_constructor::Y *\nLocals: y:class copy_move_constructor::Y \n DECLARE_LOCALS(&return,&y); [line 35]\n " color=yellow style=filled]
22 -> 26 ; 22 -> 26 ;
21 [label="21: DeclStmt \n _fun_X_X(&x:class X *) [line 28]\n " shape="box"] 21 [label="21: DeclStmt \n _fun_copy_move_constructor::X_X(&x:class copy_move_constructor::X *) [line 30]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: BinaryOperatorStmt: Assign \n n$1=*&f:int [line 29]\n *&x.f:int =n$1 [line 29]\n " shape="box"] 20 [label="20: BinaryOperatorStmt: Assign \n n$1=*&f:int [line 31]\n *&x.f:int =n$1 [line 31]\n " shape="box"]
20 -> 19 ; 20 -> 19 ;
19 [label="19: Return Stmt \n n$0=*&__return_param:class X * [line 30]\n _fun_X_X(n$0:class X *,&x:class X &) [line 30]\n " shape="box"] 19 [label="19: Return Stmt \n n$0=*&__return_param:class copy_move_constructor::X * [line 32]\n _fun_copy_move_constructor::X_X(n$0:class copy_move_constructor::X *,&x:class copy_move_constructor::X &) [line 32]\n " shape="box"]
19 -> 18 ; 19 -> 18 ;
18 [label="18: Exit getX \n " color=yellow style=filled] 18 [label="18: Exit copy_move_constructor::getX \n " color=yellow style=filled]
17 [label="17: Start getX\nFormals: f:int __return_param:class X *\nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 27]\n " color=yellow style=filled] 17 [label="17: Start copy_move_constructor::getX\nFormals: f:int __return_param:class copy_move_constructor::X *\nLocals: x:class copy_move_constructor::X \n DECLARE_LOCALS(&return,&x); [line 29]\n " color=yellow style=filled]
17 -> 21 ; 17 -> 21 ;
16 [label="16: Constructor Init \n n$0=*&this:class Y * [line 24]\n n$1=*&y:class Y & [line 24]\n n$2=*n$1.f:int [line 24]\n *n$0.f:int =(n$2 - 1) [line 24]\n " shape="box"] 16 [label="16: Constructor Init \n n$0=*&this:class copy_move_constructor::Y * [line 26]\n n$1=*&y:class copy_move_constructor::Y & [line 26]\n n$2=*n$1.f:int [line 26]\n *n$0.f:int =(n$2 - 1) [line 26]\n " shape="box"]
16 -> 15 ; 16 -> 15 ;
15 [label="15: Exit Y_Y \n " color=yellow style=filled] 15 [label="15: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled]
14 [label="14: Start Y_Y\nFormals: this:class Y * y:class Y &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] 14 [label="14: Start copy_move_constructor::Y_Y\nFormals: this:class copy_move_constructor::Y * y:class copy_move_constructor::Y &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled]
14 -> 16 ; 14 -> 16 ;
13 [label="13: Constructor Init \n n$0=*&this:class Y * [line 22]\n n$1=*&y:class Y & [line 22]\n n$2=*n$1.f:int [line 22]\n *n$0.f:int =n$2 [line 22]\n " shape="box"] 13 [label="13: Constructor Init \n n$0=*&this:class copy_move_constructor::Y * [line 24]\n n$1=*&y:class copy_move_constructor::Y & [line 24]\n n$2=*n$1.f:int [line 24]\n *n$0.f:int =n$2 [line 24]\n " shape="box"]
13 -> 12 ; 13 -> 12 ;
12 [label="12: Exit Y_Y \n " color=yellow style=filled] 12 [label="12: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled]
11 [label="11: Start Y_Y\nFormals: this:class Y * y:class Y &\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] 11 [label="11: Start copy_move_constructor::Y_Y\nFormals: this:class copy_move_constructor::Y * y:class copy_move_constructor::Y &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled]
11 -> 13 ; 11 -> 13 ;
10 [label="10: Exit Y_Y \n " color=yellow style=filled] 10 [label="10: Exit copy_move_constructor::Y_Y \n " color=yellow style=filled]
9 [label="9: Start Y_Y\nFormals: this:class Y *\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled] 9 [label="9: Start copy_move_constructor::Y_Y\nFormals: this:class copy_move_constructor::Y *\nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled]
9 -> 10 ; 9 -> 10 ;
8 [label="8: Constructor Init \n n$0=*&this:class X * [line 13]\n n$1=*&__param_0:class X & [line 13]\n n$2=*n$1.f:int [line 13]\n *n$0.f:int =n$2 [line 13]\n " shape="box"] 8 [label="8: Constructor Init \n n$0=*&this:class copy_move_constructor::X * [line 15]\n n$1=*&__param_0:class copy_move_constructor::X & [line 15]\n n$2=*n$1.f:int [line 15]\n *n$0.f:int =n$2 [line 15]\n " shape="box"]
8 -> 7 ; 8 -> 7 ;
7 [label="7: Exit X_X \n " color=yellow style=filled] 7 [label="7: Exit copy_move_constructor::X_X \n " color=yellow style=filled]
6 [label="6: Start X_X\nFormals: this:class X * __param_0:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] 6 [label="6: Start copy_move_constructor::X_X\nFormals: this:class copy_move_constructor::X * __param_0:class copy_move_constructor::X &\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
6 -> 8 ; 6 -> 8 ;
5 [label="5: Constructor Init \n n$0=*&this:class X * [line 13]\n n$1=*&__param_0:class X & [line 13]\n n$2=*n$1.f:int [line 13]\n *n$0.f:int =n$2 [line 13]\n " shape="box"] 5 [label="5: Constructor Init \n n$0=*&this:class copy_move_constructor::X * [line 15]\n n$1=*&__param_0:class copy_move_constructor::X & [line 15]\n n$2=*n$1.f:int [line 15]\n *n$0.f:int =n$2 [line 15]\n " shape="box"]
5 -> 4 ; 5 -> 4 ;
4 [label="4: Exit X_X \n " color=yellow style=filled] 4 [label="4: Exit copy_move_constructor::X_X \n " color=yellow style=filled]
3 [label="3: Start X_X\nFormals: this:class X * __param_0:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] 3 [label="3: Start copy_move_constructor::X_X\nFormals: this:class copy_move_constructor::X * __param_0:class copy_move_constructor::X &\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
3 -> 5 ; 3 -> 5 ;
2 [label="2: Exit X_X \n " color=yellow style=filled] 2 [label="2: Exit copy_move_constructor::X_X \n " color=yellow style=filled]
1 [label="1: Start X_X\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] 1 [label="1: Start copy_move_constructor::X_X\nFormals: this:class copy_move_constructor::X *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
1 -> 2 ; 1 -> 2 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace temp_object {
struct X { struct X {
X(int a) { f = a; } X(int a) { f = a; }
X(int a, int b) { f = a; } X(int a, int b) { f = a; }
@ -41,3 +43,4 @@ int getX_method_div0() { return getX(0, 1).div(); }
int temp_field_div1() { return div(X(1, 0).f); } int temp_field_div1() { return div(X(1, 0).f); }
int getX_field_div1() { return div(getX(1, 0).f); } int getX_field_div1() { return div(getX(1, 0).f); }
}

@ -1,160 +1,160 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
43 [label="43: Return Stmt \n _fun_getX(1:int ,0:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 43]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 43]\n n$3=_fun_div(n$2:int ) [line 43]\n *&return:int =n$3 [line 43]\n " shape="box"] 43 [label="43: Return Stmt \n _fun_temp_object::getX(1:int ,0:int ,&0$?%__sil_tmp__temp_return_n$1:class temp_object::X *) [line 45]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 45]\n n$3=_fun_temp_object::div(n$2:int ) [line 45]\n *&return:int =n$3 [line 45]\n " shape="box"]
43 -> 42 ; 43 -> 42 ;
42 [label="42: Exit getX_field_div1 \n " color=yellow style=filled] 42 [label="42: Exit temp_object::getX_field_div1 \n " color=yellow style=filled]
41 [label="41: Start getX_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 43]\n " color=yellow style=filled] 41 [label="41: Start temp_object::getX_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 45]\n " color=yellow style=filled]
41 -> 43 ; 41 -> 43 ;
40 [label="40: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,1:int ,0:int ) [line 41]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 41]\n n$2=_fun_div(n$1:int ) [line 41]\n *&return:int =n$2 [line 41]\n " shape="box"] 40 [label="40: Return Stmt \n _fun_temp_object::X_X(&0$?%__sil_tmp__temp_construct_n$0:class temp_object::X *,1:int ,0:int ) [line 43]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 43]\n n$2=_fun_temp_object::div(n$1:int ) [line 43]\n *&return:int =n$2 [line 43]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: Exit temp_field_div1 \n " color=yellow style=filled] 39 [label="39: Exit temp_object::temp_field_div1 \n " color=yellow style=filled]
38 [label="38: Start temp_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 41]\n " color=yellow style=filled] 38 [label="38: Start temp_object::temp_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 43]\n " color=yellow style=filled]
38 -> 40 ; 38 -> 40 ;
37 [label="37: Return Stmt \n _fun_getX(0:int ,1:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 39]\n n$2=_fun_X_div(&0$?%__sil_tmp__temp_return_n$1:class X &) [line 39]\n *&return:int =n$2 [line 39]\n " shape="box"] 37 [label="37: Return Stmt \n _fun_temp_object::getX(0:int ,1:int ,&0$?%__sil_tmp__temp_return_n$1:class temp_object::X *) [line 41]\n n$2=_fun_temp_object::X_div(&0$?%__sil_tmp__temp_return_n$1:class temp_object::X &) [line 41]\n *&return:int =n$2 [line 41]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: Exit getX_method_div0 \n " color=yellow style=filled] 36 [label="36: Exit temp_object::getX_method_div0 \n " color=yellow style=filled]
35 [label="35: Start getX_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 39]\n " color=yellow style=filled] 35 [label="35: Start temp_object::getX_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 41]\n " color=yellow style=filled]
35 -> 37 ; 35 -> 37 ;
34 [label="34: Return Stmt \n _fun_getX(0:int ,1:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 37]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 37]\n n$3=_fun_div(n$2:int ) [line 37]\n *&return:int =n$3 [line 37]\n " shape="box"] 34 [label="34: Return Stmt \n _fun_temp_object::getX(0:int ,1:int ,&0$?%__sil_tmp__temp_return_n$1:class temp_object::X *) [line 39]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 39]\n n$3=_fun_temp_object::div(n$2:int ) [line 39]\n *&return:int =n$3 [line 39]\n " shape="box"]
34 -> 33 ; 34 -> 33 ;
33 [label="33: Exit getX_field_div0 \n " color=yellow style=filled] 33 [label="33: Exit temp_object::getX_field_div0 \n " color=yellow style=filled]
32 [label="32: Start getX_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 37]\n " color=yellow style=filled] 32 [label="32: Start temp_object::getX_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 39]\n " color=yellow style=filled]
32 -> 34 ; 32 -> 34 ;
31 [label="31: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,0:int ,1:int ) [line 35]\n n$1=_fun_X_div(&0$?%__sil_tmp__temp_construct_n$0:class X &) [line 35]\n *&return:int =n$1 [line 35]\n " shape="box"] 31 [label="31: Return Stmt \n _fun_temp_object::X_X(&0$?%__sil_tmp__temp_construct_n$0:class temp_object::X *,0:int ,1:int ) [line 37]\n n$1=_fun_temp_object::X_div(&0$?%__sil_tmp__temp_construct_n$0:class temp_object::X &) [line 37]\n *&return:int =n$1 [line 37]\n " shape="box"]
31 -> 30 ; 31 -> 30 ;
30 [label="30: Exit temp_method_div0 \n " color=yellow style=filled] 30 [label="30: Exit temp_object::temp_method_div0 \n " color=yellow style=filled]
29 [label="29: Start temp_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 35]\n " color=yellow style=filled] 29 [label="29: Start temp_object::temp_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 37]\n " color=yellow style=filled]
29 -> 31 ; 29 -> 31 ;
28 [label="28: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,0:int ) [line 33]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 33]\n n$2=_fun_div(n$1:int ) [line 33]\n *&return:int =n$2 [line 33]\n " shape="box"] 28 [label="28: Return Stmt \n _fun_temp_object::X_X(&0$?%__sil_tmp__temp_construct_n$0:class temp_object::X *,0:int ) [line 35]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 35]\n n$2=_fun_temp_object::div(n$1:int ) [line 35]\n *&return:int =n$2 [line 35]\n " shape="box"]
28 -> 27 ; 28 -> 27 ;
27 [label="27: Exit temp_field2_div0 \n " color=yellow style=filled] 27 [label="27: Exit temp_object::temp_field2_div0 \n " color=yellow style=filled]
26 [label="26: Start temp_field2_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 33]\n " color=yellow style=filled] 26 [label="26: Start temp_object::temp_field2_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 35]\n " color=yellow style=filled]
26 -> 28 ; 26 -> 28 ;
25 [label="25: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,0:int ,1:int ) [line 31]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 31]\n n$2=_fun_div(n$1:int ) [line 31]\n *&return:int =n$2 [line 31]\n " shape="box"] 25 [label="25: Return Stmt \n _fun_temp_object::X_X(&0$?%__sil_tmp__temp_construct_n$0:class temp_object::X *,0:int ,1:int ) [line 33]\n n$1=*&0$?%__sil_tmp__temp_construct_n$0.f:int [line 33]\n n$2=_fun_temp_object::div(n$1:int ) [line 33]\n *&return:int =n$2 [line 33]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit temp_field_div0 \n " color=yellow style=filled] 24 [label="24: Exit temp_object::temp_field_div0 \n " color=yellow style=filled]
23 [label="23: Start temp_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 31]\n " color=yellow style=filled] 23 [label="23: Start temp_object::temp_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0); [line 33]\n " color=yellow style=filled]
23 -> 25 ; 23 -> 25 ;
22 [label="22: DeclStmt \n _fun_X_X(&0$?%__sil_tmpSIL_materialize_temp__n$2:class X *,0:int ,1:int ) [line 27]\n _fun_X_X(&x:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$2:class X &) [line 27]\n " shape="box"] 22 [label="22: DeclStmt \n _fun_temp_object::X_X(&0$?%__sil_tmpSIL_materialize_temp__n$2:class temp_object::X *,0:int ,1:int ) [line 29]\n _fun_temp_object::X_X(&x:class temp_object::X *,&0$?%__sil_tmpSIL_materialize_temp__n$2:class temp_object::X &) [line 29]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Return Stmt \n _=*&x:class X [line 28]\n n$1=_fun_X_div(&x:class X &) [line 28]\n *&return:int =n$1 [line 28]\n " shape="box"] 21 [label="21: Return Stmt \n _=*&x:class temp_object::X [line 30]\n n$1=_fun_temp_object::X_div(&x:class temp_object::X &) [line 30]\n *&return:int =n$1 [line 30]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit assign_temp_div0 \n " color=yellow style=filled] 20 [label="20: Exit temp_object::assign_temp_div0 \n " color=yellow style=filled]
19 [label="19: Start assign_temp_div0\nFormals: \nLocals: x:class X 0$?%__sil_tmpSIL_materialize_temp__n$2:class X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$2); [line 26]\n " color=yellow style=filled] 19 [label="19: Start temp_object::assign_temp_div0\nFormals: \nLocals: x:class temp_object::X 0$?%__sil_tmpSIL_materialize_temp__n$2:class temp_object::X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$2); [line 28]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: Return Stmt \n n$0=*&__return_param:class X * [line 24]\n n$2=*&a:int [line 24]\n n$3=*&b:int [line 24]\n _fun_X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *,n$2:int ,n$3:int ) [line 24]\n _fun_X_X(n$0:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 24]\n " shape="box"] 18 [label="18: Return Stmt \n n$0=*&__return_param:class temp_object::X * [line 26]\n n$2=*&a:int [line 26]\n n$3=*&b:int [line 26]\n _fun_temp_object::X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class temp_object::X *,n$2:int ,n$3:int ) [line 26]\n _fun_temp_object::X_X(n$0:class temp_object::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class temp_object::X &) [line 26]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Exit getX \n " color=yellow style=filled] 17 [label="17: Exit temp_object::getX \n " color=yellow style=filled]
16 [label="16: Start getX\nFormals: a:int b:int __return_param:class X *\nLocals: 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 24]\n " color=yellow style=filled] 16 [label="16: Start temp_object::getX\nFormals: a:int b:int __return_param:class temp_object::X *\nLocals: 0$?%__sil_tmpSIL_materialize_temp__n$1:class temp_object::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 26]\n " color=yellow style=filled]
16 -> 18 ; 16 -> 18 ;
15 [label="15: Return Stmt \n n$0=*&f:int [line 19]\n *&return:int =(1 / n$0) [line 19]\n " shape="box"] 15 [label="15: Return Stmt \n n$0=*&f:int [line 21]\n *&return:int =(1 / n$0) [line 21]\n " shape="box"]
15 -> 14 ; 15 -> 14 ;
14 [label="14: Exit div \n " color=yellow style=filled] 14 [label="14: Exit temp_object::div \n " color=yellow style=filled]
13 [label="13: Start div\nFormals: f:int \nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 13 [label="13: Start temp_object::div\nFormals: f:int \nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
13 -> 15 ; 13 -> 15 ;
12 [label="12: Return Stmt \n n$0=*&this:class X * [line 16]\n n$1=*n$0.f:int [line 16]\n *&return:int =(1 / n$1) [line 16]\n " shape="box"] 12 [label="12: Return Stmt \n n$0=*&this:class temp_object::X * [line 18]\n n$1=*n$0.f:int [line 18]\n *&return:int =(1 / n$1) [line 18]\n " shape="box"]
12 -> 11 ; 12 -> 11 ;
11 [label="11: Exit X_div \n " color=yellow style=filled] 11 [label="11: Exit temp_object::X_div \n " color=yellow style=filled]
10 [label="10: Start X_div\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] 10 [label="10: Start temp_object::X_div\nFormals: this:class temp_object::X *\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n " color=yellow style=filled]
10 -> 12 ; 10 -> 12 ;
9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 14]\n n$1=*&x:class X & [line 14]\n n$2=*n$1.f:int [line 14]\n *n$0.f:int =n$2 [line 14]\n " shape="box"] 9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class temp_object::X * [line 16]\n n$1=*&x:class temp_object::X & [line 16]\n n$2=*n$1.f:int [line 16]\n *n$0.f:int =n$2 [line 16]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit X_X \n " color=yellow style=filled] 8 [label="8: Exit temp_object::X_X \n " color=yellow style=filled]
7 [label="7: Start X_X\nFormals: this:class X * x:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] 7 [label="7: Start temp_object::X_X\nFormals: this:class temp_object::X * x:class temp_object::X &\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled]
7 -> 9 ; 7 -> 9 ;
6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 12]\n n$1=*&a:int [line 12]\n *n$0.f:int =n$1 [line 12]\n " shape="box"] 6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class temp_object::X * [line 14]\n n$1=*&a:int [line 14]\n *n$0.f:int =n$1 [line 14]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit X_X \n " color=yellow style=filled] 5 [label="5: Exit temp_object::X_X \n " color=yellow style=filled]
4 [label="4: Start X_X\nFormals: this:class X * a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 4 [label="4: Start temp_object::X_X\nFormals: this:class temp_object::X * a:int b:int \nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 11]\n n$1=*&a:int [line 11]\n *n$0.f:int =n$1 [line 11]\n " shape="box"] 3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class temp_object::X * [line 13]\n n$1=*&a:int [line 13]\n *n$0.f:int =n$1 [line 13]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_X \n " color=yellow style=filled] 2 [label="2: Exit temp_object::X_X \n " color=yellow style=filled]
1 [label="1: Start X_X\nFormals: this:class X * a:int \nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] 1 [label="1: Start temp_object::X_X\nFormals: this:class temp_object::X * a:int \nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace conversion_operator {
struct X { struct X {
operator int() { return f_; } operator int() { return f_; }
operator bool() { return b_; } operator bool() { return b_; }
@ -66,3 +68,4 @@ int branch_div1() {
} }
return x; return x;
} }
}

@ -1,26 +1,26 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
61 [label="61: DeclStmt \n _fun_X_X(&x:class X *,1:int ,1:_Bool ) [line 62]\n " shape="box"] 61 [label="61: DeclStmt \n _fun_conversion_operator::X_X(&x:class conversion_operator::X *,1:int ,1:_Bool ) [line 64]\n " shape="box"]
61 -> 56 ; 61 -> 56 ;
60 [label="60: DeclStmt \n _=*&x:class X [line 64]\n n$6=_fun_X_operator_int(&x:class X &) [line 64]\n *&v:int =n$6 [line 64]\n " shape="box"] 60 [label="60: DeclStmt \n _=*&x:class conversion_operator::X [line 66]\n n$6=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 66]\n *&v:int =n$6 [line 66]\n " shape="box"]
60 -> 59 ; 60 -> 59 ;
59 [label="59: Return Stmt \n n$4=*&v:int [line 65]\n *&return:int =(1 / n$4) [line 65]\n " shape="box"] 59 [label="59: Return Stmt \n n$4=*&v:int [line 67]\n *&return:int =(1 / n$4) [line 67]\n " shape="box"]
59 -> 53 ; 59 -> 53 ;
58 [label="58: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 63]\n " shape="invhouse"] 58 [label="58: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 65]\n " shape="invhouse"]
58 -> 55 ; 58 -> 55 ;
57 [label="57: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 63]\n " shape="invhouse"] 57 [label="57: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 65]\n " shape="invhouse"]
57 -> 60 ; 57 -> 60 ;
56 [label="56: Call _fun_X_operator_bool \n _=*&x:class X [line 63]\n n$3=_fun_X_operator_bool(&x:class X &) [line 63]\n " shape="box"] 56 [label="56: Call _fun_conversion_operator::X_operator_bool \n _=*&x:class conversion_operator::X [line 65]\n n$3=_fun_conversion_operator::X_operator_bool(&x:class conversion_operator::X &) [line 65]\n " shape="box"]
56 -> 57 ; 56 -> 57 ;
@ -29,38 +29,38 @@ digraph iCFG {
55 -> 54 ; 55 -> 54 ;
54 [label="54: Return Stmt \n _=*&x:class X [line 67]\n n$1=_fun_X_operator_int(&x:class X &) [line 67]\n *&return:int =n$1 [line 67]\n " shape="box"] 54 [label="54: Return Stmt \n _=*&x:class conversion_operator::X [line 69]\n n$1=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 69]\n *&return:int =n$1 [line 69]\n " shape="box"]
54 -> 53 ; 54 -> 53 ;
53 [label="53: Exit branch_div1 \n " color=yellow style=filled] 53 [label="53: Exit conversion_operator::branch_div1 \n " color=yellow style=filled]
52 [label="52: Start branch_div1\nFormals: \nLocals: v:int x:class X \n DECLARE_LOCALS(&return,&v,&x); [line 61]\n " color=yellow style=filled] 52 [label="52: Start conversion_operator::branch_div1\nFormals: \nLocals: v:int x:class conversion_operator::X \n DECLARE_LOCALS(&return,&v,&x); [line 63]\n " color=yellow style=filled]
52 -> 61 ; 52 -> 61 ;
51 [label="51: DeclStmt \n _fun_X_X(&x:class X *,0:int ,0:_Bool ) [line 53]\n " shape="box"] 51 [label="51: DeclStmt \n _fun_conversion_operator::X_X(&x:class conversion_operator::X *,0:int ,0:_Bool ) [line 55]\n " shape="box"]
51 -> 46 ; 51 -> 46 ;
50 [label="50: DeclStmt \n _=*&x:class X [line 55]\n n$6=_fun_X_operator_int(&x:class X &) [line 55]\n *&v:int =n$6 [line 55]\n " shape="box"] 50 [label="50: DeclStmt \n _=*&x:class conversion_operator::X [line 57]\n n$6=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 57]\n *&v:int =n$6 [line 57]\n " shape="box"]
50 -> 49 ; 50 -> 49 ;
49 [label="49: Return Stmt \n n$4=*&v:int [line 56]\n *&return:int =(1 / n$4) [line 56]\n " shape="box"] 49 [label="49: Return Stmt \n n$4=*&v:int [line 58]\n *&return:int =(1 / n$4) [line 58]\n " shape="box"]
49 -> 43 ; 49 -> 43 ;
48 [label="48: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 54]\n " shape="invhouse"] 48 [label="48: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 56]\n " shape="invhouse"]
48 -> 45 ; 48 -> 45 ;
47 [label="47: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 54]\n " shape="invhouse"] 47 [label="47: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 56]\n " shape="invhouse"]
47 -> 50 ; 47 -> 50 ;
46 [label="46: Call _fun_X_operator_bool \n _=*&x:class X [line 54]\n n$3=_fun_X_operator_bool(&x:class X &) [line 54]\n " shape="box"] 46 [label="46: Call _fun_conversion_operator::X_operator_bool \n _=*&x:class conversion_operator::X [line 56]\n n$3=_fun_conversion_operator::X_operator_bool(&x:class conversion_operator::X &) [line 56]\n " shape="box"]
46 -> 47 ; 46 -> 47 ;
@ -69,46 +69,46 @@ digraph iCFG {
45 -> 44 ; 45 -> 44 ;
44 [label="44: Return Stmt \n _=*&x:class X [line 58]\n n$1=_fun_X_operator_int(&x:class X &) [line 58]\n *&return:int =n$1 [line 58]\n " shape="box"] 44 [label="44: Return Stmt \n _=*&x:class conversion_operator::X [line 60]\n n$1=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 60]\n *&return:int =n$1 [line 60]\n " shape="box"]
44 -> 43 ; 44 -> 43 ;
43 [label="43: Exit branch_no_div \n " color=yellow style=filled] 43 [label="43: Exit conversion_operator::branch_no_div \n " color=yellow style=filled]
42 [label="42: Start branch_no_div\nFormals: \nLocals: v:int x:class X \n DECLARE_LOCALS(&return,&v,&x); [line 52]\n " color=yellow style=filled] 42 [label="42: Start conversion_operator::branch_no_div\nFormals: \nLocals: v:int x:class conversion_operator::X \n DECLARE_LOCALS(&return,&v,&x); [line 54]\n " color=yellow style=filled]
42 -> 51 ; 42 -> 51 ;
41 [label="41: DeclStmt \n _fun_Y_Y(&y:class Y *) [line 42]\n " shape="box"] 41 [label="41: DeclStmt \n _fun_conversion_operator::Y_Y(&y:class conversion_operator::Y *) [line 44]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: BinaryOperatorStmt: Assign \n *&y.f:int =0 [line 43]\n " shape="box"] 40 [label="40: BinaryOperatorStmt: Assign \n *&y.f:int =0 [line 45]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: BinaryOperatorStmt: Assign \n *&y.b:int =1 [line 44]\n " shape="box"] 39 [label="39: BinaryOperatorStmt: Assign \n *&y.b:int =1 [line 46]\n " shape="box"]
39 -> 34 ; 39 -> 34 ;
38 [label="38: DeclStmt \n _=*&y:class Y [line 46]\n _fun_Y_operator_X(&y:class Y &,&0$?%__sil_tmpSIL_materialize_temp__n$12:class X *) [line 46]\n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$11:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$12:class X &) [line 46]\n n$15=_fun_X_operator_int(&0$?%__sil_tmp__temp_construct_n$11:class X &) [line 46]\n *&v:int =n$15 [line 46]\n " shape="box"] 38 [label="38: DeclStmt \n _=*&y:class conversion_operator::Y [line 48]\n _fun_conversion_operator::Y_operator_X(&y:class conversion_operator::Y &,&0$?%__sil_tmpSIL_materialize_temp__n$12:class conversion_operator::X *) [line 48]\n _fun_conversion_operator::X_X(&0$?%__sil_tmp__temp_construct_n$11:class conversion_operator::X *,&0$?%__sil_tmpSIL_materialize_temp__n$12:class conversion_operator::X &) [line 48]\n n$15=_fun_conversion_operator::X_operator_int(&0$?%__sil_tmp__temp_construct_n$11:class conversion_operator::X &) [line 48]\n *&v:int =n$15 [line 48]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: Return Stmt \n n$10=*&v:int [line 47]\n *&return:int =(1 / n$10) [line 47]\n " shape="box"] 37 [label="37: Return Stmt \n n$10=*&v:int [line 49]\n *&return:int =(1 / n$10) [line 49]\n " shape="box"]
37 -> 31 ; 37 -> 31 ;
36 [label="36: Prune (false branch) \n PRUNE((n$9 == 0), false); [line 45]\n " shape="invhouse"] 36 [label="36: Prune (false branch) \n PRUNE((n$9 == 0), false); [line 47]\n " shape="invhouse"]
36 -> 33 ; 36 -> 33 ;
35 [label="35: Prune (true branch) \n PRUNE((n$9 != 0), true); [line 45]\n " shape="invhouse"] 35 [label="35: Prune (true branch) \n PRUNE((n$9 != 0), true); [line 47]\n " shape="invhouse"]
35 -> 38 ; 35 -> 38 ;
34 [label="34: Call _fun_X_operator_bool \n _=*&y:class Y [line 45]\n _fun_Y_operator_X(&y:class Y &,&0$?%__sil_tmpSIL_materialize_temp__n$6:class X *) [line 45]\n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$5:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$6:class X &) [line 45]\n n$9=_fun_X_operator_bool(&0$?%__sil_tmp__temp_construct_n$5:class X &) [line 45]\n " shape="box"] 34 [label="34: Call _fun_conversion_operator::X_operator_bool \n _=*&y:class conversion_operator::Y [line 47]\n _fun_conversion_operator::Y_operator_X(&y:class conversion_operator::Y &,&0$?%__sil_tmpSIL_materialize_temp__n$6:class conversion_operator::X *) [line 47]\n _fun_conversion_operator::X_X(&0$?%__sil_tmp__temp_construct_n$5:class conversion_operator::X *,&0$?%__sil_tmpSIL_materialize_temp__n$6:class conversion_operator::X &) [line 47]\n n$9=_fun_conversion_operator::X_operator_bool(&0$?%__sil_tmp__temp_construct_n$5:class conversion_operator::X &) [line 47]\n " shape="box"]
34 -> 35 ; 34 -> 35 ;
@ -117,38 +117,38 @@ digraph iCFG {
33 -> 32 ; 33 -> 32 ;
32 [label="32: Return Stmt \n _=*&y:class Y [line 49]\n _fun_Y_operator_X(&y:class Y &,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *) [line 49]\n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 49]\n n$4=_fun_X_operator_int(&0$?%__sil_tmp__temp_construct_n$0:class X &) [line 49]\n *&return:int =n$4 [line 49]\n " shape="box"] 32 [label="32: Return Stmt \n _=*&y:class conversion_operator::Y [line 51]\n _fun_conversion_operator::Y_operator_X(&y:class conversion_operator::Y &,&0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X *) [line 51]\n _fun_conversion_operator::X_X(&0$?%__sil_tmp__temp_construct_n$0:class conversion_operator::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X &) [line 51]\n n$4=_fun_conversion_operator::X_operator_int(&0$?%__sil_tmp__temp_construct_n$0:class conversion_operator::X &) [line 51]\n *&return:int =n$4 [line 51]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: Exit y_branch_div0 \n " color=yellow style=filled] 31 [label="31: Exit conversion_operator::y_branch_div0 \n " color=yellow style=filled]
30 [label="30: Start y_branch_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X 0$?%__sil_tmpSIL_materialize_temp__n$1:class X 0$?%__sil_tmp__temp_construct_n$5:class X 0$?%__sil_tmpSIL_materialize_temp__n$6:class X v:int 0$?%__sil_tmp__temp_construct_n$11:class X 0$?%__sil_tmpSIL_materialize_temp__n$12:class X y:class Y \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1,&0$?%__sil_tmp__temp_construct_n$5,&0$?%__sil_tmpSIL_materialize_temp__n$6,&v,&0$?%__sil_tmp__temp_construct_n$11,&0$?%__sil_tmpSIL_materialize_temp__n$12,&y); [line 41]\n " color=yellow style=filled] 30 [label="30: Start conversion_operator::y_branch_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class conversion_operator::X 0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X 0$?%__sil_tmp__temp_construct_n$5:class conversion_operator::X 0$?%__sil_tmpSIL_materialize_temp__n$6:class conversion_operator::X v:int 0$?%__sil_tmp__temp_construct_n$11:class conversion_operator::X 0$?%__sil_tmpSIL_materialize_temp__n$12:class conversion_operator::X y:class conversion_operator::Y \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1,&0$?%__sil_tmp__temp_construct_n$5,&0$?%__sil_tmpSIL_materialize_temp__n$6,&v,&0$?%__sil_tmp__temp_construct_n$11,&0$?%__sil_tmpSIL_materialize_temp__n$12,&y); [line 43]\n " color=yellow style=filled]
30 -> 41 ; 30 -> 41 ;
29 [label="29: DeclStmt \n _fun_X_X(&x:class X *,0:int ,1:_Bool ) [line 33]\n " shape="box"] 29 [label="29: DeclStmt \n _fun_conversion_operator::X_X(&x:class conversion_operator::X *,0:int ,1:_Bool ) [line 35]\n " shape="box"]
29 -> 24 ; 29 -> 24 ;
28 [label="28: DeclStmt \n _=*&x:class X [line 35]\n n$6=_fun_X_operator_int(&x:class X &) [line 35]\n *&v:int =n$6 [line 35]\n " shape="box"] 28 [label="28: DeclStmt \n _=*&x:class conversion_operator::X [line 37]\n n$6=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 37]\n *&v:int =n$6 [line 37]\n " shape="box"]
28 -> 27 ; 28 -> 27 ;
27 [label="27: Return Stmt \n n$4=*&v:int [line 36]\n *&return:int =(1 / n$4) [line 36]\n " shape="box"] 27 [label="27: Return Stmt \n n$4=*&v:int [line 38]\n *&return:int =(1 / n$4) [line 38]\n " shape="box"]
27 -> 21 ; 27 -> 21 ;
26 [label="26: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 34]\n " shape="invhouse"] 26 [label="26: Prune (false branch) \n PRUNE((n$3 == 0), false); [line 36]\n " shape="invhouse"]
26 -> 23 ; 26 -> 23 ;
25 [label="25: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 34]\n " shape="invhouse"] 25 [label="25: Prune (true branch) \n PRUNE((n$3 != 0), true); [line 36]\n " shape="invhouse"]
25 -> 28 ; 25 -> 28 ;
24 [label="24: Call _fun_X_operator_bool \n _=*&x:class X [line 34]\n n$3=_fun_X_operator_bool(&x:class X &) [line 34]\n " shape="box"] 24 [label="24: Call _fun_conversion_operator::X_operator_bool \n _=*&x:class conversion_operator::X [line 36]\n n$3=_fun_conversion_operator::X_operator_bool(&x:class conversion_operator::X &) [line 36]\n " shape="box"]
24 -> 25 ; 24 -> 25 ;
@ -157,84 +157,84 @@ digraph iCFG {
23 -> 22 ; 23 -> 22 ;
22 [label="22: Return Stmt \n _=*&x:class X [line 38]\n n$1=_fun_X_operator_int(&x:class X &) [line 38]\n *&return:int =n$1 [line 38]\n " shape="box"] 22 [label="22: Return Stmt \n _=*&x:class conversion_operator::X [line 40]\n n$1=_fun_conversion_operator::X_operator_int(&x:class conversion_operator::X &) [line 40]\n *&return:int =n$1 [line 40]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Exit branch_div0 \n " color=yellow style=filled] 21 [label="21: Exit conversion_operator::branch_div0 \n " color=yellow style=filled]
20 [label="20: Start branch_div0\nFormals: \nLocals: v:int x:class X \n DECLARE_LOCALS(&return,&v,&x); [line 32]\n " color=yellow style=filled] 20 [label="20: Start conversion_operator::branch_div0\nFormals: \nLocals: v:int x:class conversion_operator::X \n DECLARE_LOCALS(&return,&v,&x); [line 34]\n " color=yellow style=filled]
20 -> 29 ; 20 -> 29 ;
19 [label="19: Exit Y_Y \n " color=yellow style=filled] 19 [label="19: Exit conversion_operator::Y_Y \n " color=yellow style=filled]
18 [label="18: Start Y_Y\nFormals: this:class Y *\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] 18 [label="18: Start conversion_operator::Y_Y\nFormals: this:class conversion_operator::Y *\nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled]
18 -> 19 ; 18 -> 19 ;
17 [label="17: Return Stmt \n n$0=*&__return_param:class X * [line 27]\n n$2=*&this:class Y * [line 27]\n n$3=*n$2.f:int [line 27]\n n$4=*&this:class Y * [line 27]\n n$5=*n$4.b:int [line 27]\n _fun_X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *,n$3:int ,n$5:_Bool ) [line 27]\n _fun_X_X(n$0:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 27]\n " shape="box"] 17 [label="17: Return Stmt \n n$0=*&__return_param:class conversion_operator::X * [line 29]\n n$2=*&this:class conversion_operator::Y * [line 29]\n n$3=*n$2.f:int [line 29]\n n$4=*&this:class conversion_operator::Y * [line 29]\n n$5=*n$4.b:int [line 29]\n _fun_conversion_operator::X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X *,n$3:int ,n$5:_Bool ) [line 29]\n _fun_conversion_operator::X_X(n$0:class conversion_operator::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X &) [line 29]\n " shape="box"]
17 -> 16 ; 17 -> 16 ;
16 [label="16: Exit Y_operator_X \n " color=yellow style=filled] 16 [label="16: Exit conversion_operator::Y_operator_X \n " color=yellow style=filled]
15 [label="15: Start Y_operator_X\nFormals: this:class Y * __return_param:class X *\nLocals: 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 27]\n " color=yellow style=filled] 15 [label="15: Start conversion_operator::Y_operator_X\nFormals: this:class conversion_operator::Y * __return_param:class conversion_operator::X *\nLocals: 0$?%__sil_tmpSIL_materialize_temp__n$1:class conversion_operator::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 29]\n " color=yellow style=filled]
15 -> 17 ; 15 -> 17 ;
14 [label="14: BinaryOperatorStmt: Assign \n n$3=*&this:class X * [line 20]\n n$4=*&x:class X & [line 20]\n n$5=*n$4.f_:int [line 20]\n *n$3.f_:int =n$5 [line 20]\n " shape="box"] 14 [label="14: BinaryOperatorStmt: Assign \n n$3=*&this:class conversion_operator::X * [line 22]\n n$4=*&x:class conversion_operator::X & [line 22]\n n$5=*n$4.f_:int [line 22]\n *n$3.f_:int =n$5 [line 22]\n " shape="box"]
14 -> 13 ; 14 -> 13 ;
13 [label="13: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 21]\n n$1=*&x:class X & [line 21]\n n$2=*n$1.b_:_Bool [line 21]\n *n$0.b_:_Bool =n$2 [line 21]\n " shape="box"] 13 [label="13: BinaryOperatorStmt: Assign \n n$0=*&this:class conversion_operator::X * [line 23]\n n$1=*&x:class conversion_operator::X & [line 23]\n n$2=*n$1.b_:_Bool [line 23]\n *n$0.b_:_Bool =n$2 [line 23]\n " shape="box"]
13 -> 12 ; 13 -> 12 ;
12 [label="12: Exit X_X \n " color=yellow style=filled] 12 [label="12: Exit conversion_operator::X_X \n " color=yellow style=filled]
11 [label="11: Start X_X\nFormals: this:class X * x:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 11 [label="11: Start conversion_operator::X_X\nFormals: this:class conversion_operator::X * x:class conversion_operator::X &\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
11 -> 14 ; 11 -> 14 ;
10 [label="10: BinaryOperatorStmt: Assign \n n$2=*&this:class X * [line 16]\n n$3=*&f:int [line 16]\n *n$2.f_:int =n$3 [line 16]\n " shape="box"] 10 [label="10: BinaryOperatorStmt: Assign \n n$2=*&this:class conversion_operator::X * [line 18]\n n$3=*&f:int [line 18]\n *n$2.f_:int =n$3 [line 18]\n " shape="box"]
10 -> 9 ; 10 -> 9 ;
9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 17]\n n$1=*&b:_Bool [line 17]\n *n$0.b_:_Bool =n$1 [line 17]\n " shape="box"] 9 [label="9: BinaryOperatorStmt: Assign \n n$0=*&this:class conversion_operator::X * [line 19]\n n$1=*&b:_Bool [line 19]\n *n$0.b_:_Bool =n$1 [line 19]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit X_X \n " color=yellow style=filled] 8 [label="8: Exit conversion_operator::X_X \n " color=yellow style=filled]
7 [label="7: Start X_X\nFormals: this:class X * f:int b:_Bool \nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 7 [label="7: Start conversion_operator::X_X\nFormals: this:class conversion_operator::X * f:int b:_Bool \nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
7 -> 10 ; 7 -> 10 ;
6 [label="6: Return Stmt \n n$0=*&this:class X * [line 12]\n n$1=*n$0.b_:_Bool [line 12]\n *&return:_Bool =n$1 [line 12]\n " shape="box"] 6 [label="6: Return Stmt \n n$0=*&this:class conversion_operator::X * [line 14]\n n$1=*n$0.b_:_Bool [line 14]\n *&return:_Bool =n$1 [line 14]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit X_operator_bool \n " color=yellow style=filled] 5 [label="5: Exit conversion_operator::X_operator_bool \n " color=yellow style=filled]
4 [label="4: Start X_operator_bool\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 4 [label="4: Start conversion_operator::X_operator_bool\nFormals: this:class conversion_operator::X *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: Return Stmt \n n$0=*&this:class X * [line 11]\n n$1=*n$0.f_:int [line 11]\n *&return:int =n$1 [line 11]\n " shape="box"] 3 [label="3: Return Stmt \n n$0=*&this:class conversion_operator::X * [line 13]\n n$1=*n$0.f_:int [line 13]\n *&return:int =n$1 [line 13]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_operator_int \n " color=yellow style=filled] 2 [label="2: Exit conversion_operator::X_operator_int \n " color=yellow style=filled]
1 [label="1: Start X_operator_int\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] 1 [label="1: Start conversion_operator::X_operator_int\nFormals: this:class conversion_operator::X *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace reference_field {
struct X { struct X {
int f; int f;
}; };
@ -140,3 +142,4 @@ int val_getI_div0() {
x.f = 1; x.f = 1;
return 1 / r.getI(); return 1 / r.getI();
} }
}

@ -1,455 +1,455 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
119 [label="119: DeclStmt \n _fun_X_X(&x:class X *) [line 137]\n " shape="box"] 119 [label="119: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 139]\n " shape="box"]
119 -> 118 ; 119 -> 118 ;
118 [label="118: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 138]\n " shape="box"] 118 [label="118: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 140]\n " shape="box"]
118 -> 117 ; 118 -> 117 ;
117 [label="117: DeclStmt \n _fun_Val_Val(&r:class Val *,&x:class X &) [line 139]\n " shape="box"] 117 [label="117: DeclStmt \n _fun_reference_field::Val_Val(&r:class reference_field::Val *,&x:class reference_field::X &) [line 141]\n " shape="box"]
117 -> 116 ; 117 -> 116 ;
116 [label="116: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 140]\n " shape="box"] 116 [label="116: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 142]\n " shape="box"]
116 -> 115 ; 116 -> 115 ;
115 [label="115: Return Stmt \n _=*&r:class Val [line 141]\n n$1=_fun_Val_getI(&r:class Val &) [line 141]\n *&return:int =(1 / n$1) [line 141]\n " shape="box"] 115 [label="115: Return Stmt \n _=*&r:class reference_field::Val [line 143]\n n$1=_fun_reference_field::Val_getI(&r:class reference_field::Val &) [line 143]\n *&return:int =(1 / n$1) [line 143]\n " shape="box"]
115 -> 114 ; 115 -> 114 ;
114 [label="114: Exit val_getI_div0 \n " color=yellow style=filled] 114 [label="114: Exit reference_field::val_getI_div0 \n " color=yellow style=filled]
113 [label="113: Start val_getI_div0\nFormals: \nLocals: r:class Val x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 136]\n " color=yellow style=filled] 113 [label="113: Start reference_field::val_getI_div0\nFormals: \nLocals: r:class reference_field::Val x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 138]\n " color=yellow style=filled]
113 -> 119 ; 113 -> 119 ;
112 [label="112: DeclStmt \n _fun_X_X(&x:class X *) [line 129]\n " shape="box"] 112 [label="112: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 131]\n " shape="box"]
112 -> 111 ; 112 -> 111 ;
111 [label="111: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 130]\n " shape="box"] 111 [label="111: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 132]\n " shape="box"]
111 -> 110 ; 111 -> 110 ;
110 [label="110: DeclStmt \n _fun_Val_Val(&r:class Val *,&x:class X &) [line 131]\n " shape="box"] 110 [label="110: DeclStmt \n _fun_reference_field::Val_Val(&r:class reference_field::Val *,&x:class reference_field::X &) [line 133]\n " shape="box"]
110 -> 109 ; 110 -> 109 ;
109 [label="109: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 132]\n " shape="box"] 109 [label="109: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 134]\n " shape="box"]
109 -> 108 ; 109 -> 108 ;
108 [label="108: Return Stmt \n _=*&r:class Val [line 133]\n n$1=_fun_Val_getF(&r:class Val &) [line 133]\n *&return:int =(1 / n$1) [line 133]\n " shape="box"] 108 [label="108: Return Stmt \n _=*&r:class reference_field::Val [line 135]\n n$1=_fun_reference_field::Val_getF(&r:class reference_field::Val &) [line 135]\n *&return:int =(1 / n$1) [line 135]\n " shape="box"]
108 -> 107 ; 108 -> 107 ;
107 [label="107: Exit val_getF_div0 \n " color=yellow style=filled] 107 [label="107: Exit reference_field::val_getF_div0 \n " color=yellow style=filled]
106 [label="106: Start val_getF_div0\nFormals: \nLocals: r:class Val x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 128]\n " color=yellow style=filled] 106 [label="106: Start reference_field::val_getF_div0\nFormals: \nLocals: r:class reference_field::Val x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 130]\n " color=yellow style=filled]
106 -> 112 ; 106 -> 112 ;
105 [label="105: DeclStmt \n _fun_X_X(&x:class X *) [line 121]\n " shape="box"] 105 [label="105: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 123]\n " shape="box"]
105 -> 104 ; 105 -> 104 ;
104 [label="104: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 122]\n " shape="box"] 104 [label="104: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 124]\n " shape="box"]
104 -> 103 ; 104 -> 103 ;
103 [label="103: DeclStmt \n _fun_Val_Val(&r:class Val *,&x:class X &) [line 123]\n " shape="box"] 103 [label="103: DeclStmt \n _fun_reference_field::Val_Val(&r:class reference_field::Val *,&x:class reference_field::X &) [line 125]\n " shape="box"]
103 -> 102 ; 103 -> 102 ;
102 [label="102: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 124]\n " shape="box"] 102 [label="102: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 126]\n " shape="box"]
102 -> 101 ; 102 -> 101 ;
101 [label="101: Return Stmt \n n$0=*&r.i:int [line 125]\n *&return:int =(1 / n$0) [line 125]\n " shape="box"] 101 [label="101: Return Stmt \n n$0=*&r.i:int [line 127]\n *&return:int =(1 / n$0) [line 127]\n " shape="box"]
101 -> 100 ; 101 -> 100 ;
100 [label="100: Exit val_I_div0 \n " color=yellow style=filled] 100 [label="100: Exit reference_field::val_I_div0 \n " color=yellow style=filled]
99 [label="99: Start val_I_div0\nFormals: \nLocals: r:class Val x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 120]\n " color=yellow style=filled] 99 [label="99: Start reference_field::val_I_div0\nFormals: \nLocals: r:class reference_field::Val x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 122]\n " color=yellow style=filled]
99 -> 105 ; 99 -> 105 ;
98 [label="98: DeclStmt \n _fun_X_X(&x:class X *) [line 113]\n " shape="box"] 98 [label="98: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 115]\n " shape="box"]
98 -> 97 ; 98 -> 97 ;
97 [label="97: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 114]\n " shape="box"] 97 [label="97: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 116]\n " shape="box"]
97 -> 96 ; 97 -> 96 ;
96 [label="96: DeclStmt \n _fun_Val_Val(&r:class Val *,&x:class X &) [line 115]\n " shape="box"] 96 [label="96: DeclStmt \n _fun_reference_field::Val_Val(&r:class reference_field::Val *,&x:class reference_field::X &) [line 117]\n " shape="box"]
96 -> 95 ; 96 -> 95 ;
95 [label="95: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 116]\n " shape="box"] 95 [label="95: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 118]\n " shape="box"]
95 -> 94 ; 95 -> 94 ;
94 [label="94: Return Stmt \n n$0=*&r.x.f:int [line 117]\n *&return:int =(1 / n$0) [line 117]\n " shape="box"] 94 [label="94: Return Stmt \n n$0=*&r.x.f:int [line 119]\n *&return:int =(1 / n$0) [line 119]\n " shape="box"]
94 -> 93 ; 94 -> 93 ;
93 [label="93: Exit val_F_div0 \n " color=yellow style=filled] 93 [label="93: Exit reference_field::val_F_div0 \n " color=yellow style=filled]
92 [label="92: Start val_F_div0\nFormals: \nLocals: r:class Val x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 112]\n " color=yellow style=filled] 92 [label="92: Start reference_field::val_F_div0\nFormals: \nLocals: r:class reference_field::Val x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 114]\n " color=yellow style=filled]
92 -> 98 ; 92 -> 98 ;
91 [label="91: DeclStmt \n _fun_X_X(&x:class X *) [line 104]\n " shape="box"] 91 [label="91: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 106]\n " shape="box"]
91 -> 90 ; 91 -> 90 ;
90 [label="90: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 105]\n " shape="box"] 90 [label="90: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 107]\n " shape="box"]
90 -> 89 ; 90 -> 89 ;
89 [label="89: DeclStmt \n _fun_Ptr_Ptr(&r:class Ptr *,&x:class X &) [line 106]\n " shape="box"] 89 [label="89: DeclStmt \n _fun_reference_field::Ptr_Ptr(&r:class reference_field::Ptr *,&x:class reference_field::X &) [line 108]\n " shape="box"]
89 -> 88 ; 89 -> 88 ;
88 [label="88: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 107]\n " shape="box"] 88 [label="88: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 109]\n " shape="box"]
88 -> 87 ; 88 -> 87 ;
87 [label="87: Return Stmt \n _=*&r:class Ptr [line 108]\n n$1=_fun_Ptr_getI(&r:class Ptr &) [line 108]\n *&return:int =(1 / n$1) [line 108]\n " shape="box"] 87 [label="87: Return Stmt \n _=*&r:class reference_field::Ptr [line 110]\n n$1=_fun_reference_field::Ptr_getI(&r:class reference_field::Ptr &) [line 110]\n *&return:int =(1 / n$1) [line 110]\n " shape="box"]
87 -> 86 ; 87 -> 86 ;
86 [label="86: Exit ptr_getI_div0 \n " color=yellow style=filled] 86 [label="86: Exit reference_field::ptr_getI_div0 \n " color=yellow style=filled]
85 [label="85: Start ptr_getI_div0\nFormals: \nLocals: r:class Ptr x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 103]\n " color=yellow style=filled] 85 [label="85: Start reference_field::ptr_getI_div0\nFormals: \nLocals: r:class reference_field::Ptr x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 105]\n " color=yellow style=filled]
85 -> 91 ; 85 -> 91 ;
84 [label="84: DeclStmt \n _fun_X_X(&x:class X *) [line 96]\n " shape="box"] 84 [label="84: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 98]\n " shape="box"]
84 -> 83 ; 84 -> 83 ;
83 [label="83: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 97]\n " shape="box"] 83 [label="83: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 99]\n " shape="box"]
83 -> 82 ; 83 -> 82 ;
82 [label="82: DeclStmt \n _fun_Ptr_Ptr(&r:class Ptr *,&x:class X &) [line 98]\n " shape="box"] 82 [label="82: DeclStmt \n _fun_reference_field::Ptr_Ptr(&r:class reference_field::Ptr *,&x:class reference_field::X &) [line 100]\n " shape="box"]
82 -> 81 ; 82 -> 81 ;
81 [label="81: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 99]\n " shape="box"] 81 [label="81: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 101]\n " shape="box"]
81 -> 80 ; 81 -> 80 ;
80 [label="80: Return Stmt \n _=*&r:class Ptr [line 100]\n n$1=_fun_Ptr_getF(&r:class Ptr &) [line 100]\n *&return:int =(1 / n$1) [line 100]\n " shape="box"] 80 [label="80: Return Stmt \n _=*&r:class reference_field::Ptr [line 102]\n n$1=_fun_reference_field::Ptr_getF(&r:class reference_field::Ptr &) [line 102]\n *&return:int =(1 / n$1) [line 102]\n " shape="box"]
80 -> 79 ; 80 -> 79 ;
79 [label="79: Exit ptr_getF_div0 \n " color=yellow style=filled] 79 [label="79: Exit reference_field::ptr_getF_div0 \n " color=yellow style=filled]
78 [label="78: Start ptr_getF_div0\nFormals: \nLocals: r:class Ptr x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 95]\n " color=yellow style=filled] 78 [label="78: Start reference_field::ptr_getF_div0\nFormals: \nLocals: r:class reference_field::Ptr x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 97]\n " color=yellow style=filled]
78 -> 84 ; 78 -> 84 ;
77 [label="77: DeclStmt \n _fun_X_X(&x:class X *) [line 88]\n " shape="box"] 77 [label="77: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 90]\n " shape="box"]
77 -> 76 ; 77 -> 76 ;
76 [label="76: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 89]\n " shape="box"] 76 [label="76: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 91]\n " shape="box"]
76 -> 75 ; 76 -> 75 ;
75 [label="75: DeclStmt \n _fun_Ptr_Ptr(&r:class Ptr *,&x:class X &) [line 90]\n " shape="box"] 75 [label="75: DeclStmt \n _fun_reference_field::Ptr_Ptr(&r:class reference_field::Ptr *,&x:class reference_field::X &) [line 92]\n " shape="box"]
75 -> 74 ; 75 -> 74 ;
74 [label="74: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 91]\n " shape="box"] 74 [label="74: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 93]\n " shape="box"]
74 -> 73 ; 74 -> 73 ;
73 [label="73: Return Stmt \n n$0=*&r.i:int * [line 92]\n n$1=*n$0:int [line 92]\n *&return:int =(1 / n$1) [line 92]\n " shape="box"] 73 [label="73: Return Stmt \n n$0=*&r.i:int * [line 94]\n n$1=*n$0:int [line 94]\n *&return:int =(1 / n$1) [line 94]\n " shape="box"]
73 -> 72 ; 73 -> 72 ;
72 [label="72: Exit ptr_I_div0 \n " color=yellow style=filled] 72 [label="72: Exit reference_field::ptr_I_div0 \n " color=yellow style=filled]
71 [label="71: Start ptr_I_div0\nFormals: \nLocals: r:class Ptr x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 87]\n " color=yellow style=filled] 71 [label="71: Start reference_field::ptr_I_div0\nFormals: \nLocals: r:class reference_field::Ptr x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 89]\n " color=yellow style=filled]
71 -> 77 ; 71 -> 77 ;
70 [label="70: DeclStmt \n _fun_X_X(&x:class X *) [line 80]\n " shape="box"] 70 [label="70: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 82]\n " shape="box"]
70 -> 69 ; 70 -> 69 ;
69 [label="69: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 81]\n " shape="box"] 69 [label="69: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 83]\n " shape="box"]
69 -> 68 ; 69 -> 68 ;
68 [label="68: DeclStmt \n _fun_Ptr_Ptr(&r:class Ptr *,&x:class X &) [line 82]\n " shape="box"] 68 [label="68: DeclStmt \n _fun_reference_field::Ptr_Ptr(&r:class reference_field::Ptr *,&x:class reference_field::X &) [line 84]\n " shape="box"]
68 -> 67 ; 68 -> 67 ;
67 [label="67: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 83]\n " shape="box"] 67 [label="67: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 85]\n " shape="box"]
67 -> 66 ; 67 -> 66 ;
66 [label="66: Return Stmt \n n$0=*&r.x:class X * [line 84]\n n$1=*n$0.f:int [line 84]\n *&return:int =(1 / n$1) [line 84]\n " shape="box"] 66 [label="66: Return Stmt \n n$0=*&r.x:class reference_field::X * [line 86]\n n$1=*n$0.f:int [line 86]\n *&return:int =(1 / n$1) [line 86]\n " shape="box"]
66 -> 65 ; 66 -> 65 ;
65 [label="65: Exit ptr_F_div0 \n " color=yellow style=filled] 65 [label="65: Exit reference_field::ptr_F_div0 \n " color=yellow style=filled]
64 [label="64: Start ptr_F_div0\nFormals: \nLocals: r:class Ptr x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 79]\n " color=yellow style=filled] 64 [label="64: Start reference_field::ptr_F_div0\nFormals: \nLocals: r:class reference_field::Ptr x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 81]\n " color=yellow style=filled]
64 -> 70 ; 64 -> 70 ;
63 [label="63: DeclStmt \n _fun_X_X(&x:class X *) [line 71]\n " shape="box"] 63 [label="63: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 73]\n " shape="box"]
63 -> 62 ; 63 -> 62 ;
62 [label="62: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 72]\n " shape="box"] 62 [label="62: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 74]\n " shape="box"]
62 -> 61 ; 62 -> 61 ;
61 [label="61: DeclStmt \n _fun_Ref_Ref(&r:class Ref *,&x:class X &) [line 73]\n " shape="box"] 61 [label="61: DeclStmt \n _fun_reference_field::Ref_Ref(&r:class reference_field::Ref *,&x:class reference_field::X &) [line 75]\n " shape="box"]
61 -> 60 ; 61 -> 60 ;
60 [label="60: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 74]\n " shape="box"] 60 [label="60: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 76]\n " shape="box"]
60 -> 59 ; 60 -> 59 ;
59 [label="59: Return Stmt \n _=*&r:class Ref [line 75]\n n$1=_fun_Ref_getI(&r:class Ref &) [line 75]\n *&return:int =(1 / n$1) [line 75]\n " shape="box"] 59 [label="59: Return Stmt \n _=*&r:class reference_field::Ref [line 77]\n n$1=_fun_reference_field::Ref_getI(&r:class reference_field::Ref &) [line 77]\n *&return:int =(1 / n$1) [line 77]\n " shape="box"]
59 -> 58 ; 59 -> 58 ;
58 [label="58: Exit ref_getI_div0 \n " color=yellow style=filled] 58 [label="58: Exit reference_field::ref_getI_div0 \n " color=yellow style=filled]
57 [label="57: Start ref_getI_div0\nFormals: \nLocals: r:class Ref x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 70]\n " color=yellow style=filled] 57 [label="57: Start reference_field::ref_getI_div0\nFormals: \nLocals: r:class reference_field::Ref x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 72]\n " color=yellow style=filled]
57 -> 63 ; 57 -> 63 ;
56 [label="56: DeclStmt \n _fun_X_X(&x:class X *) [line 63]\n " shape="box"] 56 [label="56: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 65]\n " shape="box"]
56 -> 55 ; 56 -> 55 ;
55 [label="55: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 64]\n " shape="box"] 55 [label="55: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 66]\n " shape="box"]
55 -> 54 ; 55 -> 54 ;
54 [label="54: DeclStmt \n _fun_Ref_Ref(&r:class Ref *,&x:class X &) [line 65]\n " shape="box"] 54 [label="54: DeclStmt \n _fun_reference_field::Ref_Ref(&r:class reference_field::Ref *,&x:class reference_field::X &) [line 67]\n " shape="box"]
54 -> 53 ; 54 -> 53 ;
53 [label="53: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 66]\n " shape="box"] 53 [label="53: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 68]\n " shape="box"]
53 -> 52 ; 53 -> 52 ;
52 [label="52: Return Stmt \n _=*&r:class Ref [line 67]\n n$1=_fun_Ref_getF(&r:class Ref &) [line 67]\n *&return:int =(1 / n$1) [line 67]\n " shape="box"] 52 [label="52: Return Stmt \n _=*&r:class reference_field::Ref [line 69]\n n$1=_fun_reference_field::Ref_getF(&r:class reference_field::Ref &) [line 69]\n *&return:int =(1 / n$1) [line 69]\n " shape="box"]
52 -> 51 ; 52 -> 51 ;
51 [label="51: Exit ref_getF_div0 \n " color=yellow style=filled] 51 [label="51: Exit reference_field::ref_getF_div0 \n " color=yellow style=filled]
50 [label="50: Start ref_getF_div0\nFormals: \nLocals: r:class Ref x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 62]\n " color=yellow style=filled] 50 [label="50: Start reference_field::ref_getF_div0\nFormals: \nLocals: r:class reference_field::Ref x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 64]\n " color=yellow style=filled]
50 -> 56 ; 50 -> 56 ;
49 [label="49: DeclStmt \n _fun_X_X(&x:class X *) [line 55]\n " shape="box"] 49 [label="49: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 57]\n " shape="box"]
49 -> 48 ; 49 -> 48 ;
48 [label="48: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 56]\n " shape="box"] 48 [label="48: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 58]\n " shape="box"]
48 -> 47 ; 48 -> 47 ;
47 [label="47: DeclStmt \n _fun_Ref_Ref(&r:class Ref *,&x:class X &) [line 57]\n " shape="box"] 47 [label="47: DeclStmt \n _fun_reference_field::Ref_Ref(&r:class reference_field::Ref *,&x:class reference_field::X &) [line 59]\n " shape="box"]
47 -> 46 ; 47 -> 46 ;
46 [label="46: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 58]\n " shape="box"] 46 [label="46: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 60]\n " shape="box"]
46 -> 45 ; 46 -> 45 ;
45 [label="45: Return Stmt \n n$0=*&r.i:int & [line 59]\n n$1=*n$0:int & [line 59]\n *&return:int =(1 / n$1) [line 59]\n " shape="box"] 45 [label="45: Return Stmt \n n$0=*&r.i:int & [line 61]\n n$1=*n$0:int & [line 61]\n *&return:int =(1 / n$1) [line 61]\n " shape="box"]
45 -> 44 ; 45 -> 44 ;
44 [label="44: Exit ref_I_div0 \n " color=yellow style=filled] 44 [label="44: Exit reference_field::ref_I_div0 \n " color=yellow style=filled]
43 [label="43: Start ref_I_div0\nFormals: \nLocals: r:class Ref x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 54]\n " color=yellow style=filled] 43 [label="43: Start reference_field::ref_I_div0\nFormals: \nLocals: r:class reference_field::Ref x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 56]\n " color=yellow style=filled]
43 -> 49 ; 43 -> 49 ;
42 [label="42: DeclStmt \n _fun_X_X(&x:class X *) [line 47]\n " shape="box"] 42 [label="42: DeclStmt \n _fun_reference_field::X_X(&x:class reference_field::X *) [line 49]\n " shape="box"]
42 -> 41 ; 42 -> 41 ;
41 [label="41: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 48]\n " shape="box"] 41 [label="41: BinaryOperatorStmt: Assign \n *&x.f:int =1 [line 50]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: DeclStmt \n _fun_Ref_Ref(&r:class Ref *,&x:class X &) [line 49]\n " shape="box"] 40 [label="40: DeclStmt \n _fun_reference_field::Ref_Ref(&r:class reference_field::Ref *,&x:class reference_field::X &) [line 51]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 50]\n " shape="box"] 39 [label="39: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 52]\n " shape="box"]
39 -> 38 ; 39 -> 38 ;
38 [label="38: Return Stmt \n n$0=*&r.x:class X & [line 51]\n n$1=*n$0.f:int [line 51]\n *&return:int =(1 / n$1) [line 51]\n " shape="box"] 38 [label="38: Return Stmt \n n$0=*&r.x:class reference_field::X & [line 53]\n n$1=*n$0.f:int [line 53]\n *&return:int =(1 / n$1) [line 53]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: Exit ref_F_div0 \n " color=yellow style=filled] 37 [label="37: Exit reference_field::ref_F_div0 \n " color=yellow style=filled]
36 [label="36: Start ref_F_div0\nFormals: \nLocals: r:class Ref x:class X \n DECLARE_LOCALS(&return,&r,&x); [line 46]\n " color=yellow style=filled] 36 [label="36: Start reference_field::ref_F_div0\nFormals: \nLocals: r:class reference_field::Ref x:class reference_field::X \n DECLARE_LOCALS(&return,&r,&x); [line 48]\n " color=yellow style=filled]
36 -> 42 ; 36 -> 42 ;
35 [label="35: Return Stmt \n n$0=*&this:class Val * [line 42]\n n$1=*n$0.i:int [line 42]\n *&return:int =n$1 [line 42]\n " shape="box"] 35 [label="35: Return Stmt \n n$0=*&this:class reference_field::Val * [line 44]\n n$1=*n$0.i:int [line 44]\n *&return:int =n$1 [line 44]\n " shape="box"]
35 -> 34 ; 35 -> 34 ;
34 [label="34: Exit Val_getI \n " color=yellow style=filled] 34 [label="34: Exit reference_field::Val_getI \n " color=yellow style=filled]
33 [label="33: Start Val_getI\nFormals: this:class Val *\nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled] 33 [label="33: Start reference_field::Val_getI\nFormals: this:class reference_field::Val *\nLocals: \n DECLARE_LOCALS(&return); [line 44]\n " color=yellow style=filled]
33 -> 35 ; 33 -> 35 ;
32 [label="32: Return Stmt \n n$0=*&this:class Val * [line 41]\n n$1=*n$0.x.f:int [line 41]\n *&return:int =n$1 [line 41]\n " shape="box"] 32 [label="32: Return Stmt \n n$0=*&this:class reference_field::Val * [line 43]\n n$1=*n$0.x.f:int [line 43]\n *&return:int =n$1 [line 43]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: Exit Val_getF \n " color=yellow style=filled] 31 [label="31: Exit reference_field::Val_getF \n " color=yellow style=filled]
30 [label="30: Start Val_getF\nFormals: this:class Val *\nLocals: \n DECLARE_LOCALS(&return); [line 41]\n " color=yellow style=filled] 30 [label="30: Start reference_field::Val_getF\nFormals: this:class reference_field::Val *\nLocals: \n DECLARE_LOCALS(&return); [line 43]\n " color=yellow style=filled]
30 -> 32 ; 30 -> 32 ;
29 [label="29: Constructor Init \n n$3=*&this:class Val * [line 40]\n n$4=*&r_:class X & [line 40]\n _fun_X_X(n$3.x:class X *,n$4:class X &) [line 40]\n " shape="box"] 29 [label="29: Constructor Init \n n$3=*&this:class reference_field::Val * [line 42]\n n$4=*&r_:class reference_field::X & [line 42]\n _fun_reference_field::X_X(n$3.x:class reference_field::X *,n$4:class reference_field::X &) [line 42]\n " shape="box"]
29 -> 28 ; 29 -> 28 ;
28 [label="28: Constructor Init \n n$0=*&this:class Val * [line 40]\n n$1=*&this:class Val * [line 40]\n n$2=*n$1.x.f:int [line 40]\n *n$0.i:int =n$2 [line 40]\n " shape="box"] 28 [label="28: Constructor Init \n n$0=*&this:class reference_field::Val * [line 42]\n n$1=*&this:class reference_field::Val * [line 42]\n n$2=*n$1.x.f:int [line 42]\n *n$0.i:int =n$2 [line 42]\n " shape="box"]
28 -> 27 ; 28 -> 27 ;
27 [label="27: Exit Val_Val \n " color=yellow style=filled] 27 [label="27: Exit reference_field::Val_Val \n " color=yellow style=filled]
26 [label="26: Start Val_Val\nFormals: this:class Val * r_:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 40]\n " color=yellow style=filled] 26 [label="26: Start reference_field::Val_Val\nFormals: this:class reference_field::Val * r_:class reference_field::X &\nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled]
26 -> 29 ; 26 -> 29 ;
25 [label="25: Return Stmt \n n$0=*&this:class Ptr * [line 34]\n n$1=*n$0.i:int * [line 34]\n n$2=*n$1:int [line 34]\n *&return:int =n$2 [line 34]\n " shape="box"] 25 [label="25: Return Stmt \n n$0=*&this:class reference_field::Ptr * [line 36]\n n$1=*n$0.i:int * [line 36]\n n$2=*n$1:int [line 36]\n *&return:int =n$2 [line 36]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit Ptr_getI \n " color=yellow style=filled] 24 [label="24: Exit reference_field::Ptr_getI \n " color=yellow style=filled]
23 [label="23: Start Ptr_getI\nFormals: this:class Ptr *\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled] 23 [label="23: Start reference_field::Ptr_getI\nFormals: this:class reference_field::Ptr *\nLocals: \n DECLARE_LOCALS(&return); [line 36]\n " color=yellow style=filled]
23 -> 25 ; 23 -> 25 ;
22 [label="22: Return Stmt \n n$0=*&this:class Ptr * [line 33]\n n$1=*n$0.x:class X * [line 33]\n n$2=*n$1.f:int [line 33]\n *&return:int =n$2 [line 33]\n " shape="box"] 22 [label="22: Return Stmt \n n$0=*&this:class reference_field::Ptr * [line 35]\n n$1=*n$0.x:class reference_field::X * [line 35]\n n$2=*n$1.f:int [line 35]\n *&return:int =n$2 [line 35]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Exit Ptr_getF \n " color=yellow style=filled] 21 [label="21: Exit reference_field::Ptr_getF \n " color=yellow style=filled]
20 [label="20: Start Ptr_getF\nFormals: this:class Ptr *\nLocals: \n DECLARE_LOCALS(&return); [line 33]\n " color=yellow style=filled] 20 [label="20: Start reference_field::Ptr_getF\nFormals: this:class reference_field::Ptr *\nLocals: \n DECLARE_LOCALS(&return); [line 35]\n " color=yellow style=filled]
20 -> 22 ; 20 -> 22 ;
19 [label="19: Constructor Init \n n$3=*&this:class Ptr * [line 32]\n n$4=*&r_:class X & [line 32]\n *n$3.x:class X *=n$4 [line 32]\n " shape="box"] 19 [label="19: Constructor Init \n n$3=*&this:class reference_field::Ptr * [line 34]\n n$4=*&r_:class reference_field::X & [line 34]\n *n$3.x:class reference_field::X *=n$4 [line 34]\n " shape="box"]
19 -> 18 ; 19 -> 18 ;
18 [label="18: Constructor Init \n n$0=*&this:class Ptr * [line 32]\n n$1=*&this:class Ptr * [line 32]\n n$2=*n$1.x:class X * [line 32]\n *n$0.i:int *=n$2.f [line 32]\n " shape="box"] 18 [label="18: Constructor Init \n n$0=*&this:class reference_field::Ptr * [line 34]\n n$1=*&this:class reference_field::Ptr * [line 34]\n n$2=*n$1.x:class reference_field::X * [line 34]\n *n$0.i:int *=n$2.f [line 34]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Exit Ptr_Ptr \n " color=yellow style=filled] 17 [label="17: Exit reference_field::Ptr_Ptr \n " color=yellow style=filled]
16 [label="16: Start Ptr_Ptr\nFormals: this:class Ptr * r_:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] 16 [label="16: Start reference_field::Ptr_Ptr\nFormals: this:class reference_field::Ptr * r_:class reference_field::X &\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled]
16 -> 19 ; 16 -> 19 ;
15 [label="15: Return Stmt \n n$0=*&this:class Ref * [line 26]\n n$1=*n$0.i:int & [line 26]\n n$2=*n$1:int & [line 26]\n *&return:int =n$2 [line 26]\n " shape="box"] 15 [label="15: Return Stmt \n n$0=*&this:class reference_field::Ref * [line 28]\n n$1=*n$0.i:int & [line 28]\n n$2=*n$1:int & [line 28]\n *&return:int =n$2 [line 28]\n " shape="box"]
15 -> 14 ; 15 -> 14 ;
14 [label="14: Exit Ref_getI \n " color=yellow style=filled] 14 [label="14: Exit reference_field::Ref_getI \n " color=yellow style=filled]
13 [label="13: Start Ref_getI\nFormals: this:class Ref *\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] 13 [label="13: Start reference_field::Ref_getI\nFormals: this:class reference_field::Ref *\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled]
13 -> 15 ; 13 -> 15 ;
12 [label="12: Return Stmt \n n$0=*&this:class Ref * [line 25]\n n$1=*n$0.x:class X & [line 25]\n n$2=*n$1.f:int [line 25]\n *&return:int =n$2 [line 25]\n " shape="box"] 12 [label="12: Return Stmt \n n$0=*&this:class reference_field::Ref * [line 27]\n n$1=*n$0.x:class reference_field::X & [line 27]\n n$2=*n$1.f:int [line 27]\n *&return:int =n$2 [line 27]\n " shape="box"]
12 -> 11 ; 12 -> 11 ;
11 [label="11: Exit Ref_getF \n " color=yellow style=filled] 11 [label="11: Exit reference_field::Ref_getF \n " color=yellow style=filled]
10 [label="10: Start Ref_getF\nFormals: this:class Ref *\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled] 10 [label="10: Start reference_field::Ref_getF\nFormals: this:class reference_field::Ref *\nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled]
10 -> 12 ; 10 -> 12 ;
9 [label="9: Constructor Init \n n$3=*&this:class Ref * [line 24]\n n$4=*&r_:class X & [line 24]\n *n$3.x:class X &=n$4 [line 24]\n " shape="box"] 9 [label="9: Constructor Init \n n$3=*&this:class reference_field::Ref * [line 26]\n n$4=*&r_:class reference_field::X & [line 26]\n *n$3.x:class reference_field::X &=n$4 [line 26]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Constructor Init \n n$0=*&this:class Ref * [line 24]\n n$1=*&this:class Ref * [line 24]\n n$2=*n$1.x:class X & [line 24]\n *n$0.i:int &=n$2.f [line 24]\n " shape="box"] 8 [label="8: Constructor Init \n n$0=*&this:class reference_field::Ref * [line 26]\n n$1=*&this:class reference_field::Ref * [line 26]\n n$2=*n$1.x:class reference_field::X & [line 26]\n *n$0.i:int &=n$2.f [line 26]\n " shape="box"]
8 -> 7 ; 8 -> 7 ;
7 [label="7: Exit Ref_Ref \n " color=yellow style=filled] 7 [label="7: Exit reference_field::Ref_Ref \n " color=yellow style=filled]
6 [label="6: Start Ref_Ref\nFormals: this:class Ref * r_:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] 6 [label="6: Start reference_field::Ref_Ref\nFormals: this:class reference_field::Ref * r_:class reference_field::X &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled]
6 -> 9 ; 6 -> 9 ;
5 [label="5: Constructor Init \n n$0=*&this:class X * [line 10]\n n$1=*&__param_0:class X & [line 10]\n n$2=*n$1.f:int [line 10]\n *n$0.f:int =n$2 [line 10]\n " shape="box"] 5 [label="5: Constructor Init \n n$0=*&this:class reference_field::X * [line 12]\n n$1=*&__param_0:class reference_field::X & [line 12]\n n$2=*n$1.f:int [line 12]\n *n$0.f:int =n$2 [line 12]\n " shape="box"]
5 -> 4 ; 5 -> 4 ;
4 [label="4: Exit X_X \n " color=yellow style=filled] 4 [label="4: Exit reference_field::X_X \n " color=yellow style=filled]
3 [label="3: Start X_X\nFormals: this:class X * __param_0:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 3 [label="3: Start reference_field::X_X\nFormals: this:class reference_field::X * __param_0:class reference_field::X &\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
3 -> 5 ; 3 -> 5 ;
2 [label="2: Exit X_X \n " color=yellow style=filled] 2 [label="2: Exit reference_field::X_X \n " color=yellow style=filled]
1 [label="1: Start X_X\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 1 [label="1: Start reference_field::X_X\nFormals: this:class reference_field::X *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
1 -> 2 ; 1 -> 2 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace function {
struct X1 { struct X1 {
int getVal() { return 1; } int getVal() { return 1; }
}; };
@ -71,3 +73,4 @@ int div0_create_and_get_val() {
int div1_create_and_get_val() { int div1_create_and_get_val() {
return createAndGetVal<X3>() / createAndGetVal<X1>(); return createAndGetVal<X3>() / createAndGetVal<X1>();
} }
}

@ -1,183 +1,183 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
49 [label="49: Return Stmt \n n$0=_fun_createAndGetVal<X3>() [line 72]\n n$1=_fun_createAndGetVal<X1>() [line 72]\n *&return:int =(n$0 / n$1) [line 72]\n " shape="box"] 49 [label="49: Return Stmt \n n$0=_fun_function::createAndGetVal<X3>() [line 74]\n n$1=_fun_function::createAndGetVal<X1>() [line 74]\n *&return:int =(n$0 / n$1) [line 74]\n " shape="box"]
49 -> 48 ; 49 -> 48 ;
48 [label="48: Exit div1_create_and_get_val \n " color=yellow style=filled] 48 [label="48: Exit function::div1_create_and_get_val \n " color=yellow style=filled]
47 [label="47: Start div1_create_and_get_val\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 71]\n " color=yellow style=filled] 47 [label="47: Start function::div1_create_and_get_val\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 73]\n " color=yellow style=filled]
47 -> 49 ; 47 -> 49 ;
46 [label="46: Return Stmt \n n$0=_fun_createAndGetVal<X1>() [line 68]\n n$1=_fun_createAndGetVal<X3>() [line 68]\n *&return:int =(n$0 / n$1) [line 68]\n " shape="box"] 46 [label="46: Return Stmt \n n$0=_fun_function::createAndGetVal<X1>() [line 70]\n n$1=_fun_function::createAndGetVal<X3>() [line 70]\n *&return:int =(n$0 / n$1) [line 70]\n " shape="box"]
46 -> 45 ; 46 -> 45 ;
45 [label="45: Exit div0_create_and_get_val \n " color=yellow style=filled] 45 [label="45: Exit function::div0_create_and_get_val \n " color=yellow style=filled]
44 [label="44: Start div0_create_and_get_val\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 67]\n " color=yellow style=filled] 44 [label="44: Start function::div0_create_and_get_val\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 69]\n " color=yellow style=filled]
44 -> 46 ; 44 -> 46 ;
43 [label="43: DeclStmt \n _fun_X1_X1(&x1:class X1 *) [line 62]\n " shape="box"] 43 [label="43: DeclStmt \n _fun_function::X1_X1(&x1:class function::X1 *) [line 64]\n " shape="box"]
43 -> 42 ; 43 -> 42 ;
42 [label="42: DeclStmt \n _fun_X3_X3(&x3:class X3 *) [line 63]\n " shape="box"] 42 [label="42: DeclStmt \n _fun_function::X3_X3(&x3:class function::X3 *) [line 65]\n " shape="box"]
42 -> 41 ; 42 -> 41 ;
41 [label="41: Return Stmt \n n$0=_fun_getVal<X3>(&x3:class X3 &) [line 64]\n n$1=_fun_getVal<X1>(&x1:class X1 &) [line 64]\n *&return:int =(n$0 / n$1) [line 64]\n " shape="box"] 41 [label="41: Return Stmt \n n$0=_fun_function::getVal<X3>(&x3:class function::X3 &) [line 66]\n n$1=_fun_function::getVal<X1>(&x1:class function::X1 &) [line 66]\n *&return:int =(n$0 / n$1) [line 66]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: Exit div1_get_val \n " color=yellow style=filled] 40 [label="40: Exit function::div1_get_val \n " color=yellow style=filled]
39 [label="39: Start div1_get_val\nFormals: \nLocals: x3:class X3 x1:class X1 \n DECLARE_LOCALS(&return,&x3,&x1); [line 61]\n " color=yellow style=filled] 39 [label="39: Start function::div1_get_val\nFormals: \nLocals: x3:class function::X3 x1:class function::X1 \n DECLARE_LOCALS(&return,&x3,&x1); [line 63]\n " color=yellow style=filled]
39 -> 43 ; 39 -> 43 ;
38 [label="38: DeclStmt \n _fun_X1_X1(&x1:class X1 *) [line 56]\n " shape="box"] 38 [label="38: DeclStmt \n _fun_function::X1_X1(&x1:class function::X1 *) [line 58]\n " shape="box"]
38 -> 37 ; 38 -> 37 ;
37 [label="37: DeclStmt \n _fun_X3_X3(&x3:class X3 *) [line 57]\n " shape="box"] 37 [label="37: DeclStmt \n _fun_function::X3_X3(&x3:class function::X3 *) [line 59]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: Return Stmt \n n$0=_fun_getVal<X1>(&x1:class X1 &) [line 58]\n n$1=_fun_getVal<X3>(&x3:class X3 &) [line 58]\n *&return:int =(n$0 / n$1) [line 58]\n " shape="box"] 36 [label="36: Return Stmt \n n$0=_fun_function::getVal<X1>(&x1:class function::X1 &) [line 60]\n n$1=_fun_function::getVal<X3>(&x3:class function::X3 &) [line 60]\n *&return:int =(n$0 / n$1) [line 60]\n " shape="box"]
36 -> 35 ; 36 -> 35 ;
35 [label="35: Exit div0_get_val \n " color=yellow style=filled] 35 [label="35: Exit function::div0_get_val \n " color=yellow style=filled]
34 [label="34: Start div0_get_val\nFormals: \nLocals: x3:class X3 x1:class X1 \n DECLARE_LOCALS(&return,&x3,&x1); [line 55]\n " color=yellow style=filled] 34 [label="34: Start function::div0_get_val\nFormals: \nLocals: x3:class function::X3 x1:class function::X1 \n DECLARE_LOCALS(&return,&x3,&x1); [line 57]\n " color=yellow style=filled]
34 -> 38 ; 34 -> 38 ;
33 [label="33: Return Stmt \n n$0=_fun_createAndGetVal<X1>() [line 41]\n *&return:int =(1 / n$0) [line 41]\n " shape="box"] 33 [label="33: Return Stmt \n n$0=_fun_function::createAndGetVal<X1>() [line 43]\n *&return:int =(1 / n$0) [line 43]\n " shape="box"]
33 -> 32 ; 33 -> 32 ;
32 [label="32: Exit createAndDiv<X1> \n " color=yellow style=filled] 32 [label="32: Exit function::createAndDiv<X1> \n " color=yellow style=filled]
31 [label="31: Start createAndDiv<X1>\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 40]\n " color=yellow style=filled] 31 [label="31: Start function::createAndDiv<X1>\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled]
31 -> 33 ; 31 -> 33 ;
30 [label="30: Return Stmt \n n$0=_fun_createAndGetVal<X3>() [line 41]\n *&return:int =(1 / n$0) [line 41]\n " shape="box"] 30 [label="30: Return Stmt \n n$0=_fun_function::createAndGetVal<X3>() [line 43]\n *&return:int =(1 / n$0) [line 43]\n " shape="box"]
30 -> 29 ; 30 -> 29 ;
29 [label="29: Exit createAndDiv<X3> \n " color=yellow style=filled] 29 [label="29: Exit function::createAndDiv<X3> \n " color=yellow style=filled]
28 [label="28: Start createAndDiv<X3>\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 40]\n " color=yellow style=filled] 28 [label="28: Start function::createAndDiv<X3>\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled]
28 -> 30 ; 28 -> 30 ;
27 [label="27: DeclStmt \n _fun_X1_X1(&x:class X1 *) [line 35]\n " shape="box"] 27 [label="27: DeclStmt \n _fun_function::X1_X1(&x:class function::X1 *) [line 37]\n " shape="box"]
27 -> 26 ; 27 -> 26 ;
26 [label="26: Return Stmt \n n$0=_fun_getVal<X1>(&x:class X1 &) [line 36]\n *&return:int =n$0 [line 36]\n " shape="box"] 26 [label="26: Return Stmt \n n$0=_fun_function::getVal<X1>(&x:class function::X1 &) [line 38]\n *&return:int =n$0 [line 38]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: Exit createAndGetVal<X1> \n " color=yellow style=filled] 25 [label="25: Exit function::createAndGetVal<X1> \n " color=yellow style=filled]
24 [label="24: Start createAndGetVal<X1>\nFormals: \nLocals: x:class X1 \n DECLARE_LOCALS(&return,&x); [line 34]\n " color=yellow style=filled] 24 [label="24: Start function::createAndGetVal<X1>\nFormals: \nLocals: x:class function::X1 \n DECLARE_LOCALS(&return,&x); [line 36]\n " color=yellow style=filled]
24 -> 27 ; 24 -> 27 ;
23 [label="23: DeclStmt \n _fun_X3_X3(&x:class X3 *) [line 35]\n " shape="box"] 23 [label="23: DeclStmt \n _fun_function::X3_X3(&x:class function::X3 *) [line 37]\n " shape="box"]
23 -> 22 ; 23 -> 22 ;
22 [label="22: Return Stmt \n n$0=_fun_getVal<X3>(&x:class X3 &) [line 36]\n *&return:int =n$0 [line 36]\n " shape="box"] 22 [label="22: Return Stmt \n n$0=_fun_function::getVal<X3>(&x:class function::X3 &) [line 38]\n *&return:int =n$0 [line 38]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Exit createAndGetVal<X3> \n " color=yellow style=filled] 21 [label="21: Exit function::createAndGetVal<X3> \n " color=yellow style=filled]
20 [label="20: Start createAndGetVal<X3>\nFormals: \nLocals: x:class X3 \n DECLARE_LOCALS(&return,&x); [line 34]\n " color=yellow style=filled] 20 [label="20: Start function::createAndGetVal<X3>\nFormals: \nLocals: x:class function::X3 \n DECLARE_LOCALS(&return,&x); [line 36]\n " color=yellow style=filled]
20 -> 23 ; 20 -> 23 ;
19 [label="19: Return Stmt \n n$0=*&x:class X3 & [line 30]\n _=*n$0:class X3 [line 30]\n n$2=_fun_X3_get(n$0:class X3 &) [line 30]\n *&return:int =n$2 [line 30]\n " shape="box"] 19 [label="19: Return Stmt \n n$0=*&x:class function::X3 & [line 32]\n _=*n$0:class function::X3 [line 32]\n n$2=_fun_function::X3_get(n$0:class function::X3 &) [line 32]\n *&return:int =n$2 [line 32]\n " shape="box"]
19 -> 18 ; 19 -> 18 ;
18 [label="18: Exit getVal<X3> \n " color=yellow style=filled] 18 [label="18: Exit function::getVal<X3> \n " color=yellow style=filled]
17 [label="17: Start getVal<X3>\nFormals: x:class X3 &\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled] 17 [label="17: Start function::getVal<X3>\nFormals: x:class function::X3 &\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled]
17 -> 19 ; 17 -> 19 ;
16 [label="16: Return Stmt \n n$0=*&x:class X1 & [line 24]\n _=*n$0:class X1 [line 24]\n n$2=_fun_X1_getVal(n$0:class X1 &) [line 24]\n *&return:int =n$2 [line 24]\n " shape="box"] 16 [label="16: Return Stmt \n n$0=*&x:class function::X1 & [line 26]\n _=*n$0:class function::X1 [line 26]\n n$2=_fun_function::X1_getVal(n$0:class function::X1 &) [line 26]\n *&return:int =n$2 [line 26]\n " shape="box"]
16 -> 15 ; 16 -> 15 ;
15 [label="15: Exit getVal<X1> \n " color=yellow style=filled] 15 [label="15: Exit function::getVal<X1> \n " color=yellow style=filled]
14 [label="14: Start getVal<X1>\nFormals: x:class X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled] 14 [label="14: Start function::getVal<X1>\nFormals: x:class function::X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled]
14 -> 16 ; 14 -> 16 ;
13 [label="13: Exit X3_X3 \n " color=yellow style=filled] 13 [label="13: Exit function::X3_X3 \n " color=yellow style=filled]
12 [label="12: Start X3_X3\nFormals: this:class X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n " color=yellow style=filled] 12 [label="12: Start function::X3_X3\nFormals: this:class function::X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled]
12 -> 13 ; 12 -> 13 ;
11 [label="11: Return Stmt \n *&return:int =0 [line 19]\n " shape="box"] 11 [label="11: Return Stmt \n *&return:int =0 [line 21]\n " shape="box"]
11 -> 10 ; 11 -> 10 ;
10 [label="10: Exit X3_get \n " color=yellow style=filled] 10 [label="10: Exit function::X3_get \n " color=yellow style=filled]
9 [label="9: Start X3_get\nFormals: this:class X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 9 [label="9: Start function::X3_get\nFormals: this:class function::X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
9 -> 11 ; 9 -> 11 ;
8 [label="8: Return Stmt \n *&return:int =0 [line 15]\n " shape="box"] 8 [label="8: Return Stmt \n *&return:int =0 [line 17]\n " shape="box"]
8 -> 7 ; 8 -> 7 ;
7 [label="7: Exit X2_getVal \n " color=yellow style=filled] 7 [label="7: Exit function::X2_getVal \n " color=yellow style=filled]
6 [label="6: Start X2_getVal\nFormals: this:class X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 6 [label="6: Start function::X2_getVal\nFormals: this:class function::X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
6 -> 8 ; 6 -> 8 ;
5 [label="5: Exit X1_X1 \n " color=yellow style=filled] 5 [label="5: Exit function::X1_X1 \n " color=yellow style=filled]
4 [label="4: Start X1_X1\nFormals: this:class X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 4 [label="4: Start function::X1_X1\nFormals: this:class function::X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
4 -> 5 ; 4 -> 5 ;
3 [label="3: Return Stmt \n *&return:int =1 [line 11]\n " shape="box"] 3 [label="3: Return Stmt \n *&return:int =1 [line 13]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X1_getVal \n " color=yellow style=filled] 2 [label="2: Exit function::X1_getVal \n " color=yellow style=filled]
1 [label="1: Start X1_getVal\nFormals: this:class X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] 1 [label="1: Start function::X1_getVal\nFormals: this:class function::X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace method {
struct X1 { struct X1 {
int get() { return 1; } int get() { return 1; }
}; };
@ -73,3 +75,4 @@ int div1_getter_templ2() {
GetterTempl<X1> g; GetterTempl<X1> g;
return 1 / g.get(x1_1, x1_2); return 1 / g.get(x1_1, x1_2);
} }
}

@ -1,280 +1,280 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
75 [label="75: DeclStmt \n _fun_X1_X1(&x1_1:class X1 *) [line 71]\n " shape="box"] 75 [label="75: DeclStmt \n _fun_method::X1_X1(&x1_1:class method::X1 *) [line 73]\n " shape="box"]
75 -> 74 ; 75 -> 74 ;
74 [label="74: DeclStmt \n _fun_X1_X1(&x1_2:class X1 *) [line 72]\n " shape="box"] 74 [label="74: DeclStmt \n _fun_method::X1_X1(&x1_2:class method::X1 *) [line 74]\n " shape="box"]
74 -> 73 ; 74 -> 73 ;
73 [label="73: DeclStmt \n _fun_GetterTempl<X1>_GetterTempl(&g:class GetterTempl<X1> *) [line 73]\n " shape="box"] 73 [label="73: DeclStmt \n _fun_method::GetterTempl<X1>_GetterTempl(&g:class method::GetterTempl<X1> *) [line 75]\n " shape="box"]
73 -> 72 ; 73 -> 72 ;
72 [label="72: Return Stmt \n _=*&g:class GetterTempl<X1> [line 74]\n n$1=_fun_GetterTempl<X1>_get<X1>(&g:class GetterTempl<X1> &,&x1_1:class X1 &,&x1_2:class X1 &) [line 74]\n *&return:int =(1 / n$1) [line 74]\n " shape="box"] 72 [label="72: Return Stmt \n _=*&g:class method::GetterTempl<X1> [line 76]\n n$1=_fun_method::GetterTempl<X1>_get<X1>(&g:class method::GetterTempl<X1> &,&x1_1:class method::X1 &,&x1_2:class method::X1 &) [line 76]\n *&return:int =(1 / n$1) [line 76]\n " shape="box"]
72 -> 71 ; 72 -> 71 ;
71 [label="71: Exit div1_getter_templ2 \n " color=yellow style=filled] 71 [label="71: Exit method::div1_getter_templ2 \n " color=yellow style=filled]
70 [label="70: Start div1_getter_templ2\nFormals: \nLocals: g:class GetterTempl<X1> x1_2:class X1 x1_1:class X1 \n DECLARE_LOCALS(&return,&g,&x1_2,&x1_1); [line 70]\n " color=yellow style=filled] 70 [label="70: Start method::div1_getter_templ2\nFormals: \nLocals: g:class method::GetterTempl<X1> x1_2:class method::X1 x1_1:class method::X1 \n DECLARE_LOCALS(&return,&g,&x1_2,&x1_1); [line 72]\n " color=yellow style=filled]
70 -> 75 ; 70 -> 75 ;
69 [label="69: DeclStmt \n _fun_X1_X1(&x1:class X1 *) [line 64]\n " shape="box"] 69 [label="69: DeclStmt \n _fun_method::X1_X1(&x1:class method::X1 *) [line 66]\n " shape="box"]
69 -> 68 ; 69 -> 68 ;
68 [label="68: DeclStmt \n _fun_X2_X2(&x2:class X2 *) [line 65]\n " shape="box"] 68 [label="68: DeclStmt \n _fun_method::X2_X2(&x2:class method::X2 *) [line 67]\n " shape="box"]
68 -> 67 ; 68 -> 67 ;
67 [label="67: DeclStmt \n _fun_GetterTempl<X2>_GetterTempl(&g:class GetterTempl<X2> *) [line 66]\n " shape="box"] 67 [label="67: DeclStmt \n _fun_method::GetterTempl<X2>_GetterTempl(&g:class method::GetterTempl<X2> *) [line 68]\n " shape="box"]
67 -> 66 ; 67 -> 66 ;
66 [label="66: Return Stmt \n _=*&g:class GetterTempl<X2> [line 67]\n n$1=_fun_GetterTempl<X2>_get<X1>(&g:class GetterTempl<X2> &,&x2:class X2 &,&x1:class X1 &) [line 67]\n *&return:int =(1 / n$1) [line 67]\n " shape="box"] 66 [label="66: Return Stmt \n _=*&g:class method::GetterTempl<X2> [line 69]\n n$1=_fun_method::GetterTempl<X2>_get<X1>(&g:class method::GetterTempl<X2> &,&x2:class method::X2 &,&x1:class method::X1 &) [line 69]\n *&return:int =(1 / n$1) [line 69]\n " shape="box"]
66 -> 65 ; 66 -> 65 ;
65 [label="65: Exit div1_getter_templ \n " color=yellow style=filled] 65 [label="65: Exit method::div1_getter_templ \n " color=yellow style=filled]
64 [label="64: Start div1_getter_templ\nFormals: \nLocals: g:class GetterTempl<X2> x2:class X2 x1:class X1 \n DECLARE_LOCALS(&return,&g,&x2,&x1); [line 63]\n " color=yellow style=filled] 64 [label="64: Start method::div1_getter_templ\nFormals: \nLocals: g:class method::GetterTempl<X2> x2:class method::X2 x1:class method::X1 \n DECLARE_LOCALS(&return,&g,&x2,&x1); [line 65]\n " color=yellow style=filled]
64 -> 69 ; 64 -> 69 ;
63 [label="63: DeclStmt \n _fun_X2_X2(&x2_1:class X2 *) [line 57]\n " shape="box"] 63 [label="63: DeclStmt \n _fun_method::X2_X2(&x2_1:class method::X2 *) [line 59]\n " shape="box"]
63 -> 62 ; 63 -> 62 ;
62 [label="62: DeclStmt \n _fun_X2_X2(&x2_2:class X2 *) [line 58]\n " shape="box"] 62 [label="62: DeclStmt \n _fun_method::X2_X2(&x2_2:class method::X2 *) [line 60]\n " shape="box"]
62 -> 61 ; 62 -> 61 ;
61 [label="61: DeclStmt \n _fun_GetterTempl<X2>_GetterTempl(&g:class GetterTempl<X2> *) [line 59]\n " shape="box"] 61 [label="61: DeclStmt \n _fun_method::GetterTempl<X2>_GetterTempl(&g:class method::GetterTempl<X2> *) [line 61]\n " shape="box"]
61 -> 60 ; 61 -> 60 ;
60 [label="60: Return Stmt \n _=*&g:class GetterTempl<X2> [line 60]\n n$1=_fun_GetterTempl<X2>_get<X2>(&g:class GetterTempl<X2> &,&x2_1:class X2 &,&x2_2:class X2 &) [line 60]\n *&return:int =(1 / n$1) [line 60]\n " shape="box"] 60 [label="60: Return Stmt \n _=*&g:class method::GetterTempl<X2> [line 62]\n n$1=_fun_method::GetterTempl<X2>_get<X2>(&g:class method::GetterTempl<X2> &,&x2_1:class method::X2 &,&x2_2:class method::X2 &) [line 62]\n *&return:int =(1 / n$1) [line 62]\n " shape="box"]
60 -> 59 ; 60 -> 59 ;
59 [label="59: Exit div0_getter_templ2 \n " color=yellow style=filled] 59 [label="59: Exit method::div0_getter_templ2 \n " color=yellow style=filled]
58 [label="58: Start div0_getter_templ2\nFormals: \nLocals: g:class GetterTempl<X2> x2_2:class X2 x2_1:class X2 \n DECLARE_LOCALS(&return,&g,&x2_2,&x2_1); [line 56]\n " color=yellow style=filled] 58 [label="58: Start method::div0_getter_templ2\nFormals: \nLocals: g:class method::GetterTempl<X2> x2_2:class method::X2 x2_1:class method::X2 \n DECLARE_LOCALS(&return,&g,&x2_2,&x2_1); [line 58]\n " color=yellow style=filled]
58 -> 63 ; 58 -> 63 ;
57 [label="57: DeclStmt \n _fun_X2_X2(&x2:class X2 *) [line 50]\n " shape="box"] 57 [label="57: DeclStmt \n _fun_method::X2_X2(&x2:class method::X2 *) [line 52]\n " shape="box"]
57 -> 56 ; 57 -> 56 ;
56 [label="56: DeclStmt \n _fun_X3_X3(&x3:class X3 *) [line 51]\n " shape="box"] 56 [label="56: DeclStmt \n _fun_method::X3_X3(&x3:class method::X3 *) [line 53]\n " shape="box"]
56 -> 55 ; 56 -> 55 ;
55 [label="55: DeclStmt \n _fun_GetterTempl<X3>_GetterTempl(&g:class GetterTempl<X3> *) [line 52]\n " shape="box"] 55 [label="55: DeclStmt \n _fun_method::GetterTempl<X3>_GetterTempl(&g:class method::GetterTempl<X3> *) [line 54]\n " shape="box"]
55 -> 54 ; 55 -> 54 ;
54 [label="54: Return Stmt \n _=*&g:class GetterTempl<X3> [line 53]\n n$1=_fun_GetterTempl<X3>_get<X2>(&g:class GetterTempl<X3> &,&x3:class X3 &,&x2:class X2 &) [line 53]\n *&return:int =(1 / n$1) [line 53]\n " shape="box"] 54 [label="54: Return Stmt \n _=*&g:class method::GetterTempl<X3> [line 55]\n n$1=_fun_method::GetterTempl<X3>_get<X2>(&g:class method::GetterTempl<X3> &,&x3:class method::X3 &,&x2:class method::X2 &) [line 55]\n *&return:int =(1 / n$1) [line 55]\n " shape="box"]
54 -> 53 ; 54 -> 53 ;
53 [label="53: Exit div0_getter_templ \n " color=yellow style=filled] 53 [label="53: Exit method::div0_getter_templ \n " color=yellow style=filled]
52 [label="52: Start div0_getter_templ\nFormals: \nLocals: g:class GetterTempl<X3> x3:class X3 x2:class X2 \n DECLARE_LOCALS(&return,&g,&x3,&x2); [line 49]\n " color=yellow style=filled] 52 [label="52: Start method::div0_getter_templ\nFormals: \nLocals: g:class method::GetterTempl<X3> x3:class method::X3 x2:class method::X2 \n DECLARE_LOCALS(&return,&g,&x3,&x2); [line 51]\n " color=yellow style=filled]
52 -> 57 ; 52 -> 57 ;
51 [label="51: DeclStmt \n _fun_X1_X1(&x1:class X1 *) [line 44]\n " shape="box"] 51 [label="51: DeclStmt \n _fun_method::X1_X1(&x1:class method::X1 *) [line 46]\n " shape="box"]
51 -> 50 ; 51 -> 50 ;
50 [label="50: DeclStmt \n _fun_Getter_Getter(&g:class Getter *) [line 45]\n " shape="box"] 50 [label="50: DeclStmt \n _fun_method::Getter_Getter(&g:class method::Getter *) [line 47]\n " shape="box"]
50 -> 49 ; 50 -> 49 ;
49 [label="49: Return Stmt \n _=*&g:class Getter [line 46]\n n$1=_fun_Getter_get<X1>(&g:class Getter &,&x1:class X1 &) [line 46]\n *&return:int =(1 / n$1) [line 46]\n " shape="box"] 49 [label="49: Return Stmt \n _=*&g:class method::Getter [line 48]\n n$1=_fun_method::Getter_get<X1>(&g:class method::Getter &,&x1:class method::X1 &) [line 48]\n *&return:int =(1 / n$1) [line 48]\n " shape="box"]
49 -> 48 ; 49 -> 48 ;
48 [label="48: Exit div1_getter \n " color=yellow style=filled] 48 [label="48: Exit method::div1_getter \n " color=yellow style=filled]
47 [label="47: Start div1_getter\nFormals: \nLocals: g:class Getter x1:class X1 \n DECLARE_LOCALS(&return,&g,&x1); [line 43]\n " color=yellow style=filled] 47 [label="47: Start method::div1_getter\nFormals: \nLocals: g:class method::Getter x1:class method::X1 \n DECLARE_LOCALS(&return,&g,&x1); [line 45]\n " color=yellow style=filled]
47 -> 51 ; 47 -> 51 ;
46 [label="46: DeclStmt \n _fun_X2_X2(&x2:class X2 *) [line 38]\n " shape="box"] 46 [label="46: DeclStmt \n _fun_method::X2_X2(&x2:class method::X2 *) [line 40]\n " shape="box"]
46 -> 45 ; 46 -> 45 ;
45 [label="45: DeclStmt \n _fun_Getter_Getter(&g:class Getter *) [line 39]\n " shape="box"] 45 [label="45: DeclStmt \n _fun_method::Getter_Getter(&g:class method::Getter *) [line 41]\n " shape="box"]
45 -> 44 ; 45 -> 44 ;
44 [label="44: Return Stmt \n _=*&g:class Getter [line 40]\n n$1=_fun_Getter_get<X2>(&g:class Getter &,&x2:class X2 &) [line 40]\n *&return:int =(1 / n$1) [line 40]\n " shape="box"] 44 [label="44: Return Stmt \n _=*&g:class method::Getter [line 42]\n n$1=_fun_method::Getter_get<X2>(&g:class method::Getter &,&x2:class method::X2 &) [line 42]\n *&return:int =(1 / n$1) [line 42]\n " shape="box"]
44 -> 43 ; 44 -> 43 ;
43 [label="43: Exit div0_getter \n " color=yellow style=filled] 43 [label="43: Exit method::div0_getter \n " color=yellow style=filled]
42 [label="42: Start div0_getter\nFormals: \nLocals: g:class Getter x2:class X2 \n DECLARE_LOCALS(&return,&g,&x2); [line 37]\n " color=yellow style=filled] 42 [label="42: Start method::div0_getter\nFormals: \nLocals: g:class method::Getter x2:class method::X2 \n DECLARE_LOCALS(&return,&g,&x2); [line 39]\n " color=yellow style=filled]
42 -> 46 ; 42 -> 46 ;
41 [label="41: Exit GetterTempl<X1>_GetterTempl \n " color=yellow style=filled] 41 [label="41: Exit method::GetterTempl<X1>_GetterTempl \n " color=yellow style=filled]
40 [label="40: Start GetterTempl<X1>_GetterTempl\nFormals: this:class GetterTempl<X1> *\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] 40 [label="40: Start method::GetterTempl<X1>_GetterTempl\nFormals: this:class method::GetterTempl<X1> *\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled]
40 -> 41 ; 40 -> 41 ;
39 [label="39: Return Stmt \n n$0=*&t:class X1 & [line 33]\n _=*n$0:class X1 [line 33]\n n$2=_fun_X1_get(n$0:class X1 &) [line 33]\n n$3=*&s:class X1 & [line 33]\n _=*n$3:class X1 [line 33]\n n$5=_fun_X1_get(n$3:class X1 &) [line 33]\n *&return:int =(n$2 + n$5) [line 33]\n " shape="box"] 39 [label="39: Return Stmt \n n$0=*&t:class method::X1 & [line 35]\n _=*n$0:class method::X1 [line 35]\n n$2=_fun_method::X1_get(n$0:class method::X1 &) [line 35]\n n$3=*&s:class method::X1 & [line 35]\n _=*n$3:class method::X1 [line 35]\n n$5=_fun_method::X1_get(n$3:class method::X1 &) [line 35]\n *&return:int =(n$2 + n$5) [line 35]\n " shape="box"]
39 -> 38 ; 39 -> 38 ;
38 [label="38: Exit GetterTempl<X1>_get<X1> \n " color=yellow style=filled] 38 [label="38: Exit method::GetterTempl<X1>_get<X1> \n " color=yellow style=filled]
37 [label="37: Start GetterTempl<X1>_get<X1>\nFormals: this:class GetterTempl<X1> * t:class X1 & s:class X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] 37 [label="37: Start method::GetterTempl<X1>_get<X1>\nFormals: this:class method::GetterTempl<X1> * t:class method::X1 & s:class method::X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled]
37 -> 39 ; 37 -> 39 ;
36 [label="36: Exit GetterTempl<X2>_GetterTempl \n " color=yellow style=filled] 36 [label="36: Exit method::GetterTempl<X2>_GetterTempl \n " color=yellow style=filled]
35 [label="35: Start GetterTempl<X2>_GetterTempl\nFormals: this:class GetterTempl<X2> *\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] 35 [label="35: Start method::GetterTempl<X2>_GetterTempl\nFormals: this:class method::GetterTempl<X2> *\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled]
35 -> 36 ; 35 -> 36 ;
34 [label="34: Return Stmt \n n$0=*&t:class X2 & [line 33]\n _=*n$0:class X2 [line 33]\n n$2=_fun_X2_get(n$0:class X2 &) [line 33]\n n$3=*&s:class X1 & [line 33]\n _=*n$3:class X1 [line 33]\n n$5=_fun_X1_get(n$3:class X1 &) [line 33]\n *&return:int =(n$2 + n$5) [line 33]\n " shape="box"] 34 [label="34: Return Stmt \n n$0=*&t:class method::X2 & [line 35]\n _=*n$0:class method::X2 [line 35]\n n$2=_fun_method::X2_get(n$0:class method::X2 &) [line 35]\n n$3=*&s:class method::X1 & [line 35]\n _=*n$3:class method::X1 [line 35]\n n$5=_fun_method::X1_get(n$3:class method::X1 &) [line 35]\n *&return:int =(n$2 + n$5) [line 35]\n " shape="box"]
34 -> 33 ; 34 -> 33 ;
33 [label="33: Exit GetterTempl<X2>_get<X1> \n " color=yellow style=filled] 33 [label="33: Exit method::GetterTempl<X2>_get<X1> \n " color=yellow style=filled]
32 [label="32: Start GetterTempl<X2>_get<X1>\nFormals: this:class GetterTempl<X2> * t:class X2 & s:class X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] 32 [label="32: Start method::GetterTempl<X2>_get<X1>\nFormals: this:class method::GetterTempl<X2> * t:class method::X2 & s:class method::X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled]
32 -> 34 ; 32 -> 34 ;
31 [label="31: Return Stmt \n n$0=*&t:class X2 & [line 33]\n _=*n$0:class X2 [line 33]\n n$2=_fun_X2_get(n$0:class X2 &) [line 33]\n n$3=*&s:class X2 & [line 33]\n _=*n$3:class X2 [line 33]\n n$5=_fun_X2_get(n$3:class X2 &) [line 33]\n *&return:int =(n$2 + n$5) [line 33]\n " shape="box"] 31 [label="31: Return Stmt \n n$0=*&t:class method::X2 & [line 35]\n _=*n$0:class method::X2 [line 35]\n n$2=_fun_method::X2_get(n$0:class method::X2 &) [line 35]\n n$3=*&s:class method::X2 & [line 35]\n _=*n$3:class method::X2 [line 35]\n n$5=_fun_method::X2_get(n$3:class method::X2 &) [line 35]\n *&return:int =(n$2 + n$5) [line 35]\n " shape="box"]
31 -> 30 ; 31 -> 30 ;
30 [label="30: Exit GetterTempl<X2>_get<X2> \n " color=yellow style=filled] 30 [label="30: Exit method::GetterTempl<X2>_get<X2> \n " color=yellow style=filled]
29 [label="29: Start GetterTempl<X2>_get<X2>\nFormals: this:class GetterTempl<X2> * t:class X2 & s:class X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] 29 [label="29: Start method::GetterTempl<X2>_get<X2>\nFormals: this:class method::GetterTempl<X2> * t:class method::X2 & s:class method::X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled]
29 -> 31 ; 29 -> 31 ;
28 [label="28: Exit GetterTempl<X3>_GetterTempl \n " color=yellow style=filled] 28 [label="28: Exit method::GetterTempl<X3>_GetterTempl \n " color=yellow style=filled]
27 [label="27: Start GetterTempl<X3>_GetterTempl\nFormals: this:class GetterTempl<X3> *\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled] 27 [label="27: Start method::GetterTempl<X3>_GetterTempl\nFormals: this:class method::GetterTempl<X3> *\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled]
27 -> 28 ; 27 -> 28 ;
26 [label="26: Return Stmt \n n$0=*&t:class X3 & [line 33]\n _=*n$0:class X3 [line 33]\n n$2=_fun_X3_get(n$0:class X3 &) [line 33]\n n$3=*&s:class X2 & [line 33]\n _=*n$3:class X2 [line 33]\n n$5=_fun_X2_get(n$3:class X2 &) [line 33]\n *&return:int =(n$2 + n$5) [line 33]\n " shape="box"] 26 [label="26: Return Stmt \n n$0=*&t:class method::X3 & [line 35]\n _=*n$0:class method::X3 [line 35]\n n$2=_fun_method::X3_get(n$0:class method::X3 &) [line 35]\n n$3=*&s:class method::X2 & [line 35]\n _=*n$3:class method::X2 [line 35]\n n$5=_fun_method::X2_get(n$3:class method::X2 &) [line 35]\n *&return:int =(n$2 + n$5) [line 35]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: Exit GetterTempl<X3>_get<X2> \n " color=yellow style=filled] 25 [label="25: Exit method::GetterTempl<X3>_get<X2> \n " color=yellow style=filled]
24 [label="24: Start GetterTempl<X3>_get<X2>\nFormals: this:class GetterTempl<X3> * t:class X3 & s:class X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] 24 [label="24: Start method::GetterTempl<X3>_get<X2>\nFormals: this:class method::GetterTempl<X3> * t:class method::X3 & s:class method::X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 34]\n " color=yellow style=filled]
24 -> 26 ; 24 -> 26 ;
23 [label="23: Exit Getter_Getter \n " color=yellow style=filled] 23 [label="23: Exit method::Getter_Getter \n " color=yellow style=filled]
22 [label="22: Start Getter_Getter\nFormals: this:class Getter *\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] 22 [label="22: Start method::Getter_Getter\nFormals: this:class method::Getter *\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled]
22 -> 23 ; 22 -> 23 ;
21 [label="21: Return Stmt \n n$0=*&s:class X1 & [line 25]\n _=*n$0:class X1 [line 25]\n n$2=_fun_X1_get(n$0:class X1 &) [line 25]\n *&return:int =n$2 [line 25]\n " shape="box"] 21 [label="21: Return Stmt \n n$0=*&s:class method::X1 & [line 27]\n _=*n$0:class method::X1 [line 27]\n n$2=_fun_method::X1_get(n$0:class method::X1 &) [line 27]\n *&return:int =n$2 [line 27]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit Getter_get<X1> \n " color=yellow style=filled] 20 [label="20: Exit method::Getter_get<X1> \n " color=yellow style=filled]
19 [label="19: Start Getter_get<X1>\nFormals: this:class Getter * s:class X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] 19 [label="19: Start method::Getter_get<X1>\nFormals: this:class method::Getter * s:class method::X1 &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled]
19 -> 21 ; 19 -> 21 ;
18 [label="18: Return Stmt \n n$0=*&s:class X2 & [line 25]\n _=*n$0:class X2 [line 25]\n n$2=_fun_X2_get(n$0:class X2 &) [line 25]\n *&return:int =n$2 [line 25]\n " shape="box"] 18 [label="18: Return Stmt \n n$0=*&s:class method::X2 & [line 27]\n _=*n$0:class method::X2 [line 27]\n n$2=_fun_method::X2_get(n$0:class method::X2 &) [line 27]\n *&return:int =n$2 [line 27]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Exit Getter_get<X2> \n " color=yellow style=filled] 17 [label="17: Exit method::Getter_get<X2> \n " color=yellow style=filled]
16 [label="16: Start Getter_get<X2>\nFormals: this:class Getter * s:class X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] 16 [label="16: Start method::Getter_get<X2>\nFormals: this:class method::Getter * s:class method::X2 &\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled]
16 -> 18 ; 16 -> 18 ;
15 [label="15: Exit X3_X3 \n " color=yellow style=filled] 15 [label="15: Exit method::X3_X3 \n " color=yellow style=filled]
14 [label="14: Start X3_X3\nFormals: this:class X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n " color=yellow style=filled] 14 [label="14: Start method::X3_X3\nFormals: this:class method::X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled]
14 -> 15 ; 14 -> 15 ;
13 [label="13: Return Stmt \n *&return:int =0 [line 19]\n " shape="box"] 13 [label="13: Return Stmt \n *&return:int =0 [line 21]\n " shape="box"]
13 -> 12 ; 13 -> 12 ;
12 [label="12: Exit X3_get \n " color=yellow style=filled] 12 [label="12: Exit method::X3_get \n " color=yellow style=filled]
11 [label="11: Start X3_get\nFormals: this:class X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 11 [label="11: Start method::X3_get\nFormals: this:class method::X3 *\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
11 -> 13 ; 11 -> 13 ;
10 [label="10: Exit X2_X2 \n " color=yellow style=filled] 10 [label="10: Exit method::X2_X2 \n " color=yellow style=filled]
9 [label="9: Start X2_X2\nFormals: this:class X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] 9 [label="9: Start method::X2_X2\nFormals: this:class method::X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled]
9 -> 10 ; 9 -> 10 ;
8 [label="8: Return Stmt \n *&return:int =0 [line 15]\n " shape="box"] 8 [label="8: Return Stmt \n *&return:int =0 [line 17]\n " shape="box"]
8 -> 7 ; 8 -> 7 ;
7 [label="7: Exit X2_get \n " color=yellow style=filled] 7 [label="7: Exit method::X2_get \n " color=yellow style=filled]
6 [label="6: Start X2_get\nFormals: this:class X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 6 [label="6: Start method::X2_get\nFormals: this:class method::X2 *\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
6 -> 8 ; 6 -> 8 ;
5 [label="5: Exit X1_X1 \n " color=yellow style=filled] 5 [label="5: Exit method::X1_X1 \n " color=yellow style=filled]
4 [label="4: Start X1_X1\nFormals: this:class X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 4 [label="4: Start method::X1_X1\nFormals: this:class method::X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
4 -> 5 ; 4 -> 5 ;
3 [label="3: Return Stmt \n *&return:int =1 [line 11]\n " shape="box"] 3 [label="3: Return Stmt \n *&return:int =1 [line 13]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X1_get \n " color=yellow style=filled] 2 [label="2: Exit method::X1_get \n " color=yellow style=filled]
1 [label="1: Start X1_get\nFormals: this:class X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 11]\n " color=yellow style=filled] 1 [label="1: Start method::X1_get\nFormals: this:class method::X1 *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace return_struct {
struct X { struct X {
int f; int f;
// copy constructor that doesn't use init list // copy constructor that doesn't use init list
@ -42,3 +44,4 @@ int get_div1() {
int get_field_div1() { return 1 / get(1).f; } int get_field_div1() { return 1 / get(1).f; }
int get_method_div1() { return get(1).div(); } int get_method_div1() { return get(1).div(); }
}

@ -1,132 +1,132 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
35 [label="35: Return Stmt \n _fun_get(1:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 44]\n n$2=_fun_X_div(&0$?%__sil_tmp__temp_return_n$1:class X &) [line 44]\n *&return:int =n$2 [line 44]\n " shape="box"] 35 [label="35: Return Stmt \n _fun_return_struct::get(1:int ,&0$?%__sil_tmp__temp_return_n$1:class return_struct::X *) [line 46]\n n$2=_fun_return_struct::X_div(&0$?%__sil_tmp__temp_return_n$1:class return_struct::X &) [line 46]\n *&return:int =n$2 [line 46]\n " shape="box"]
35 -> 34 ; 35 -> 34 ;
34 [label="34: Exit get_method_div1 \n " color=yellow style=filled] 34 [label="34: Exit return_struct::get_method_div1 \n " color=yellow style=filled]
33 [label="33: Start get_method_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 44]\n " color=yellow style=filled] 33 [label="33: Start return_struct::get_method_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class return_struct::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 46]\n " color=yellow style=filled]
33 -> 35 ; 33 -> 35 ;
32 [label="32: Return Stmt \n _fun_get(1:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 42]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 42]\n *&return:int =(1 / n$2) [line 42]\n " shape="box"] 32 [label="32: Return Stmt \n _fun_return_struct::get(1:int ,&0$?%__sil_tmp__temp_return_n$1:class return_struct::X *) [line 44]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 44]\n *&return:int =(1 / n$2) [line 44]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: Exit get_field_div1 \n " color=yellow style=filled] 31 [label="31: Exit return_struct::get_field_div1 \n " color=yellow style=filled]
30 [label="30: Start get_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 42]\n " color=yellow style=filled] 30 [label="30: Start return_struct::get_field_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class return_struct::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 44]\n " color=yellow style=filled]
30 -> 32 ; 30 -> 32 ;
29 [label="29: DeclStmt \n _fun_get(1:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *) [line 38]\n _fun_X_X(&x:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 38]\n " shape="box"] 29 [label="29: DeclStmt \n _fun_return_struct::get(1:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X *) [line 40]\n _fun_return_struct::X_X(&x:class return_struct::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X &) [line 40]\n " shape="box"]
29 -> 28 ; 29 -> 28 ;
28 [label="28: Return Stmt \n n$0=*&x.f:int [line 39]\n *&return:int =(1 / n$0) [line 39]\n " shape="box"] 28 [label="28: Return Stmt \n n$0=*&x.f:int [line 41]\n *&return:int =(1 / n$0) [line 41]\n " shape="box"]
28 -> 27 ; 28 -> 27 ;
27 [label="27: Exit get_div1 \n " color=yellow style=filled] 27 [label="27: Exit return_struct::get_div1 \n " color=yellow style=filled]
26 [label="26: Start get_div1\nFormals: \nLocals: x:class X 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 37]\n " color=yellow style=filled] 26 [label="26: Start return_struct::get_div1\nFormals: \nLocals: x:class return_struct::X 0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 39]\n " color=yellow style=filled]
26 -> 29 ; 26 -> 29 ;
25 [label="25: Return Stmt \n _fun_get(0:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 35]\n n$2=_fun_X_div(&0$?%__sil_tmp__temp_return_n$1:class X &) [line 35]\n *&return:int =n$2 [line 35]\n " shape="box"] 25 [label="25: Return Stmt \n _fun_return_struct::get(0:int ,&0$?%__sil_tmp__temp_return_n$1:class return_struct::X *) [line 37]\n n$2=_fun_return_struct::X_div(&0$?%__sil_tmp__temp_return_n$1:class return_struct::X &) [line 37]\n *&return:int =n$2 [line 37]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit get_method_div0 \n " color=yellow style=filled] 24 [label="24: Exit return_struct::get_method_div0 \n " color=yellow style=filled]
23 [label="23: Start get_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 35]\n " color=yellow style=filled] 23 [label="23: Start return_struct::get_method_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class return_struct::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1); [line 37]\n " color=yellow style=filled]
23 -> 25 ; 23 -> 25 ;
22 [label="22: Call _fun_X_skip \n _fun_get(0:int ,&0$?%__sil_tmp__temp_return_n$4:class X *) [line 31]\n n$5=_fun_X_skip(&0$?%__sil_tmp__temp_return_n$4:class X &) [line 31]\n " shape="box"] 22 [label="22: Call _fun_return_struct::X_skip \n _fun_return_struct::get(0:int ,&0$?%__sil_tmp__temp_return_n$4:class return_struct::X *) [line 33]\n n$5=_fun_return_struct::X_skip(&0$?%__sil_tmp__temp_return_n$4:class return_struct::X &) [line 33]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Return Stmt \n _fun_get(0:int ,&0$?%__sil_tmp__temp_return_n$1:class X *) [line 32]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 32]\n *&return:int =(1 / n$2) [line 32]\n " shape="box"] 21 [label="21: Return Stmt \n _fun_return_struct::get(0:int ,&0$?%__sil_tmp__temp_return_n$1:class return_struct::X *) [line 34]\n n$2=*&0$?%__sil_tmp__temp_return_n$1.f:int [line 34]\n *&return:int =(1 / n$2) [line 34]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit get_field_div0 \n " color=yellow style=filled] 20 [label="20: Exit return_struct::get_field_div0 \n " color=yellow style=filled]
19 [label="19: Start get_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class X 0$?%__sil_tmp__temp_return_n$4:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1,&0$?%__sil_tmp__temp_return_n$4); [line 30]\n " color=yellow style=filled] 19 [label="19: Start return_struct::get_field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_return_n$1:class return_struct::X 0$?%__sil_tmp__temp_return_n$4:class return_struct::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_return_n$1,&0$?%__sil_tmp__temp_return_n$4); [line 32]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: DeclStmt \n _fun_get(0:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *) [line 26]\n _fun_X_X(&x:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 26]\n " shape="box"] 18 [label="18: DeclStmt \n _fun_return_struct::get(0:int ,&0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X *) [line 28]\n _fun_return_struct::X_X(&x:class return_struct::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X &) [line 28]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Return Stmt \n n$0=*&x.f:int [line 27]\n *&return:int =(1 / n$0) [line 27]\n " shape="box"] 17 [label="17: Return Stmt \n n$0=*&x.f:int [line 29]\n *&return:int =(1 / n$0) [line 29]\n " shape="box"]
17 -> 16 ; 17 -> 16 ;
16 [label="16: Exit get_div0 \n " color=yellow style=filled] 16 [label="16: Exit return_struct::get_div0 \n " color=yellow style=filled]
15 [label="15: Start get_div0\nFormals: \nLocals: x:class X 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 25]\n " color=yellow style=filled] 15 [label="15: Start return_struct::get_div0\nFormals: \nLocals: x:class return_struct::X 0$?%__sil_tmpSIL_materialize_temp__n$1:class return_struct::X \n DECLARE_LOCALS(&return,&x,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 27]\n " color=yellow style=filled]
15 -> 18 ; 15 -> 18 ;
14 [label="14: DeclStmt \n _fun_X_X(&x:class X *) [line 20]\n " shape="box"] 14 [label="14: DeclStmt \n _fun_return_struct::X_X(&x:class return_struct::X *) [line 22]\n " shape="box"]
14 -> 13 ; 14 -> 13 ;
13 [label="13: BinaryOperatorStmt: Assign \n n$1=*&a:int [line 21]\n *&x.f:int =n$1 [line 21]\n " shape="box"] 13 [label="13: BinaryOperatorStmt: Assign \n n$1=*&a:int [line 23]\n *&x.f:int =n$1 [line 23]\n " shape="box"]
13 -> 12 ; 13 -> 12 ;
12 [label="12: Return Stmt \n n$0=*&__return_param:class X * [line 22]\n _fun_X_X(n$0:class X *,&x:class X &) [line 22]\n " shape="box"] 12 [label="12: Return Stmt \n n$0=*&__return_param:class return_struct::X * [line 24]\n _fun_return_struct::X_X(n$0:class return_struct::X *,&x:class return_struct::X &) [line 24]\n " shape="box"]
12 -> 11 ; 12 -> 11 ;
11 [label="11: Exit get \n " color=yellow style=filled] 11 [label="11: Exit return_struct::get \n " color=yellow style=filled]
10 [label="10: Start get\nFormals: a:int __return_param:class X *\nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 19]\n " color=yellow style=filled] 10 [label="10: Start return_struct::get\nFormals: a:int __return_param:class return_struct::X *\nLocals: x:class return_struct::X \n DECLARE_LOCALS(&return,&x); [line 21]\n " color=yellow style=filled]
10 -> 14 ; 10 -> 14 ;
9 [label="9: Return Stmt \n n$0=*&this:class X * [line 15]\n n$1=*n$0.f:int [line 15]\n *&return:int =(1 / n$1) [line 15]\n " shape="box"] 9 [label="9: Return Stmt \n n$0=*&this:class return_struct::X * [line 17]\n n$1=*n$0.f:int [line 17]\n *&return:int =(1 / n$1) [line 17]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit X_div \n " color=yellow style=filled] 8 [label="8: Exit return_struct::X_div \n " color=yellow style=filled]
7 [label="7: Start X_div\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled] 7 [label="7: Start return_struct::X_div\nFormals: this:class return_struct::X *\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled]
7 -> 9 ; 7 -> 9 ;
6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 14]\n *n$0.f:int =1 [line 14]\n " shape="box"] 6 [label="6: BinaryOperatorStmt: Assign \n n$0=*&this:class return_struct::X * [line 16]\n *n$0.f:int =1 [line 16]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit X_X \n " color=yellow style=filled] 5 [label="5: Exit return_struct::X_X \n " color=yellow style=filled]
4 [label="4: Start X_X\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] 4 [label="4: Start return_struct::X_X\nFormals: this:class return_struct::X *\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class X * [line 13]\n n$1=*&x:class X & [line 13]\n n$2=*n$1.f:int [line 13]\n *n$0.f:int =n$2 [line 13]\n " shape="box"] 3 [label="3: BinaryOperatorStmt: Assign \n n$0=*&this:class return_struct::X * [line 15]\n n$1=*&x:class return_struct::X & [line 15]\n n$2=*n$1.f:int [line 15]\n *n$0.f:int =n$2 [line 15]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_X \n " color=yellow style=filled] 2 [label="2: Exit return_struct::X_X \n " color=yellow style=filled]
1 [label="1: Start X_X\nFormals: this:class X * x:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] 1 [label="1: Start return_struct::X_X\nFormals: this:class return_struct::X * x:class return_struct::X &\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace struct_forward_declare {
// this will never be defined // this will never be defined
struct Y; struct Y;
@ -65,3 +67,4 @@ int Z_ptr_div0(Z* z) {
z->f = 0; z->f = 0;
return 1 / z->getF(); return 1 / z->getF();
} }
}

@ -1,61 +1,61 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
41 [label="41: BinaryOperatorStmt: Assign \n n$3=*&z:class Z * [line 65]\n *n$3.f:int =0 [line 65]\n " shape="box"] 41 [label="41: BinaryOperatorStmt: Assign \n n$3=*&z:class struct_forward_declare::Z * [line 67]\n *n$3.f:int =0 [line 67]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: Return Stmt \n n$0=*&z:class Z * [line 66]\n _=*n$0:class Z [line 66]\n n$2=_fun_Z_getF(n$0:class Z *) [line 66]\n *&return:int =(1 / n$2) [line 66]\n " shape="box"] 40 [label="40: Return Stmt \n n$0=*&z:class struct_forward_declare::Z * [line 68]\n _=*n$0:class struct_forward_declare::Z [line 68]\n n$2=_fun_struct_forward_declare::Z_getF(n$0:class struct_forward_declare::Z *) [line 68]\n *&return:int =(1 / n$2) [line 68]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: Exit Z_ptr_div0 \n " color=yellow style=filled] 39 [label="39: Exit struct_forward_declare::Z_ptr_div0 \n " color=yellow style=filled]
38 [label="38: Start Z_ptr_div0\nFormals: z:class Z *\nLocals: \n DECLARE_LOCALS(&return); [line 61]\n " color=yellow style=filled] 38 [label="38: Start struct_forward_declare::Z_ptr_div0\nFormals: z:class struct_forward_declare::Z *\nLocals: \n DECLARE_LOCALS(&return); [line 63]\n " color=yellow style=filled]
38 -> 41 ; 38 -> 41 ;
37 [label="37: DeclStmt \n _fun_Z_Z(&z:class Z *) [line 56]\n " shape="box"] 37 [label="37: DeclStmt \n _fun_struct_forward_declare::Z_Z(&z:class struct_forward_declare::Z *) [line 58]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: BinaryOperatorStmt: Assign \n *&z.f:int =0 [line 57]\n " shape="box"] 36 [label="36: BinaryOperatorStmt: Assign \n *&z.f:int =0 [line 59]\n " shape="box"]
36 -> 35 ; 36 -> 35 ;
35 [label="35: Return Stmt \n _=*&z:class Z [line 58]\n n$1=_fun_Z_getF(&z:class Z &) [line 58]\n *&return:int =(1 / n$1) [line 58]\n " shape="box"] 35 [label="35: Return Stmt \n _=*&z:class struct_forward_declare::Z [line 60]\n n$1=_fun_struct_forward_declare::Z_getF(&z:class struct_forward_declare::Z &) [line 60]\n *&return:int =(1 / n$1) [line 60]\n " shape="box"]
35 -> 34 ; 35 -> 34 ;
34 [label="34: Exit Z_div0 \n " color=yellow style=filled] 34 [label="34: Exit struct_forward_declare::Z_div0 \n " color=yellow style=filled]
33 [label="33: Start Z_div0\nFormals: \nLocals: z:class Z \n DECLARE_LOCALS(&return,&z); [line 55]\n " color=yellow style=filled] 33 [label="33: Start struct_forward_declare::Z_div0\nFormals: \nLocals: z:class struct_forward_declare::Z \n DECLARE_LOCALS(&return,&z); [line 57]\n " color=yellow style=filled]
33 -> 37 ; 33 -> 37 ;
32 [label="32: DeclStmt \n _fun_X_X(&x:class X *) [line 46]\n " shape="box"] 32 [label="32: DeclStmt \n _fun_struct_forward_declare::X_X(&x:class struct_forward_declare::X *) [line 48]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: BinaryOperatorStmt: Assign \n *&x.y:class Y *=null [line 47]\n " shape="box"] 31 [label="31: BinaryOperatorStmt: Assign \n *&x.y:class struct_forward_declare::Y *=null [line 49]\n " shape="box"]
31 -> 30 ; 31 -> 30 ;
30 [label="30: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 48]\n " shape="box"] 30 [label="30: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 50]\n " shape="box"]
30 -> 27 ; 30 -> 27 ;
30 -> 28 ; 30 -> 28 ;
29 [label="29: Return Stmt \n *&return:int =1 [line 50]\n " shape="box"] 29 [label="29: Return Stmt \n *&return:int =1 [line 52]\n " shape="box"]
29 -> 24 ; 29 -> 24 ;
28 [label="28: Prune (false branch) \n n$2=*&x.y:class Y * [line 49]\n PRUNE((n$2 == 0), false); [line 49]\n " shape="invhouse"] 28 [label="28: Prune (false branch) \n n$2=*&x.y:class struct_forward_declare::Y * [line 51]\n PRUNE((n$2 == 0), false); [line 51]\n " shape="invhouse"]
28 -> 26 ; 28 -> 26 ;
27 [label="27: Prune (true branch) \n n$2=*&x.y:class Y * [line 49]\n PRUNE((n$2 != 0), true); [line 49]\n " shape="invhouse"] 27 [label="27: Prune (true branch) \n n$2=*&x.y:class struct_forward_declare::Y * [line 51]\n PRUNE((n$2 != 0), true); [line 51]\n " shape="invhouse"]
27 -> 29 ; 27 -> 29 ;
@ -63,95 +63,95 @@ digraph iCFG {
26 -> 25 ; 26 -> 25 ;
25 [label="25: Return Stmt \n _=*&x:class X [line 52]\n n$1=_fun_X_getF(&x:class X &) [line 52]\n *&return:int =(1 / n$1) [line 52]\n " shape="box"] 25 [label="25: Return Stmt \n _=*&x:class struct_forward_declare::X [line 54]\n n$1=_fun_struct_forward_declare::X_getF(&x:class struct_forward_declare::X &) [line 54]\n *&return:int =(1 / n$1) [line 54]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit X_Y_div0 \n " color=yellow style=filled] 24 [label="24: Exit struct_forward_declare::X_Y_div0 \n " color=yellow style=filled]
23 [label="23: Start X_Y_div0\nFormals: \nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 45]\n " color=yellow style=filled] 23 [label="23: Start struct_forward_declare::X_Y_div0\nFormals: \nLocals: x:class struct_forward_declare::X \n DECLARE_LOCALS(&return,&x); [line 47]\n " color=yellow style=filled]
23 -> 32 ; 23 -> 32 ;
22 [label="22: BinaryOperatorStmt: Assign \n n$3=*&x:class X * [line 41]\n *n$3.f:int =0 [line 41]\n " shape="box"] 22 [label="22: BinaryOperatorStmt: Assign \n n$3=*&x:class struct_forward_declare::X * [line 43]\n *n$3.f:int =0 [line 43]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Return Stmt \n n$0=*&x:class X * [line 42]\n _=*n$0:class X [line 42]\n n$2=_fun_X_getF(n$0:class X *) [line 42]\n *&return:int =(1 / n$2) [line 42]\n " shape="box"] 21 [label="21: Return Stmt \n n$0=*&x:class struct_forward_declare::X * [line 44]\n _=*n$0:class struct_forward_declare::X [line 44]\n n$2=_fun_struct_forward_declare::X_getF(n$0:class struct_forward_declare::X *) [line 44]\n *&return:int =(1 / n$2) [line 44]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit X_ptr_div0 \n " color=yellow style=filled] 20 [label="20: Exit struct_forward_declare::X_ptr_div0 \n " color=yellow style=filled]
19 [label="19: Start X_ptr_div0\nFormals: x:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 40]\n " color=yellow style=filled] 19 [label="19: Start struct_forward_declare::X_ptr_div0\nFormals: x:class struct_forward_declare::X *\nLocals: \n DECLARE_LOCALS(&return); [line 42]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: DeclStmt \n _fun_X_X(&x:class X *) [line 35]\n " shape="box"] 18 [label="18: DeclStmt \n _fun_struct_forward_declare::X_X(&x:class struct_forward_declare::X *) [line 37]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 36]\n " shape="box"] 17 [label="17: BinaryOperatorStmt: Assign \n *&x.f:int =0 [line 38]\n " shape="box"]
17 -> 16 ; 17 -> 16 ;
16 [label="16: Return Stmt \n _=*&x:class X [line 37]\n n$1=_fun_X_getF(&x:class X &) [line 37]\n *&return:int =(1 / n$1) [line 37]\n " shape="box"] 16 [label="16: Return Stmt \n _=*&x:class struct_forward_declare::X [line 39]\n n$1=_fun_struct_forward_declare::X_getF(&x:class struct_forward_declare::X &) [line 39]\n *&return:int =(1 / n$1) [line 39]\n " shape="box"]
16 -> 15 ; 16 -> 15 ;
15 [label="15: Exit X_div0 \n " color=yellow style=filled] 15 [label="15: Exit struct_forward_declare::X_div0 \n " color=yellow style=filled]
14 [label="14: Start X_div0\nFormals: \nLocals: x:class X \n DECLARE_LOCALS(&return,&x); [line 34]\n " color=yellow style=filled] 14 [label="14: Start struct_forward_declare::X_div0\nFormals: \nLocals: x:class struct_forward_declare::X \n DECLARE_LOCALS(&return,&x); [line 36]\n " color=yellow style=filled]
14 -> 18 ; 14 -> 18 ;
13 [label="13: Exit Z_Z \n " color=yellow style=filled] 13 [label="13: Exit struct_forward_declare::Z_Z \n " color=yellow style=filled]
12 [label="12: Start Z_Z\nFormals: this:class Z *\nLocals: \n DECLARE_LOCALS(&return); [line 26]\n " color=yellow style=filled] 12 [label="12: Start struct_forward_declare::Z_Z\nFormals: this:class struct_forward_declare::Z *\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled]
12 -> 13 ; 12 -> 13 ;
11 [label="11: Return Stmt \n n$0=*&this:class Z * [line 28]\n n$1=*n$0.f:int [line 28]\n *&return:int =n$1 [line 28]\n " shape="box"] 11 [label="11: Return Stmt \n n$0=*&this:class struct_forward_declare::Z * [line 30]\n n$1=*n$0.f:int [line 30]\n *&return:int =n$1 [line 30]\n " shape="box"]
11 -> 10 ; 11 -> 10 ;
10 [label="10: Exit Z_getF \n " color=yellow style=filled] 10 [label="10: Exit struct_forward_declare::Z_getF \n " color=yellow style=filled]
9 [label="9: Start Z_getF\nFormals: this:class Z *\nLocals: \n DECLARE_LOCALS(&return); [line 28]\n " color=yellow style=filled] 9 [label="9: Start struct_forward_declare::Z_getF\nFormals: this:class struct_forward_declare::Z *\nLocals: \n DECLARE_LOCALS(&return); [line 30]\n " color=yellow style=filled]
9 -> 11 ; 9 -> 11 ;
8 [label="8: DeclStmt \n n$0=*&z1:class Z * [line 24]\n *&z2:class Z *=n$0 [line 24]\n " shape="box"] 8 [label="8: DeclStmt \n n$0=*&z1:class struct_forward_declare::Z * [line 26]\n *&z2:class struct_forward_declare::Z *=n$0 [line 26]\n " shape="box"]
8 -> 7 ; 8 -> 7 ;
7 [label="7: Exit fun_with_Z \n " color=yellow style=filled] 7 [label="7: Exit struct_forward_declare::fun_with_Z \n " color=yellow style=filled]
6 [label="6: Start fun_with_Z\nFormals: z1:class Z *\nLocals: z2:class Z * \n DECLARE_LOCALS(&return,&z2); [line 24]\n " color=yellow style=filled] 6 [label="6: Start struct_forward_declare::fun_with_Z\nFormals: z1:class struct_forward_declare::Z *\nLocals: z2:class struct_forward_declare::Z * \n DECLARE_LOCALS(&return,&z2); [line 26]\n " color=yellow style=filled]
6 -> 8 ; 6 -> 8 ;
5 [label="5: Exit X_X \n " color=yellow style=filled] 5 [label="5: Exit struct_forward_declare::X_X \n " color=yellow style=filled]
4 [label="4: Start X_X\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] 4 [label="4: Start struct_forward_declare::X_X\nFormals: this:class struct_forward_declare::X *\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled]
4 -> 5 ; 4 -> 5 ;
3 [label="3: Return Stmt \n n$0=*&this:class X * [line 19]\n n$1=*n$0.f:int [line 19]\n *&return:int =n$1 [line 19]\n " shape="box"] 3 [label="3: Return Stmt \n n$0=*&this:class struct_forward_declare::X * [line 21]\n n$1=*n$0.f:int [line 21]\n *&return:int =n$1 [line 21]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_getF \n " color=yellow style=filled] 2 [label="2: Exit struct_forward_declare::X_getF \n " color=yellow style=filled]
1 [label="1: Start X_getF\nFormals: this:class X *\nLocals: \n DECLARE_LOCALS(&return); [line 19]\n " color=yellow style=filled] 1 [label="1: Start struct_forward_declare::X_getF\nFormals: this:class struct_forward_declare::X *\nLocals: \n DECLARE_LOCALS(&return); [line 21]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*/ */
namespace struct_pass_by_value {
struct X { struct X {
int f; int f;
X(int f) : f(f) {} X(int f) : f(f) {}
@ -53,3 +55,4 @@ int param_get_copied_div1() {
set_f(x, 0); // this won't change x set_f(x, 0); // this won't change x
return 1 / x.f; return 1 / x.f;
} }
}

@ -1,177 +1,177 @@
/* @generated */ /* @generated */
digraph iCFG { digraph iCFG {
47 [label="47: DeclStmt \n _fun_X_X(&x:class X *,1:int ) [line 52]\n " shape="box"] 47 [label="47: DeclStmt \n _fun_struct_pass_by_value::X_X(&x:class struct_pass_by_value::X *,1:int ) [line 54]\n " shape="box"]
47 -> 46 ; 47 -> 46 ;
46 [label="46: Call _fun_set_f \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$1:class X *,&x:class X &) [line 53]\n _fun_set_f(&0$?%__sil_tmp__temp_construct_n$1:class X ,0:int ) [line 53]\n " shape="box"] 46 [label="46: Call _fun_struct_pass_by_value::set_f \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X *,&x:class struct_pass_by_value::X &) [line 55]\n _fun_struct_pass_by_value::set_f(&0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X ,0:int ) [line 55]\n " shape="box"]
46 -> 45 ; 46 -> 45 ;
45 [label="45: Return Stmt \n n$0=*&x.f:int [line 54]\n *&return:int =(1 / n$0) [line 54]\n " shape="box"] 45 [label="45: Return Stmt \n n$0=*&x.f:int [line 56]\n *&return:int =(1 / n$0) [line 56]\n " shape="box"]
45 -> 44 ; 45 -> 44 ;
44 [label="44: Exit param_get_copied_div1 \n " color=yellow style=filled] 44 [label="44: Exit struct_pass_by_value::param_get_copied_div1 \n " color=yellow style=filled]
43 [label="43: Start param_get_copied_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$1:class X x:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$1,&x); [line 51]\n " color=yellow style=filled] 43 [label="43: Start struct_pass_by_value::param_get_copied_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X x:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$1,&x); [line 53]\n " color=yellow style=filled]
43 -> 47 ; 43 -> 47 ;
42 [label="42: DeclStmt \n _fun_X_X(&x:class X *,0:int ) [line 46]\n " shape="box"] 42 [label="42: DeclStmt \n _fun_struct_pass_by_value::X_X(&x:class struct_pass_by_value::X *,0:int ) [line 48]\n " shape="box"]
42 -> 41 ; 42 -> 41 ;
41 [label="41: Call _fun_set_f \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$1:class X *,&x:class X &) [line 47]\n _fun_set_f(&0$?%__sil_tmp__temp_construct_n$1:class X ,1:int ) [line 47]\n " shape="box"] 41 [label="41: Call _fun_struct_pass_by_value::set_f \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X *,&x:class struct_pass_by_value::X &) [line 49]\n _fun_struct_pass_by_value::set_f(&0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X ,1:int ) [line 49]\n " shape="box"]
41 -> 40 ; 41 -> 40 ;
40 [label="40: Return Stmt \n n$0=*&x.f:int [line 48]\n *&return:int =(1 / n$0) [line 48]\n " shape="box"] 40 [label="40: Return Stmt \n n$0=*&x.f:int [line 50]\n *&return:int =(1 / n$0) [line 50]\n " shape="box"]
40 -> 39 ; 40 -> 39 ;
39 [label="39: Exit param_get_copied_div0 \n " color=yellow style=filled] 39 [label="39: Exit struct_pass_by_value::param_get_copied_div0 \n " color=yellow style=filled]
38 [label="38: Start param_get_copied_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$1:class X x:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$1,&x); [line 45]\n " color=yellow style=filled] 38 [label="38: Start struct_pass_by_value::param_get_copied_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$1:class struct_pass_by_value::X x:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$1,&x); [line 47]\n " color=yellow style=filled]
38 -> 42 ; 38 -> 42 ;
37 [label="37: DeclStmt \n _fun_X_X(&x:class X *,0:int ) [line 40]\n " shape="box"] 37 [label="37: DeclStmt \n _fun_struct_pass_by_value::X_X(&x:class struct_pass_by_value::X *,0:int ) [line 42]\n " shape="box"]
37 -> 36 ; 37 -> 36 ;
36 [label="36: DeclStmt \n _fun_Y_Y(&y:class Y *,&x:class X &) [line 41]\n " shape="box"] 36 [label="36: DeclStmt \n _fun_struct_pass_by_value::Y_Y(&y:class struct_pass_by_value::Y *,&x:class struct_pass_by_value::X &) [line 43]\n " shape="box"]
36 -> 35 ; 36 -> 35 ;
35 [label="35: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&y.x:class X &) [line 42]\n n$1=_fun_get_f(&0$?%__sil_tmp__temp_construct_n$0:class X ) [line 42]\n *&return:int =(1 / n$1) [line 42]\n " shape="box"] 35 [label="35: Return Stmt \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X *,&y.x:class struct_pass_by_value::X &) [line 44]\n n$1=_fun_struct_pass_by_value::get_f(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X ) [line 44]\n *&return:int =(1 / n$1) [line 44]\n " shape="box"]
35 -> 34 ; 35 -> 34 ;
34 [label="34: Exit field_div0 \n " color=yellow style=filled] 34 [label="34: Exit struct_pass_by_value::field_div0 \n " color=yellow style=filled]
33 [label="33: Start field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X y:class Y x:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&y,&x); [line 39]\n " color=yellow style=filled] 33 [label="33: Start struct_pass_by_value::field_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X y:class struct_pass_by_value::Y x:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&y,&x); [line 41]\n " color=yellow style=filled]
33 -> 37 ; 33 -> 37 ;
32 [label="32: Return Stmt \n _fun_X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *,1:int ) [line 37]\n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 37]\n n$2=_fun_get_f(&0$?%__sil_tmp__temp_construct_n$0:class X ) [line 37]\n *&return:int =(1 / n$2) [line 37]\n " shape="box"] 32 [label="32: Return Stmt \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X *,1:int ) [line 39]\n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X &) [line 39]\n n$2=_fun_struct_pass_by_value::get_f(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X ) [line 39]\n *&return:int =(1 / n$2) [line 39]\n " shape="box"]
32 -> 31 ; 32 -> 31 ;
31 [label="31: Exit temp_div1 \n " color=yellow style=filled] 31 [label="31: Exit struct_pass_by_value::temp_div1 \n " color=yellow style=filled]
30 [label="30: Start temp_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 37]\n " color=yellow style=filled] 30 [label="30: Start struct_pass_by_value::temp_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X 0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 39]\n " color=yellow style=filled]
30 -> 32 ; 30 -> 32 ;
29 [label="29: Return Stmt \n _fun_X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class X *,0:int ) [line 35]\n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class X &) [line 35]\n n$2=_fun_get_f(&0$?%__sil_tmp__temp_construct_n$0:class X ) [line 35]\n *&return:int =(1 / n$2) [line 35]\n " shape="box"] 29 [label="29: Return Stmt \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X *,0:int ) [line 37]\n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X *,&0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X &) [line 37]\n n$2=_fun_struct_pass_by_value::get_f(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X ) [line 37]\n *&return:int =(1 / n$2) [line 37]\n " shape="box"]
29 -> 28 ; 29 -> 28 ;
28 [label="28: Exit temp_div0 \n " color=yellow style=filled] 28 [label="28: Exit struct_pass_by_value::temp_div0 \n " color=yellow style=filled]
27 [label="27: Start temp_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X 0$?%__sil_tmpSIL_materialize_temp__n$1:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 35]\n " color=yellow style=filled] 27 [label="27: Start struct_pass_by_value::temp_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X 0$?%__sil_tmpSIL_materialize_temp__n$1:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&0$?%__sil_tmpSIL_materialize_temp__n$1); [line 37]\n " color=yellow style=filled]
27 -> 29 ; 27 -> 29 ;
26 [label="26: DeclStmt \n _fun_X_X(&x:class X *,1:int ) [line 31]\n " shape="box"] 26 [label="26: DeclStmt \n _fun_struct_pass_by_value::X_X(&x:class struct_pass_by_value::X *,1:int ) [line 33]\n " shape="box"]
26 -> 25 ; 26 -> 25 ;
25 [label="25: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&x:class X &) [line 32]\n n$1=_fun_get_f(&0$?%__sil_tmp__temp_construct_n$0:class X ) [line 32]\n *&return:int =(1 / n$1) [line 32]\n " shape="box"] 25 [label="25: Return Stmt \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X *,&x:class struct_pass_by_value::X &) [line 34]\n n$1=_fun_struct_pass_by_value::get_f(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X ) [line 34]\n *&return:int =(1 / n$1) [line 34]\n " shape="box"]
25 -> 24 ; 25 -> 24 ;
24 [label="24: Exit var_div1 \n " color=yellow style=filled] 24 [label="24: Exit struct_pass_by_value::var_div1 \n " color=yellow style=filled]
23 [label="23: Start var_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X x:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&x); [line 30]\n " color=yellow style=filled] 23 [label="23: Start struct_pass_by_value::var_div1\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X x:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&x); [line 32]\n " color=yellow style=filled]
23 -> 26 ; 23 -> 26 ;
22 [label="22: DeclStmt \n _fun_X_X(&x:class X *,0:int ) [line 26]\n " shape="box"] 22 [label="22: DeclStmt \n _fun_struct_pass_by_value::X_X(&x:class struct_pass_by_value::X *,0:int ) [line 28]\n " shape="box"]
22 -> 21 ; 22 -> 21 ;
21 [label="21: Return Stmt \n _fun_X_X(&0$?%__sil_tmp__temp_construct_n$0:class X *,&x:class X &) [line 27]\n n$1=_fun_get_f(&0$?%__sil_tmp__temp_construct_n$0:class X ) [line 27]\n *&return:int =(1 / n$1) [line 27]\n " shape="box"] 21 [label="21: Return Stmt \n _fun_struct_pass_by_value::X_X(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X *,&x:class struct_pass_by_value::X &) [line 29]\n n$1=_fun_struct_pass_by_value::get_f(&0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X ) [line 29]\n *&return:int =(1 / n$1) [line 29]\n " shape="box"]
21 -> 20 ; 21 -> 20 ;
20 [label="20: Exit var_div0 \n " color=yellow style=filled] 20 [label="20: Exit struct_pass_by_value::var_div0 \n " color=yellow style=filled]
19 [label="19: Start var_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class X x:class X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&x); [line 25]\n " color=yellow style=filled] 19 [label="19: Start struct_pass_by_value::var_div0\nFormals: \nLocals: 0$?%__sil_tmp__temp_construct_n$0:class struct_pass_by_value::X x:class struct_pass_by_value::X \n DECLARE_LOCALS(&return,&0$?%__sil_tmp__temp_construct_n$0,&x); [line 27]\n " color=yellow style=filled]
19 -> 22 ; 19 -> 22 ;
18 [label="18: BinaryOperatorStmt: Assign \n n$0=*&val:class X & [line 23]\n n$1=*&f:int [line 23]\n *n$0.f:int =n$1 [line 23]\n " shape="box"] 18 [label="18: BinaryOperatorStmt: Assign \n n$0=*&val:class struct_pass_by_value::X & [line 25]\n n$1=*&f:int [line 25]\n *n$0.f:int =n$1 [line 25]\n " shape="box"]
18 -> 17 ; 18 -> 17 ;
17 [label="17: Exit set_f \n " color=yellow style=filled] 17 [label="17: Exit struct_pass_by_value::set_f \n " color=yellow style=filled]
16 [label="16: Start set_f\nFormals: val:class X & f:int \nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled] 16 [label="16: Start struct_pass_by_value::set_f\nFormals: val:class struct_pass_by_value::X & f:int \nLocals: \n DECLARE_LOCALS(&return); [line 25]\n " color=yellow style=filled]
16 -> 18 ; 16 -> 18 ;
15 [label="15: Return Stmt \n n$0=*&val:class X & [line 20]\n n$1=*n$0.f:int [line 20]\n *&return:int =n$1 [line 20]\n " shape="box"] 15 [label="15: Return Stmt \n n$0=*&val:class struct_pass_by_value::X & [line 22]\n n$1=*n$0.f:int [line 22]\n *&return:int =n$1 [line 22]\n " shape="box"]
15 -> 14 ; 15 -> 14 ;
14 [label="14: Exit get_f \n " color=yellow style=filled] 14 [label="14: Exit struct_pass_by_value::get_f \n " color=yellow style=filled]
13 [label="13: Start get_f\nFormals: val:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 20]\n " color=yellow style=filled] 13 [label="13: Start struct_pass_by_value::get_f\nFormals: val:class struct_pass_by_value::X &\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled]
13 -> 15 ; 13 -> 15 ;
12 [label="12: Constructor Init \n n$0=*&this:class Y * [line 16]\n n$1=*&x:class X & [line 16]\n _fun_X_X(n$0.x:class X *,n$1:class X &) [line 16]\n " shape="box"] 12 [label="12: Constructor Init \n n$0=*&this:class struct_pass_by_value::Y * [line 18]\n n$1=*&x:class struct_pass_by_value::X & [line 18]\n _fun_struct_pass_by_value::X_X(n$0.x:class struct_pass_by_value::X *,n$1:class struct_pass_by_value::X &) [line 18]\n " shape="box"]
12 -> 11 ; 12 -> 11 ;
11 [label="11: Exit Y_Y \n " color=yellow style=filled] 11 [label="11: Exit struct_pass_by_value::Y_Y \n " color=yellow style=filled]
10 [label="10: Start Y_Y\nFormals: this:class Y * x:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 16]\n " color=yellow style=filled] 10 [label="10: Start struct_pass_by_value::Y_Y\nFormals: this:class struct_pass_by_value::Y * x:class struct_pass_by_value::X &\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n " color=yellow style=filled]
10 -> 12 ; 10 -> 12 ;
9 [label="9: Constructor Init \n n$0=*&this:class X * [line 10]\n n$1=*&__param_0:class X & [line 10]\n n$2=*n$1.f:int [line 10]\n *n$0.f:int =n$2 [line 10]\n " shape="box"] 9 [label="9: Constructor Init \n n$0=*&this:class struct_pass_by_value::X * [line 12]\n n$1=*&__param_0:class struct_pass_by_value::X & [line 12]\n n$2=*n$1.f:int [line 12]\n *n$0.f:int =n$2 [line 12]\n " shape="box"]
9 -> 8 ; 9 -> 8 ;
8 [label="8: Exit X_X \n " color=yellow style=filled] 8 [label="8: Exit struct_pass_by_value::X_X \n " color=yellow style=filled]
7 [label="7: Start X_X\nFormals: this:class X * __param_0:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 7 [label="7: Start struct_pass_by_value::X_X\nFormals: this:class struct_pass_by_value::X * __param_0:class struct_pass_by_value::X &\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
7 -> 9 ; 7 -> 9 ;
6 [label="6: Constructor Init \n n$0=*&this:class X * [line 10]\n n$1=*&__param_0:class X & [line 10]\n n$2=*n$1.f:int [line 10]\n *n$0.f:int =n$2 [line 10]\n " shape="box"] 6 [label="6: Constructor Init \n n$0=*&this:class struct_pass_by_value::X * [line 12]\n n$1=*&__param_0:class struct_pass_by_value::X & [line 12]\n n$2=*n$1.f:int [line 12]\n *n$0.f:int =n$2 [line 12]\n " shape="box"]
6 -> 5 ; 6 -> 5 ;
5 [label="5: Exit X_X \n " color=yellow style=filled] 5 [label="5: Exit struct_pass_by_value::X_X \n " color=yellow style=filled]
4 [label="4: Start X_X\nFormals: this:class X * __param_0:class X &\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] 4 [label="4: Start struct_pass_by_value::X_X\nFormals: this:class struct_pass_by_value::X * __param_0:class struct_pass_by_value::X &\nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled]
4 -> 6 ; 4 -> 6 ;
3 [label="3: Constructor Init \n n$0=*&this:class X * [line 12]\n n$1=*&f:int [line 12]\n *n$0.f:int =n$1 [line 12]\n " shape="box"] 3 [label="3: Constructor Init \n n$0=*&this:class struct_pass_by_value::X * [line 14]\n n$1=*&f:int [line 14]\n *n$0.f:int =n$1 [line 14]\n " shape="box"]
3 -> 2 ; 3 -> 2 ;
2 [label="2: Exit X_X \n " color=yellow style=filled] 2 [label="2: Exit struct_pass_by_value::X_X \n " color=yellow style=filled]
1 [label="1: Start X_X\nFormals: this:class X * f:int \nLocals: \n DECLARE_LOCALS(&return); [line 12]\n " color=yellow style=filled] 1 [label="1: Start struct_pass_by_value::X_X\nFormals: this:class struct_pass_by_value::X * f:int \nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled]
1 -> 3 ; 1 -> 3 ;

@ -34,17 +34,6 @@ java_test(
], ],
) )
# ############### Cpp endtoend tests ########################
java_test(
name='cpp_endtoend_tests',
deps=[
'//infer/tests/endtoend/cpp/infer:infer',
],
visibility=[
'PUBLIC',
],
)
# ############### ObjCpp endtoend tests ######################## # ############### ObjCpp endtoend tests ########################
java_test( java_test(
name='objcpp_endtoend_tests', name='objcpp_endtoend_tests',

@ -1,35 +0,0 @@
tests_dependencies = [
'//infer/lib/java/android:android',
'//dependencies/java/guava:guava',
'//dependencies/java/junit:hamcrest',
'//dependencies/java/jackson:jackson',
'//dependencies/java/jsr-305:jsr-305',
'//dependencies/java/junit:junit',
'//dependencies/java/opencsv:opencsv',
'//infer/tests/utils:utils',
]
cpp_infer_test_sources = glob(['*.java'])
cpp_infer_test_deps = []
for test_source in cpp_infer_test_sources:
target_name = test_source.replace("/", "_")[:-len(".java")]
cpp_infer_test_deps.append(target_name)
java_test(
name=target_name,
srcs=[test_source],
deps=tests_dependencies,
visibility=[
'PUBLIC',
],
source='7',
target='7',
)
java_test(
name='infer',
deps=[':' + x for x in cpp_infer_test_deps],
visibility=[
'PUBLIC',
],
)

@ -1,67 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class BoxedPtrTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/errors/npe/boxed_ptr.cpp";
private static ImmutableList<String> inferCmd;
public static final String NULL_DEREFERENCE = "NULL_DEREFERENCE";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsNullDerefFunctionsErrorIsFound()
throws InterruptedException, IOException, InferException {
String[] procedures = {
"smart_ptr_null_field_deref",
"smart_ptr_null_method_deref",
"smart_ptr_null_method_deref2",
"smart_ptr_result_method_null_deref",
};
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by 0 error",
inferResults,
containsExactly(
NULL_DEREFERENCE,
FILE,
procedures
)
);
}
}

@ -1,134 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsErrorInMethod.contains;
import static utils.matchers.ResultContainsExactly.containsExactly;
import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class CBugsTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/errors/c_tests/c_bugs.cpp";
private static ImmutableList<String> inferCmd;
public static final String MEMORY_LEAK = "MEMORY_LEAK";
public static final String NULL_DEREFERENCE = "NULL_DEREFERENCE";
public static final String RESOURCE_LEAK = "RESOURCE_LEAK";
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnMallocMemoryLeakThenMemoryLeakIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Using malloc without free should report memory leak",
inferResults,
contains(MEMORY_LEAK, FILE, "malloc_memory_leak_is_reported"));
}
@Test
public void whenInferRunsOnMallocFreeWorksThenMemoryLeakIsNotFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Using malloc with free should not report memory leak",
inferResults,
doesNotContain(MEMORY_LEAK, FILE, "malloc_free_works"));
}
@Test
public void whenInferRunsOnMallocFailGetsReportedThenNullDereferenceIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Not checking malloc result should report null dereference",
inferResults,
contains(NULL_DEREFERENCE, FILE, "malloc_fail_gets_reported"));
}
@Test
public void whenInferRunsOnResourceLeakIsReportedThenResourceLeakIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain resource leak",
inferResults,
contains(RESOURCE_LEAK, FILE, "resource_leak_is_reported"));
}
@Test
public void whenInferRunsFopenFcloseWorksThenResourceLeakIsNotFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should not contain resource leak",
inferResults,
doesNotContain(RESOURCE_LEAK, FILE, "fopen_fclose_works"));
}
@Test
public void whenInferRunsMemcpySpecIsFoundThenDivBy0IsNotFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"when spec for memcpy is found, analysis should fail before div by 0",
inferResults,
doesNotContain(DIVIDE_BY_ZERO, FILE, "memcpy_spec_is_found"));
}
@Test
public void whenInferRunsOnGetcCrashThenNullDereferenceIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Not checking malloc result should report null dereference",
inferResults,
contains(NULL_DEREFERENCE, FILE, "crash_getc"));
}
@Test
public void whenInferRunsOnFgetcCrashThenNullDereferenceIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Not checking malloc result should report null dereference",
inferResults,
contains(NULL_DEREFERENCE, FILE, "crash_fgetc"));
}
}

@ -1,66 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ClassTemplateTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/templates/class_template_instantiate.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0FunctionsErrorIsFound()
throws InterruptedException, IOException, InferException {
String[] procedures = {
"choose1_div0",
"choose2_div0_extra",
"ExecStore<Choose2>_call_div",
};
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by 0 error",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,67 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ConstructorInitTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/constructors/constructor_init.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"f2_div0",
"f_div0",
"t_div0",
"delegate_constr_f_div0",
"delegate_constr_f2_div0",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,73 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ConstructorNewTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/constructors/constructor_new.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"constructor_1_arg_new_div0",
"constructor_3_args_new_div0",
"int_init_number",
"float_init_number",
"int_init_empty",
"int_init_empty_list",
"int_init_empty_list_new",
"int_init_nodes",
"constructor_nodes",
"int_array",
"int_array_init"
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,89 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsErrorInMethod.contains;
import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ConstructorWithBodyTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/constructors/constructor_with_body.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnConstructorWithBodyDiv0ErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"test_div0",
"test_div0_default_constructor",
};
assertThat(
"Results should contain null pointer dereference error",
inferResults,
contains(
DIVIDE_BY_ZERO,
FILE,
"test_div0"
)
);
assertThat(
"Results should contain null pointer dereference error",
inferResults,
contains(
DIVIDE_BY_ZERO,
FILE,
"test_div0_default_constructor"
)
);
}
@Test
public void whenInferRunsOnConstructorWithBodyDiv1ErrorIsNotFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should not contain null pointer dereference error",
inferResults,
doesNotContain(
DIVIDE_BY_ZERO,
FILE,
"test_div1"
)
);
}
}

@ -1,64 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ConversionOperatorTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/methods/conversion_operator.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"branch_div0",
"y_branch_div0",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,67 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class CopyMoveConstructorTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/constructors/copy_move_constructor.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"copyX_div0",
"moveX_div0",
"copyY_div0",
"moveY_div0",
"moveY_moveY_copyY_div0",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,72 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class DeprecatedHackTest {
public static final String SOURCE_FILE =
"infer/tests/codetoanalyze/cpp/frontend/attributes/deprecated_hack.cpp";
public static final String NULL_DEREFERENCE = "NULL_DEREFERENCE";
private static ImmutableList<String> inferCmd;
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, SOURCE_FILE);
}
@Test
public void whenInferRunsOnNullDerefThenNullDereferenceIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferC(inferCmd);
String[] procedures = {
"derefFirstArg_null_deref",
"derefFirstArg2_null_deref",
"derefFirstArg3_null_deref",
"getPtr_null_deref1",
"getPtr_null_deref2",
"operator_star_null_deref1",
"operator_star_null_deref2",
"getRef_null_deref1",
"getRef_null_deref2",
};
assertThat(
"Results should contain divide by zero error",
inferResults,
containsExactly(
NULL_DEREFERENCE,
SOURCE_FILE,
procedures
)
);
}
}

@ -1,63 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class DerefAfterMoveTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/errors/smart_ptr/deref_after_move_example.cpp";
private static ImmutableList<String> inferCmd;
public static final String NULL_DEREFERENCE = "NULL_DEREFERENCE";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOngetPersonAgeNPEIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferC(inferCmd);
String[] procedures = {
"deref_after_move_crash",
};
assertThat(
"Results should contain the expected npe",
inferResults,
containsExactly(
NULL_DEREFERENCE,
FILE,
procedures
)
);
}
}

@ -1,120 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsErrorInMethod.contains;
import static utils.matchers.ResultContainsExactly.containsExactly;
import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class DynamicCastTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
public static final String CLASS_CAST_EXCEPTION = "CLASS_CAST_EXCEPTION";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnWrongCastOfArgumentPointerThenDivideByZeroIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by zero, it shows a wrong cast to pointer to class",
inferResults,
contains(DIVIDE_BY_ZERO, FILE, "wrongCastOfArgumentPointer"));
}
@Test
public void whenInferRunsOnWrongPointerCastThenDivideByZeroIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by zero, it shows a wrong cast to pointer to class",
inferResults,
contains(DIVIDE_BY_ZERO, FILE, "wrongPointerCast"));
}
@Test
public void whenInferRunsOnRightPointerCastThenDivideByZeroIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by zero, it shows a correct cast to pointer to class",
inferResults,
contains(DIVIDE_BY_ZERO, FILE, "rightPointerCast"));
}
@Test
public void whenInferRunsOnRightReferenceCastThenClassCastExceptionIsNotFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should not contain class cast exception",
inferResults,
doesNotContain(CLASS_CAST_EXCEPTION, FILE, "rightReferenceCast"));
}
@Test
public void whenInferRunsOnWrongReferenceCastThenClassCastExceptionIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain class cast exception",
inferResults,
contains(CLASS_CAST_EXCEPTION, FILE, "wrongReferenceCast"));
}
@Test
public void whenInferRunsOnWrongReferenceCastNotAssignedThenClassCastExceptionIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain class cast exception",
inferResults,
contains(CLASS_CAST_EXCEPTION, FILE, "wrongReferenceCastNotAssigned"));
}
@Test
public void whenInferRunsOnWrongCastOfArgumentReferenceThenClassCastExceptionIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain class cast exception",
inferResults,
contains(CLASS_CAST_EXCEPTION, FILE, "wrongCastOfArgumentReference"));
}
}

@ -1,61 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class ExceptionsTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/exceptions/Exceptions.cpp";
private static ImmutableList<String> inferCmd;
public static final String NULL_DEREFERENCE = "NULL_DEREFERENCE";
@ClassRule
public static DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0FunctionsErrorIsFound()
throws InterruptedException, IOException, InferException {
String[] procedures = { "call_deref_with_null" };
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should not contain " + NULL_DEREFERENCE,
inferResults,
containsExactly(
NULL_DEREFERENCE,
FILE,
procedures
)
);
}
}

@ -1,62 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class FallthroughTest {
public static final String SOURCE_FILE =
"infer/tests/codetoanalyze/cpp/frontend/attributes/clang_fallthrough.cpp";
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
private static ImmutableList<String> inferCmd;
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, SOURCE_FILE);
}
@Test
public void whenInferRunsOnDivideByZeroThenDivideByZeroIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferC(inferCmd);
String[] procedures = {"test_fallthrough"};
assertThat(
"Results should contain divide by zero error",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
SOURCE_FILE,
procedures
)
);
}
}

@ -1,66 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class FunctionTemplateTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/templates/function.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0FunctionsErrorIsFound()
throws InterruptedException, IOException, InferException {
String[] procedures = {
"div0_get_val",
"div0_create_and_get_val",
"createAndDiv<X3>",
};
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
assertThat(
"Results should contain divide by 0 error",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

@ -1,66 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class IncludeHeaderNoTemplTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/include_header/include_only.cpp";
public static final String HEADER =
"infer/tests/codetoanalyze/cpp/frontend/include_header/header.h";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommandIncludeHeaders(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"A_div0",
"div0_fun",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
HEADER,
procedures
)
);
}
}

@ -1,70 +0,0 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class IncludeHeaderTemplTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/include_header/include_templ.cpp";
public static final String HEADER =
"infer/tests/codetoanalyze/cpp/frontend/include_header/header.h";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommandIncludeHeaders(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"A_div0",
"B<int>_div0",
"B<A>_div0",
"div0_fun",
"div0_templ<int>",
"div0_templ<A>",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
HEADER,
procedures
)
);
}
}

@ -1,69 +0,0 @@
/*
* Copyright (c) 2015 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package endtoend.cpp.infer;
import static org.hamcrest.MatcherAssert.assertThat;
import static utils.matchers.ResultContainsExactly.containsExactly;
import com.google.common.collect.ImmutableList;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import java.io.IOException;
import utils.DebuggableTemporaryFolder;
import utils.InferException;
import utils.InferResults;
import utils.InferRunner;
public class InheritanceFieldTest {
public static final String FILE =
"infer/tests/codetoanalyze/cpp/frontend/types/inheritance_field.cpp";
private static ImmutableList<String> inferCmd;
public static final String DIVIDE_BY_ZERO = "DIVIDE_BY_ZERO";
@ClassRule
public static DebuggableTemporaryFolder folder =
new DebuggableTemporaryFolder();
@BeforeClass
public static void runInfer() throws InterruptedException, IOException {
inferCmd = InferRunner.createCPPInferCommand(folder, FILE);
}
@Test
public void whenInferRunsOnDiv0MethodsErrorIsFound()
throws InterruptedException, IOException, InferException {
InferResults inferResults = InferRunner.runInferCPP(inferCmd);
String[] procedures = {
"div0_b1",
"div0_b2",
"div0_s",
"div0_cast",
"div0_cast_ref",
"div0_b1_s",
"div0_s_b1",
};
assertThat(
"Results should contain the expected divide by zero",
inferResults,
containsExactly(
DIVIDE_BY_ZERO,
FILE,
procedures
)
);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save