Skip to content

Commit 1f6b395

Browse files
committed
Fixups
1 parent cb9857a commit 1f6b395

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

clang/test/CodeGenCXX/aarch64-sve-vector-init-typedef.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

clang/test/CodeGenCXX/aarch64-sve-vector-init.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 2
22
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve -emit-llvm -o - %s | FileCheck %s
33

4+
#include <arm_sve.h>
5+
46
// CHECK-LABEL: define dso_local void @_Z11test_localsv
57
// CHECK-SAME: () #[[ATTR0:[0-9]+]] {
68
// CHECK-NEXT: entry:
@@ -1212,3 +1214,22 @@ void test_copy_mf8x3(__clang_svmfloat8x3_t a) {
12121214
void test_copy_mf8x4(__clang_svmfloat8x4_t a) {
12131215
__clang_svmfloat8x4_t b{a};
12141216
}
1217+
1218+
using vec_t = svint8_t;
1219+
1220+
/// From: https://github.com/llvm/llvm-project/issues/107609
1221+
/// The type of `vec` is a typedef of svint8_t, while svdup_s8 returns the non-typedef'd type.
1222+
1223+
// CHECK-LABEL: define dso_local <vscale x 16 x i8> @_Z20sve_init_dup_typedefv
1224+
// CHECK-SAME: () #[[ATTR0:[0-9]+]] {
1225+
// CHECK-NEXT: entry:
1226+
// CHECK-NEXT: [[VEC:%.*]] = alloca <vscale x 16 x i8>, align 16
1227+
// CHECK-NEXT: [[TMP0:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 2)
1228+
// CHECK-NEXT: store <vscale x 16 x i8> [[TMP0]], ptr [[VEC]], align 16
1229+
// CHECK-NEXT: [[TMP1:%.*]] = load <vscale x 16 x i8>, ptr [[VEC]], align 16
1230+
// CHECK-NEXT: ret <vscale x 16 x i8> [[TMP1]]
1231+
//
1232+
vec_t sve_init_dup_typedef() {
1233+
vec_t vec{svdup_s8(2)};
1234+
return vec;
1235+
}

0 commit comments

Comments
 (0)