[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / val-prof-7.c
blobc9303e053eeb6bcc165f87c0dd6a9acd7bc4a50c
1 /* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
2 /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } } */
4 char *buffer1;
5 char *buffer2;
7 /* Bzero is not tested because it gets transformed into memset. */
9 #define DEFINE_TEST(N) \
10 __attribute__((noinline)) \
11 void memcpy_test_ ## N (int len) \
12 { \
13 __builtin_memcpy (buffer1, buffer2, len); \
14 } \
16 __attribute__((noinline)) \
17 void mempcpy_test_ ## N (int len) \
18 { \
19 __builtin_mempcpy (buffer1, buffer2, len); \
20 } \
22 __attribute__((noinline)) \
23 void memset_test_ ## N (int len) \
24 { \
25 __builtin_memset (buffer1, 'c', len); \
26 } \
28 void test_stringops_ ## N(int len) \
29 { \
30 memcpy_test_## N (len); \
31 mempcpy_test_ ## N (len); \
32 memset_test_ ## N (len); \
33 } \
35 void test_stringops_with_values_ ## N (int common, int not_common) \
36 { \
37 int i; \
38 for (i = 0; i < 1000; i++) \
39 { \
40 if (i > 990) \
41 test_stringops_ ## N (not_common); \
42 else \
43 test_stringops_ ## N (common); \
44 } \
47 DEFINE_TEST(0);
48 DEFINE_TEST(1);
49 DEFINE_TEST(2);
51 int main() {
52 buffer1 = __builtin_malloc (1000);
53 buffer2 = __builtin_malloc (1000);
55 test_stringops_with_values_0 (8, 55);
56 test_stringops_with_values_1 (55, 55);
57 test_stringops_with_values_2 (257, 55);
59 return 0;
62 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memcpy" "profile" } } */
63 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memcpy" "profile" } } */
64 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memcpy" 0 "profile" } } */
66 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_mempcpy" "profile" } } */
67 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_mempcpy" "profile" } } */
68 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_mempcpy" 0 "profile" } } */
70 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memset" "profile" } } */
71 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memset" "profile" } } */
72 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memset" 0 "profile" } } */