blob: 32a1328ae12ab231dc76857d189465955a5e2331 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-fdump-rtl-cmpelim -dp" } */
/* { dg-skip-if "code quality test" { *-*-* } { "-O0" "-O1" } { "" } } */
typedef int __attribute__ ((mode (QI))) int_t;
void
lt_addqi (int_t *w, int_t *x, int_t *y)
{
int_t v;
v = *x + *y;
if (v < 0)
*w = v;
else
*w = v + 2;
}
/* Expect assembly like:
addb3 *8(%ap),*12(%ap),%r0 # 29 [c=64] *addqi3_ccn
jlss .L2 # 31 [c=26] *branch_ccn
addb2 $2,%r0 # 28 [c=32] *addqi3
.L2:
*/
/* { dg-final { scan-rtl-dump-times "deleting insn with uid" 1 "cmpelim" } } */
/* { dg-final { scan-assembler-not "\t(bit|cmpz?|tst). " } } */
/* { dg-final { scan-assembler "addqi\[^ \]*_ccn(/\[0-9\]+)?\n" } } */
/* { dg-final { scan-assembler "branch_ccn\n" } } */