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