@@ -105,7 +105,7 @@ macro(add_libclc_builtin_set arch_suffix)
105
105
install (
106
106
FILES ${LIBCLC_LIBRARY_OUTPUT_INTDIR} /${obj_suffix}
107
107
DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
108
-
108
+
109
109
# Generate remangled variants if requested
110
110
if ( LIBCLC_GENERATE_REMANGLED_VARIANTS )
111
111
set (dummy_in "${CMAKE_BINARY_DIR} /lib/clc/libclc_dummy_in.cc" )
@@ -149,6 +149,29 @@ macro(add_libclc_builtin_set arch_suffix)
149
149
DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
150
150
endforeach ()
151
151
endforeach ()
152
+
153
+ # For remangler tests we do not care about long_width, or signedness, as it
154
+ # performs no substitutions.
155
+ # Collect all remangler tests in libclc-remangler-tests to later add
156
+ # dependency against check-libclc.
157
+ set (libclc-remangler-tests )
158
+ set (libclc-remangler-test-no 0 )
159
+ set (libclc-remangler-target-ir
160
+ "$<TARGET_PROPERTY:opt.${obj_suffix} ,TARGET_FILE>"
161
+ "${LIBCLC_LIBRARY_OUTPUT_INTDIR} /builtins.link.${obj_suffix} "
162
+ "$<TARGET_PROPERTY:prepare-${obj_suffix} ,TARGET_FILE>" )
163
+ foreach (target -ir ${libclc-remangler-target-ir} )
164
+ math (EXPR libclc-remangler-test-no "${libclc-remangler-test-no}+1" )
165
+ set (current-test "libclc-remangler-test-${obj_suffix} -${libclc-remangler-test-no}" )
166
+ add_custom_target (${current-test}
167
+ COMMAND libclc-remangler
168
+ --long-width=l32
169
+ --char-signedness=signed
170
+ --input-ir=${target-ir}
171
+ ${dummy_in} -t -o -
172
+ DEPENDS "${builtins_obj_path} " "prepare-${obj_suffix} " "${dummy_in} " libclc-remangler )
173
+ list (APPEND libclc-remangler-tests ${current-test} )
174
+ endforeach ()
152
175
endif ()
153
176
154
177
# nvptx-- targets don't include workitem builtins
0 commit comments