================
@@ -0,0 +1,34 @@
+// RUN: cir-opt %s -cir-idiom-recognizer | FileCheck %s
+
+// The pass reads only the tag on the callee, so recognition also works on
+// parsed CIR assembly with no AST behind it.
+
+!s32i = !cir.int<s, 32>
+
+module {
+
+cir.func private @_ZSt4findIPiiET_S1_S1_RKT0_(!cir.ptr<!s32i>, 
!cir.ptr<!s32i>, !cir.ptr<!s32i>) -> !cir.ptr<!s32i> 
func_info<#cir.func_identity<std_find>>
+
+cir.func @caller(%a: !cir.ptr<!s32i>, %b: !cir.ptr<!s32i>, %v: 
!cir.ptr<!s32i>) -> !cir.ptr<!s32i> {
+  %r = cir.call @_ZSt4findIPiiET_S1_S1_RKT0_(%a, %b, %v) : (!cir.ptr<!s32i>, 
!cir.ptr<!s32i>, !cir.ptr<!s32i>) -> !cir.ptr<!s32i>
+  cir.return %r : !cir.ptr<!s32i>
+}
+// CHECK: cir.std.find(%{{.*}}, %{{.*}}, %{{.*}}, @_ZSt4findIPiiET_S1_S1_RKT0_)
----------------
SharmaRithik wrote:

Not as written, %a %b %v reprint as %arg0 and carry inline types. I captured 
the block args and reused them to assert the order instead.

https://github.com/llvm/llvm-project/pull/208854
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to