================
@@ -0,0 +1,86 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o
%t.cir
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o
%t-cir.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
+// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s
+
+// A three-element vector is classified at its width rounded up to a power of
+// two.
+
+// CIRGen cannot yet load or store a three-element vector, so plain vectors
+// only flow from a call result into a return or another call.
+
+typedef char c3 __attribute__((ext_vector_type(3)));
+typedef short s3 __attribute__((ext_vector_type(3)));
+typedef float f3 __attribute__((ext_vector_type(3)));
+typedef double d3 __attribute__((ext_vector_type(3)));
+
+c3 src_c3(void);
+void sink_c3(c3);
+s3 src_s3(void);
+void sink_s3(s3);
+f3 src_f3(void);
+void sink_f3(f3);
+
+// Three chars take 4 bytes.
+c3 fwd_c3(void) { return src_c3(); }
+
+// CIR: cir.func {{.*}}@fwd_c3() -> !{{[su]}}32i
----------------
skc7 wrote:
Thanks for the review. Checked that classifier always builds `!u32i` here.
Updated the check.
https://github.com/llvm/llvm-project/pull/230087
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits