[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / declare_simd_aarch64_sve.c
blob82f85c413ba6b73d17962e126f83f969e1ec9fcf
1 // REQUIRES: aarch64-registered-target
2 // -fopemp and -fopenmp-simd behavior are expected to be the same
4 // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \
5 // RUN: -fopenmp -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s
7 // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +sve \
8 // RUN: -fopenmp-simd -x c -emit-llvm %s -o - -femit-all-decls | FileCheck %s
10 #pragma omp declare simd
11 #pragma omp declare simd notinbranch
12 #pragma omp declare simd simdlen(2)
13 #pragma omp declare simd simdlen(4)
14 #pragma omp declare simd simdlen(5) // not a multiple of 128-bits
15 #pragma omp declare simd simdlen(6)
16 #pragma omp declare simd simdlen(8)
17 #pragma omp declare simd simdlen(32)
18 #pragma omp declare simd simdlen(34) // requires more than 2048 bits
19 double foo(float x);
21 // CHECK-DAG: "_ZGVsM2v_foo" "_ZGVsM32v_foo" "_ZGVsM4v_foo" "_ZGVsM6v_foo" "_ZGVsM8v_foo" "_ZGVsMxv_foo"
22 // CHECK-NOT: _ZGVsN
23 // CHECK-NOT: _ZGVsM5v_foo
24 // CHECK-NOT: _ZGVsM34v_foo
25 // CHECK-NOT: foo
27 void foo_loop(double *x, float *y, int N) {
28 for (int i = 0; i < N; ++i) {
29 x[i] = foo(y[i]);
33 // test integers
35 #pragma omp declare simd notinbranch
36 char a01_fun(int x);
37 // CHECK-DAG: _ZGVsMxv_a01_fun
38 // CHECK-NOT: a01_fun
40 static int *in;
41 static char *out;
42 void do_something() {
43 *out = a01_fun(*in);