[clang] [CIR] Avoid duplicate ABI result extension attributes (PR #237558)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 6 21:48:38 PST 2026
================
@@ -0,0 +1,68 @@
+
+// RUN: cir-opt %s -cir-call-conv-lowering="classification-attr=test_classify" \
+// RUN: | FileCheck %s
+
+!s8i = !cir.int<s, 8>
+!u8i = !cir.int<u, 8>
+
+#extend_signed_return = {
+ return = { kind = "extend",
+ coerced_type = !cir.int<s, 32>,
+ sign_extend = true },
+ args = [ ]
+}
+
+#extend_unsigned_return = {
+ return = { kind = "extend",
+ coerced_type = !cir.int<u, 32>,
+ sign_extend = false },
+ args = [ ]
+}
+
+module attributes {
+ dlti.dl_spec = #dlti.dl_spec<
+ #dlti.dl_entry<i8, dense<8>: vector<2xi64>>,
+ #dlti.dl_entry<i32, dense<32>: vector<2xi64>>>
+} {
+ // An existing zeroext must be replaced with signext.
+ cir.func @returns_s8() -> (!s8i {llvm.zeroext})
----------------
Siya-05 wrote:
Just to clarify, should verification reject only the presence of both llvm.signext and llvm.zeroext, or also an extension attribute that disagrees with the CIR integer type's signedness? The existing test exercises the latter case.
https://github.com/llvm/llvm-project/pull/237558
More information about the cfe-commits
mailing list