[NDS32] Add intrinsic functions for TLB operation and data prefech.
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-unswitch-3.c
blob089b6106711235ebe2b0f190d60bbd32dfda4e46
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */
4 #include <stdlib.h>
5 #define N 32
6 float *foo(int ustride, int size, float *src)
8 float *buffer, *p;
9 int i, k;
11 if (!src)
12 return NULL;
14 buffer = (float *) malloc(N * size * sizeof(float));
16 if(buffer)
17 for(i=0, p=buffer; i<N; i++, src+=ustride)
18 for(k=0; k<size; k++)
19 *p++ = src[k];
21 return buffer;
24 /* { dg-final { scan-tree-dump-times "guard hoisted" 1 "unswitch" } } */
25 /* { dg-final { scan-tree-dump-not "Invalid sum" "unswitch" } } */