[llvm] [PtrAuth] Add ConstantPtrAuth comparator to FunctionComparator.cpp (PR #159480)
    Anatoly Trosinenko via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Oct 22 05:21:31 PDT 2025
    
    
  
================
----------------
atrosinenko wrote:
[nit] It may be worth adding a comment that different callees are required to prevent unintended merging of unrelated functions like `@g_ptr_baz` and `@f_key0` (if I got it right). Or maybe just add an integer parameter that can be different in unrelated pairs of test functions. Or, assuming the functions cannot be partially merged, just return different integer values from the test function. I guess the latter approach would be the most error-proof, as it should be much easier to spot if the two functions consisting a single negative test case accidentally differ:
What would misspelled callee name look like now:
```llvm
define void @f_addr_null() {
entry:
  call void @callee1(ptr ptrauth (ptr @baz, i32 0))
  ret void
}
define void @g_addr_ADDR() {
entry:
  call void @callee2(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
  ret void
}
```
Misspelled integer argument:
```llvm
define void @f_addr_null() {
entry:
  call void @callee(i32 1, ptr ptrauth (ptr @baz, i32 0))
  ret void
}
define void @g_addr_ADDR() {
entry:
  call void @callee(i32 2, ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
  ret void
}
```
Misspelled return value:
```llvm
define i32 @f_addr_null() {
entry:
  call void @callee(ptr ptrauth (ptr @baz, i32 0))
  ret i32 1
}
define i32 @g_addr_ADDR() {
entry:
  call void @callee(ptr ptrauth (ptr @baz, i32 0, i64 0, ptr @ADDR))
  ret i32 2
}
```
(Feel free to ignore)
https://github.com/llvm/llvm-project/pull/159480
    
    
More information about the llvm-commits
mailing list