// RUN: cir-opt %s -cir-call-conv-lowering="classification-attr=test_classify" \ // RUN: | FileCheck %s // Same passthrough behavior as direct-passthrough-test-target.cir, but the // classification is injected via a function attribute rather than computed // by the test target. This is the driver mode that lets tests verify // rewriter behavior against arbitrary classifications without depending on // any real ABI target. !s32i = !cir.int !s64i = !cir.int #all_direct_two_args = { return = { kind = "direct" }, args = [ { kind = "direct" }, { kind = "direct" } ] } module attributes { dlti.dl_spec = #dlti.dl_spec< #dlti.dl_entry: vector<2xi64>>, #dlti.dl_entry: vector<2xi64>>> } { cir.func @passthrough(%arg0: !s32i, %arg1: !s64i) -> !s32i attributes { test_classify = #all_direct_two_args } { cir.return %arg0 : !s32i } // CHECK: cir.func{{.*}} @passthrough(%arg0: !s32i, %arg1: !s64i) -> !s32i // CHECK: cir.return %arg0 : !s32i cir.func @caller(%arg0: !s32i, %arg1: !s64i) -> !s32i attributes { test_classify = #all_direct_two_args } { %0 = cir.call @passthrough(%arg0, %arg1) : (!s32i, !s64i) -> !s32i cir.return %0 : !s32i } // CHECK: cir.func{{.*}} @caller(%arg0: !s32i, %arg1: !s64i) -> !s32i // CHECK: %[[RES:.*]] = cir.call @passthrough(%arg0, %arg1) : (!s32i, !s64i) -> !s32i // CHECK: cir.return %[[RES]] : !s32i }