Alexey Bataev | a0a2264 | 2019-04-16 13:56:21 +0000 | [diff] [blame^] | 1 | // -fopemp and -fopenmp-simd behavior are expected to be the same. |
| 2 | |
| 3 | // 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 |
| 4 | // 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 |
| 5 | |
| 6 | // 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 |
| 7 | // 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 |
| 8 | |
| 9 | // expected-no-diagnostics |
| 10 | |
| 11 | #pragma omp declare simd |
| 12 | double f(double x); |
| 13 | |
| 14 | #pragma omp declare simd |
| 15 | float f(float x); |
| 16 | |
| 17 | void aaa(double *x, double *y, int N) { |
| 18 | for (int i = 0; i < N; ++i) { |
| 19 | x[i] = f(y[i]); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | void aaa(float *x, float *y, int N) { |
| 24 | for (int i = 0; i < N; ++i) { |
| 25 | x[i] = f(y[i]); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | // ADVSIMD: "_ZGVnN2v__Z1fd" |
| 30 | // ADVSIMD-NOT: _Z1fd |
| 31 | // ADVSIMD: "_ZGVnN4v__Z1ff" |
| 32 | // ADVSIMD-NOT: _Z1fF |
| 33 | |
| 34 | // SVE: "_ZGVsMxv__Z1fd" |
| 35 | // SVE-NOT: _Z1fd |
| 36 | // SVE: "_ZGVsMxv__Z1ff" |
| 37 | // SVE-NOT: _Z1ff |