Skip to content

Commit 08a155b

Browse files
[fixiup] Add a test using compound assignment operator
Change-Id: I81e1fd4f23eb65a96e71015de7a4562fcbc53c0f
1 parent b1b69ff commit 08a155b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

clang/test/CodeGen/aarch64-sve-vector-subscript-ops.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,15 @@ svfloat32_t subscript_write_float32(svfloat32_t a, size_t b) {
9898
a[b] = 1.0f;
9999
return a;
100100
}
101+
102+
// CHECK-LABEL: @subscript_read_write_float32(
103+
// CHECK-NEXT: entry:
104+
// CHECK-NEXT: [[VECEXT:%.*]] = extractelement <vscale x 4 x float> [[A:%.*]], i64 [[B:%.*]]
105+
// CHECK-NEXT: [[ADD:%.*]] = fadd float [[VECEXT]], 1.000000e+00
106+
// CHECK-NEXT: [[VECINS:%.*]] = insertelement <vscale x 4 x float> [[A]], float [[ADD]], i64 [[B]]
107+
// CHECK-NEXT: ret <vscale x 4 x float> [[VECINS]]
108+
//
109+
svfloat32_t subscript_read_write_float32(svfloat32_t a, size_t b) {
110+
a[b] += 1.0f;
111+
return a;
112+
}

0 commit comments

Comments
 (0)