xref: /llvm-project/clang/test/Frontend/optimization-remark-options.c (revision 8a0925cb627ce1a7a321acae96e95143046e6c63)
1 // RUN: %clang -O1 -fvectorize -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s
2 
3 // 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’
4 
5 double 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 }
13