| 1 |
/* { dg-do compile { target { ! riscv_abi_e } } } */ |
| 2 |
/* { dg-options "-mno-inline-strcmp -mno-inline-strncmp -march=rv32gc_zbb" { target { rv32 } } } */ |
| 3 |
/* { dg-options "-mno-inline-strcmp -mno-inline-strncmp -march=rv64gc_zbb" { target { rv64 } } } */ |
| 4 |
/* { dg-skip-if "" { *-*-* } { "-O0" "-Os" "-Og" "-Oz" } } */ |
| 5 |
|
| 6 |
typedef long unsigned int size_t; |
| 7 |
|
| 8 |
int |
| 9 |
my_str_cmp (const char *s1, const char *s2) |
| 10 |
{ |
| 11 |
return __builtin_strcmp (s1, s2); |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
my_str_cmp_const (const char *s1) |
| 16 |
{ |
| 17 |
return __builtin_strcmp (s1, "foo"); |
| 18 |
} |
| 19 |
|
| 20 |
int |
| 21 |
my_strn_cmp (const char *s1, const char *s2, size_t n) |
| 22 |
{ |
| 23 |
return __builtin_strncmp (s1, s2, n); |
| 24 |
} |
| 25 |
|
| 26 |
int |
| 27 |
my_strn_cmp_const (const char *s1, size_t n) |
| 28 |
{ |
| 29 |
return __builtin_strncmp (s1, "foo", n); |
| 30 |
} |
| 31 |
|
| 32 |
int |
| 33 |
my_strn_cmp_bounded (const char *s1, const char *s2) |
| 34 |
{ |
| 35 |
return __builtin_strncmp (s1, s2, 42); |
| 36 |
} |
| 37 |
|
| 38 |
/* { dg-final { scan-assembler-not "orc.b\t" } } */ |