Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / val-prof-7.c
blob84ec9fbf7b579c3ffe1a23742621f3a5128a1e6e
1 /* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
2 /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
4 char *buffer1;
5 char *buffer2;
7 #define DEFINE_TEST(N) \
8 __attribute__((noinline)) \
9 void bzero_test_ ## N (int len) \
10 { \
11 __builtin_bzero (buffer1, len); \
12 } \
14 __attribute__((noinline)) \
15 void memcpy_test_ ## N (int len) \
16 { \
17 __builtin_memcpy (buffer1, buffer2, len); \
18 } \
20 __attribute__((noinline)) \
21 void mempcpy_test_ ## N (int len) \
22 { \
23 __builtin_mempcpy (buffer1, buffer2, len); \
24 } \
26 __attribute__((noinline)) \
27 void memset_test_ ## N (int len) \
28 { \
29 __builtin_memset (buffer1, 'c', len); \
30 } \
32 void test_stringops_ ## N(int len) \
33 { \
34 bzero_test_ ## N (len); \
35 memcpy_test_## N (len); \
36 mempcpy_test_ ## N (len); \
37 memset_test_ ## N (len); \
38 } \
40 void test_stringops_with_values_ ## N (int common, int not_common) \
41 { \
42 int i; \
43 for (i = 0; i < 1000; i++) \
44 { \
45 if (i > 990) \
46 test_stringops_ ## N (not_common); \
47 else \
48 test_stringops_ ## N (common); \
49 } \
52 DEFINE_TEST(0);
53 DEFINE_TEST(1);
54 DEFINE_TEST(2);
56 int main() {
57 buffer1 = __builtin_malloc (1000);
58 buffer2 = __builtin_malloc (1000);
60 test_stringops_with_values_0 (8, 55);
61 test_stringops_with_values_1 (55, 55);
62 test_stringops_with_values_2 (257, 55);
64 return 0;
67 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_bzero" "profile" } } */
68 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_bzero" "profile" } } */
69 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_bzero" 0 "profile" } } */
71 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memcpy" "profile" } } */
72 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memcpy" "profile" } } */
73 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memcpy" 0 "profile" } } */
75 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_mempcpy" "profile" } } */
76 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_mempcpy" "profile" } } */
77 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_mempcpy" 0 "profile" } } */
79 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memset" "profile" } } */
80 /* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memset" "profile" } } */
81 /* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memset" 0 "profile" } } */