1 /* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */
2 /* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
7 #define DEFINE_TEST(N) \
8 __attribute__((noinline)) \
9 void bzero_test_ ## N (int len) \
11 __builtin_bzero (buffer1, len); \
14 __attribute__((noinline)) \
15 void memcpy_test_ ## N (int len) \
17 __builtin_memcpy (buffer1, buffer2, len); \
20 __attribute__((noinline)) \
21 void mempcpy_test_ ## N (int len) \
23 __builtin_mempcpy (buffer1, buffer2, len); \
26 __attribute__((noinline)) \
27 void memset_test_ ## N (int len) \
29 __builtin_memset (buffer1, 'c', len); \
32 void test_stringops_ ## N(int len) \
34 bzero_test_ ## N (len); \
35 memcpy_test_## N (len); \
36 mempcpy_test_ ## N (len); \
37 memset_test_ ## N (len); \
40 void test_stringops_with_values_ ## N (int common, int not_common) \
43 for (i = 0; i < 1000; i++) \
46 test_stringops_ ## N (not_common); \
48 test_stringops_ ## N (common); \
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);
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" } } */