[llvm] dd86ece - [MergeFunc] Check full IR and comdat keys in comdat.ll.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 10 04:11:19 PDT 2025


Author: Florian Hahn
Date: 2025-03-10T11:11:03Z
New Revision: dd86ece554a42c6a7663a18b779442e8380e4ef8

URL: https://github.com/llvm/llvm-project/commit/dd86ece554a42c6a7663a18b779442e8380e4ef8
DIFF: https://github.com/llvm/llvm-project/commit/dd86ece554a42c6a7663a18b779442e8380e4ef8.diff

LOG: [MergeFunc] Check full IR and comdat keys in comdat.ll.

Added: 
    

Modified: 
    llvm/test/Transforms/MergeFunc/comdat.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/MergeFunc/comdat.ll b/llvm/test/Transforms/MergeFunc/comdat.ll
index 3770c772b3f88..007edaf7b36d2 100644
--- a/llvm/test/Transforms/MergeFunc/comdat.ll
+++ b/llvm/test/Transforms/MergeFunc/comdat.ll
@@ -19,7 +19,28 @@ define linkonce_odr hidden i32 @g(i32 %x, i32 %y) comdat {
   ret i32 %sum3
 }
 
-; CHECK-DAG: define private i32 @0(i32 %x, i32 %y) comdat($f)
-; CHECK-DAG: define linkonce_odr hidden i32 @g(i32 %0, i32 %1) comdat {
-; CHECK-DAG: define linkonce_odr hidden i32 @f(i32 %0, i32 %1) {
+; CHECK: $f = comdat any
+; CHECK: $g = comdat any
 
+;.
+; CHECK: @symbols = linkonce_odr global <{ ptr, ptr }> <{ ptr @f, ptr @g }>
+;.
+; CHECK-LABEL: define private i32 @0(
+; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) comdat($f) {
+; CHECK-NEXT:    [[SUM:%.*]] = add i32 [[X]], [[Y]]
+; CHECK-NEXT:    [[SUM2:%.*]] = add i32 [[X]], [[SUM]]
+; CHECK-NEXT:    [[SUM3:%.*]] = add i32 [[X]], [[SUM]]
+; CHECK-NEXT:    ret i32 [[SUM3]]
+;
+;
+; CHECK-LABEL: define linkonce_odr hidden i32 @g(
+; CHECK-SAME: i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) comdat {
+; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @[[GLOB0:[0-9]+]](i32 [[TMP0]], i32 [[TMP1]])
+; CHECK-NEXT:    ret i32 [[TMP3]]
+;
+;
+; CHECK-LABEL: define linkonce_odr hidden i32 @f(
+; CHECK-SAME: i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) {
+; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @[[GLOB0]](i32 [[TMP0]], i32 [[TMP1]])
+; CHECK-NEXT:    ret i32 [[TMP3]]
+;


        


More information about the llvm-commits mailing list