| 1 |
// RUN: %clang_cc1 -fveclib=Darwin_libsystem_m -triple arm64-apple-darwin %s -target-cpu apple-a7 -vectorize-loops -emit-llvm -O3 -o - | FileCheck %s |
| 2 |
|
| 3 |
// REQUIRES: aarch64-registered-target |
| 4 |
|
| 5 |
// Make sure -fveclib=Darwin_libsystem_m gets passed through to LLVM as |
| 6 |
// expected: a call to _simd_sin_f4 should be generated. |
| 7 |
|
| 8 |
extern float sinf(float); |
| 9 |
|
| 10 |
// CHECK-LABEL: define{{.*}}@apply_sin |
| 11 |
// CHECK: call <4 x float> @_simd_sin_f4( |
| 12 |
// |
| 13 |
void apply_sin(float *A, float *B, float *C, unsigned N) { |
| 14 |
for (unsigned i = 0; i < N; i++) |
| 15 |
C[i] = sinf(A[i]) + sinf(B[i]); |
| 16 |
} |