1# Copyright (c) 2019 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15if (${SPIRV_BUILD_FUZZER}) 16 17 set(SOURCES 18 fuzz_test_util.h 19 20 call_graph_test.cpp 21 comparator_deep_blocks_first_test.cpp 22 data_synonym_transformation_test.cpp 23 equivalence_relation_test.cpp 24 fact_manager/constant_uniform_facts_test.cpp 25 fact_manager/data_synonym_and_id_equation_facts_test.cpp 26 fact_manager/dead_block_facts_test.cpp 27 fact_manager/irrelevant_value_facts_test.cpp 28 fuzz_test_util.cpp 29 fuzzer_pass_add_opphi_synonyms_test.cpp 30 fuzzer_pass_construct_composites_test.cpp 31 fuzzer_pass_donate_modules_test.cpp 32 fuzzer_pass_outline_functions_test.cpp 33 instruction_descriptor_test.cpp 34 fuzzer_pass_test.cpp 35 replayer_test.cpp 36 shrinker_test.cpp 37 transformation_access_chain_test.cpp 38 transformation_add_bit_instruction_synonym_test.cpp 39 transformation_add_constant_boolean_test.cpp 40 transformation_add_constant_composite_test.cpp 41 transformation_add_constant_null_test.cpp 42 transformation_add_constant_scalar_test.cpp 43 transformation_add_copy_memory_test.cpp 44 transformation_add_dead_block_test.cpp 45 transformation_add_dead_break_test.cpp 46 transformation_add_dead_continue_test.cpp 47 transformation_add_early_terminator_wrapper_test.cpp 48 transformation_add_function_test.cpp 49 transformation_add_global_undef_test.cpp 50 transformation_add_global_variable_test.cpp 51 transformation_add_image_sample_unused_components_test.cpp 52 transformation_add_local_variable_test.cpp 53 transformation_add_loop_preheader_test.cpp 54 transformation_add_loop_to_create_int_constant_synonym_test.cpp 55 transformation_add_no_contraction_decoration_test.cpp 56 transformation_add_opphi_synonym_test.cpp 57 transformation_add_parameter_test.cpp 58 transformation_add_relaxed_decoration_test.cpp 59 transformation_add_synonym_test.cpp 60 transformation_add_type_array_test.cpp 61 transformation_add_type_boolean_test.cpp 62 transformation_add_type_float_test.cpp 63 transformation_add_type_function_test.cpp 64 transformation_add_type_int_test.cpp 65 transformation_add_type_matrix_test.cpp 66 transformation_add_type_pointer_test.cpp 67 transformation_add_type_struct_test.cpp 68 transformation_add_type_vector_test.cpp 69 transformation_adjust_branch_weights_test.cpp 70 transformation_composite_construct_test.cpp 71 transformation_composite_extract_test.cpp 72 transformation_composite_insert_test.cpp 73 transformation_compute_data_synonym_fact_closure_test.cpp 74 transformation_duplicate_region_with_selection_test.cpp 75 transformation_equation_instruction_test.cpp 76 transformation_expand_vector_reduction_test.cpp 77 transformation_flatten_conditional_branch_test.cpp 78 transformation_function_call_test.cpp 79 transformation_inline_function_test.cpp 80 transformation_invert_comparison_operator_test.cpp 81 transformation_load_test.cpp 82 transformation_make_vector_operation_dynamic_test.cpp 83 transformation_merge_blocks_test.cpp 84 transformation_merge_function_returns_test.cpp 85 transformation_move_block_down_test.cpp 86 transformation_move_instruction_down_test.cpp 87 transformation_mutate_pointer_test.cpp 88 transformation_outline_function_test.cpp 89 transformation_permute_function_parameters_test.cpp 90 transformation_permute_phi_operands_test.cpp 91 transformation_propagate_instruction_down_test.cpp 92 transformation_propagate_instruction_up_test.cpp 93 transformation_push_id_through_variable_test.cpp 94 transformation_replace_add_sub_mul_with_carrying_extended_test.cpp 95 transformation_replace_boolean_constant_with_constant_binary_test.cpp 96 transformation_replace_branch_from_dead_block_with_exit_test.cpp 97 transformation_replace_copy_object_with_store_load_test.cpp 98 transformation_replace_constant_with_uniform_test.cpp 99 transformation_replace_copy_memory_with_load_store_test.cpp 100 transformation_replace_id_with_synonym_test.cpp 101 transformation_replace_irrelevant_id_test.cpp 102 transformation_replace_linear_algebra_instruction_test.cpp 103 transformation_replace_load_store_with_copy_memory_test.cpp 104 transformation_replace_opphi_id_from_dead_predecessor_test.cpp 105 transformation_replace_opselect_with_conditional_branch_test.cpp 106 transformation_replace_parameter_with_global_test.cpp 107 transformation_replace_params_with_struct_test.cpp 108 transformation_set_function_control_test.cpp 109 transformation_set_loop_control_test.cpp 110 transformation_set_memory_operands_mask_test.cpp 111 transformation_set_selection_control_test.cpp 112 transformation_split_block_test.cpp 113 transformation_store_test.cpp 114 transformation_swap_commutable_operands_test.cpp 115 transformation_swap_conditional_branch_operands_test.cpp 116 transformation_toggle_access_chain_instruction_test.cpp 117 transformation_record_synonymous_constants_test.cpp 118 transformation_vector_shuffle_test.cpp 119 transformation_wrap_early_terminator_in_function_test.cpp 120 transformation_wrap_region_in_selection_test.cpp 121 uniform_buffer_element_descriptor_test.cpp) 122 123 if (${SPIRV_ENABLE_LONG_FUZZER_TESTS}) 124 # These are long-running tests that depend on random seeds. We do not want 125 # to run them during regular whole-project CI because they may reveal 126 # spirv-fuzz bugs in changes that are totally unrelated to spirv-fuzz, 127 # which would be counfounding. Instead, they should be run regularly but 128 # separately. 129 set(SOURCES ${SOURCES} 130 fuzzer_replayer_test.cpp 131 fuzzer_shrinker_test.cpp) 132 endif() 133 134 add_spvtools_unittest(TARGET fuzz 135 SRCS ${SOURCES} 136 LIBS SPIRV-Tools-fuzz 137 ) 138endif() 139