20000614-1.c: New test.

* gcc.dg/20000614-1.c: New test.
	* gcc.dg/20000614-2.c: New test.

From-SVN: r34564
This commit is contained in:
Jakub Jelinek 2000-06-15 17:25:52 +02:00 committed by Jakub Jelinek
parent 1bf8972740
commit d2f7db1d9d
3 changed files with 55 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2000-06-14 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20000614-1.c: New test.
* gcc.dg/20000614-2.c: New test.
2000-06-14 Hans-Peter Nilsson <hp@axis.com>
* g++.old-deja/g++.other/inline12.C: New test.

View File

@ -0,0 +1,23 @@
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O2" } */
void bar(char *p)
{
}
static inline void foo (unsigned long base, unsigned char val)
{
val ^= (1<<2);
bar (val & (1<<5) ? "1" : "2");
bar (val & (1<<4) ? "1" : "2");
bar (val & (1<<3) ? "1" : "2");
bar (val & (1<<2) ? "1" : "2");
bar (val & (1<<1) ? "1" : "2");
bar (val & (1<<0) ? "1" : "2");
asm volatile ("": :"a" (val), "d" (base));
}
int main (void)
{
foo (23, 1);
}

View File

@ -0,0 +1,27 @@
/* { dg-do run { target i?86-*-* } } */
/* { dg-options "-O2 -fno-strength-reduce" } */
void bar(char *p)
{
}
int main()
{
union {
unsigned int val;
unsigned char p[4];
} serial;
char buf[8];
int i;
serial.val = 0;
bar(buf);
for(i = 0; i < 8; i += 4)
{
serial.p [0] += buf [i + 0];
serial.p [1] += buf [i + 1];
serial.p [2] += buf [i + 2];
serial.p [3] += buf [i + 3];
}
return serial.val;
}