blob: 87e39e524ba651fdc62dbb00bdf85b10675ea7ae [file] [log] [blame]
Alexey Bataev3e812462019-04-16 14:26:10 +00001// REQUIRES: aarch64-registered-target
Alexey Bataeva0a22642019-04-16 13:56:21 +00002// 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:
20void 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:
27void 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:
34void 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}