2018-02-09 Sebastian Perta <sebastian.perta@renesas.com>
[official-gcc.git] / gcc / testsuite / gcc.target / sh / strlen.c
blobca88026018ad15b302df37598b5f9c97df6f1a98
1 /* Check that the __builtin_strlen function is inlined with cmp/str
2 when optimizing for speed. */
3 /* { dg-do compile } */
4 /* { dg-options "-O2" } */
5 /* { dg-final { scan-assembler-not "jmp" } } */
6 /* { dg-final { scan-assembler-times "cmp/str" 2 } } */
7 /* { dg-final { scan-assembler-times "tst\t#3" 1 } } */
9 int
10 test00 (const char *s1)
12 return __builtin_strlen (s1);
15 /* Check that no test for alignment is needed. */
16 int
17 test03 (const char *s1)
19 return __builtin_strlen (__builtin_assume_aligned (s1, 4));