blob: 2b22099c100ed29b87a1e4f37dabf844c4462375 [file] [log] [blame]
Tyler Nowicki8a0925c2015-08-10 19:56:40 +00001// RUN: %clang -O1 -fvectorize -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s
2
Tyler Nowicki40e5d082015-08-10 21:18:01 +00003// CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow commutativity by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'
Tyler Nowicki8a0925c2015-08-10 19:56:40 +00004
5double foo(int N) {
6 double v = 0.0;
7
8 for (int i = 0; i < N; i++)
9 v = v + 1.0;
10
11 return v;
12}