Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-early-break_88.c

raw
1 /* { dg-add-options vect_early_break } */
2 /* { dg-require-effective-target vect_early_break_hw } */
3 /* { dg-require-effective-target vect_int } */
4
5 /* { dg-additional-options "-Ofast --param vect-partial-vector-usage=2" } */
6 /* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { ! "arm*-*-*" } } } } */
7
8 #include "tree-vect.h"
9
10 #ifndef N
11 #define N 5
12 #endif
13 float vect_a[N] = { 5.1f, 4.2f, 8.0f, 4.25f, 6.5f };
14 unsigned vect_b[N] = { 0 };
15
16 __attribute__ ((noinline, noipa))
17 unsigned test4(double x)
18 {
19 unsigned ret = 0;
20 for (int i = 0; i < N; i++)
21 {
22 if (vect_a[i] > x)
23 break;
24 vect_a[i] = x;
25
26 }
27 return ret;
28 }
29
30 extern void abort ();
31
32 int main ()
33 {
34 check_vect ();
35
36 if (test4 (7.0) != 0)
37 abort ();
38
39 if (vect_b[2] != 0 && vect_b[1] == 0)
40 abort ();
41 }