Alexey Bataev | 3e81246 | 2019-04-16 14:26:10 +0000 | [diff] [blame] | 1 | // REQUIRES: aarch64-registered-target |
Alexey Bataev | a0a2264 | 2019-04-16 13:56:21 +0000 | [diff] [blame] | 2 | // This test is making sure that no crash happens. |
| 3 | |
| 4 | // RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ |
| 5 | // RUN: -fopenmp -O3 -march=armv8-a -c %s | FileCheck %s |
| 6 | |
| 7 | // RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ |
| 8 | // RUN: -fopenmp-simd -O3 -march=armv8-a -c %s | FileCheck %s |
| 9 | |
| 10 | // RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ |
| 11 | // RUN: -fopenmp -O3 -march=armv8-a+sve -c %s | FileCheck %s |
| 12 | |
| 13 | // RUN: %clang -o - -fno-fast-math -S -target aarch64-linux-gnu \ |
| 14 | // RUN: -fopenmp-simd -O3 -march=armv8-a+sve -c %s | FileCheck %s |
| 15 | |
| 16 | // loop in the user code, in user_code.c |
| 17 | #include "Inputs/declare-simd-fix.h" |
| 18 | |
| 19 | // CHECK-LABEL: do_something: |
| 20 | void do_something(int *a, double *b, unsigned N) { |
| 21 | for (unsigned i = 0; i < N; ++i) { |
| 22 | a[i] = foo(b[0], b[0], 1); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // CHECK-LABEL: do_something_else: |
| 27 | void do_something_else(int *a, double *b, unsigned N) { |
| 28 | for (unsigned i = 0; i < N; ++i) { |
| 29 | a[i] = foo(1.1, 1.2, 1); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // CHECK-LABEL: do_something_more: |
| 34 | void do_something_more(int *a, double *b, unsigned N) { |
| 35 | for (unsigned i = 0; i < N; ++i) { |
| 36 | a[i] = foo(b[i], b[i], a[1]); |
| 37 | } |
| 38 | } |