1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -O2 -S -o - %s -msve-vector-bits=256  | FileCheck %s --check-prefixes=CHECK,CHECK256
2 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -O2 -S -o - %s -msve-vector-bits=512  | FileCheck %s --check-prefixes=CHECK,CHECK512
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -O2 -S -o - %s -msve-vector-bits=1024 | FileCheck %s --check-prefixes=CHECK,CHECK1024
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -O2 -S -o - %s -msve-vector-bits=2048 | FileCheck %s --check-prefixes=CHECK,CHECK2048
5 // REQUIRES: aarch64-registered-target
6 
7 #include <arm_sve.h>
8 
9 void func(int *restrict a, int *restrict b) {
10 // CHECK-LABEL: func
11 // CHECK256-COUNT-8: st1w
12 // CHECK512-COUNT-4: st1w
13 // CHECK1024-COUNT-2: st1w
14 // CHECK2048-COUNT-1: st1w
15 #pragma clang loop vectorize(enable)
16   for (int i = 0; i < 64; ++i)
17     a[i] += b[i];
18 }
19