libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / pr90555.c
blob80c5c9fc85b9142f518a55d5839da42a6d46365c
1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-fopenmp-simd -O2 -mavx512f -fdump-ipa-icf-optimized" } */
4 #define N 1024
5 int a[N];
7 void
8 test_simdlen1 (void)
10 int i;
11 #pragma omp simd simdlen (4)
12 for (i = 0; i < N; ++i)
13 a[i] = a[i] + 1;
16 void
17 test_simdlen2 (void)
19 int i;
20 #pragma omp simd simdlen (8)
21 for (i = 0; i < N; ++i)
22 a[i] = a[i] + 1;
25 void
26 test_safelen1 (void)
28 int i;
29 #pragma omp simd safelen (4)
30 for (i = 0; i < N; ++i)
31 a[i] = a[i] + 1;
34 void
35 test_safelen2 (void)
37 int i;
38 #pragma omp simd safelen (8)
39 for (i = 0; i < N; ++i)
40 a[i] = a[i] + 1;
43 int d[1024];
45 int
46 test_simduid1 (int j, int b)
48 int l, c = 0;
49 #pragma omp simd reduction(+: c)
50 for (l = 0; l < b; ++l)
51 c += d[j + l];
52 return c;
55 int
56 test_simduid2 (int j, int b)
58 int l, c2 = 0;
59 #pragma omp simd reduction(+: c2)
60 for (l = 0; l < b; ++l)
61 c2 += d[j + l];
62 return c2;
65 /* { dg-final { scan-ipa-dump "Semantic equality hit:test_simduid1/\[0-9+\]+->test_simduid2/\[0-9+\]+" "icf" } } */
66 /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */