My goal is to move over the hand-written RISC-V ABI tests to using update_cc_test_checks. A blocker on doing so is that --function-signature option doesn't generate checks of the function return type. This patch aims to rectify that. I have updated the behaviour of update_cc_test_checks whenever --function-signature is passed, but of course another option would be to add another flag so as not to perturb in-tree tests.
I've additionally found that merging of CHECK lines with identical outputs doesn't seem to work when using --filter to show only the function definition unless at least one line of the body is included (this is a separate issue, to be resolved in a separate patch). With this patch, you can do something like ./llvm/utils/update_cc_test_checks.py --function-signature --filter '^define |^entry:' --clang=build/default/bin/clang clang/test/CodeGen/RISCV/riscv-abi.cpp and it generates check lines in that file like the following (replacing manually written with auto generated lines):
-// ILP32-ILP32F-ILP32D-LABEL: define{{.*}} [2 x i32] @_Z30int32_int32_struct_inheritance14child1_int32_s([2 x i32] %a.coerce) -// LP64-LP64F-LP64D-LABEL: define{{.*}} i64 @_Z30int32_int32_struct_inheritance14child1_int32_s(i64 %a.coerce) +// ILP32-ILP32F-ILP32D-LABEL: define dso_local [2 x i32] @_Z30int32_int32_struct_inheritance14child1_int32_s +// ILP32-ILP32F-ILP32D-SAME: ([2 x i32] [[A_COERCE:%.*]]) #[[ATTR0:[0-9]+]] { +// ILP32-ILP32F-ILP32D: entry: +// +// LP64-LP64F-LP64D-LABEL: define dso_local i64 @_Z30int32_int32_struct_inheritance14child1_int32_s +// LP64-LP64F-LP64D-SAME: (i64 [[A_COERCE:%.*]]) #[[ATTR0:[0-9]+]] { +// LP64-LP64F-LP64D: entry: +//
How about 'funcdef'? I initially read this as being related to 'undef'.