This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add TST to RX


Here's a test case that covered all the patterns I used...

extern void f1();
extern void f2();
extern void f3();
extern void f4();

void
func (int a)
{
  if (a & 4)
    f1();
  else if (a & 1)
    f2();
  else if (a & 2)
    f3();
  else
    f4();
}

#define T(n,x) f_##n (int a) { if (x) foo(); bar(); } fn_##n (int a) { if (!(x)) foo(); bar(); }
T(1, a & 1)
T(2, a & 2)
T(3, a & 3)
T(4, a & 4)
T(5, a & 5)
T(6, a & 8)
T(s, a & 0x80000000)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]