blob: 2cd6d3986fcc12ad92ab05aa001c3dfbbcbdd902 [file] [log] [blame]
Alexey Bataev3e812462019-04-16 14:26:10 +00001// REQUIRES: aarch64-registered-target
Alexey Bataeva0a22642019-04-16 13:56:21 +00002// -fopemp and -fopenmp-simd behavior are expected to be the same.
3
4// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +neon -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=ADVSIMD
5// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +sve -fopenmp -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=SVE
6
7// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +neon -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=ADVSIMD
8// RUN: %clang_cc1 -verify -triple aarch64-linux-gnu -target-feature +sve -fopenmp-simd -x c++ -emit-llvm %s -o - -femit-all-decls -verify| FileCheck %s --check-prefix=SVE
9
10// expected-no-diagnostics
11
12#pragma omp declare simd
13double f(double x);
14
15#pragma omp declare simd
16float f(float x);
17
18void aaa(double *x, double *y, int N) {
19 for (int i = 0; i < N; ++i) {
20 x[i] = f(y[i]);
21 }
22}
23
24void aaa(float *x, float *y, int N) {
25 for (int i = 0; i < N; ++i) {
26 x[i] = f(y[i]);
27 }
28}
29
30// ADVSIMD: "_ZGVnN2v__Z1fd"
31// ADVSIMD-NOT: _Z1fd
32// ADVSIMD: "_ZGVnN4v__Z1ff"
33// ADVSIMD-NOT: _Z1fF
34
35// SVE: "_ZGVsMxv__Z1fd"
36// SVE-NOT: _Z1fd
37// SVE: "_ZGVsMxv__Z1ff"
38// SVE-NOT: _Z1ff