Testcase for PR71785
gcc/testsuite/ PR rtl-optimization/71785 * gcc.target/powerpc/pr71785.c: New file. From-SVN: r242665
This commit is contained in:
parent
e0e7aa34ab
commit
e51482c9c8
@ -1,3 +1,8 @@
|
||||
2016-11-21 Segher Boessenkool <segher@kernel.crashing.org>
|
||||
|
||||
PR rtl-optimization/71785
|
||||
* gcc.target/powerpc/pr71785.c: New file.
|
||||
|
||||
2016-11-21 Bin Cheng <bin.cheng@arm.com>
|
||||
|
||||
PR testsuite/78114
|
||||
|
52
gcc/testsuite/gcc.target/powerpc/pr71785.c
Normal file
52
gcc/testsuite/gcc.target/powerpc/pr71785.c
Normal file
@ -0,0 +1,52 @@
|
||||
/* { dg-do compile { target { powerpc*-*-* } } } */
|
||||
/* { dg-options "-O2" } */
|
||||
/* { dg-final { scan-assembler-not {\mb\M} } } */
|
||||
|
||||
/* Check that all computed gotos in this testcase end up unfactored completely.
|
||||
If some is not there will be a unconditional jump left; if all works fine,
|
||||
all are gone. */
|
||||
|
||||
typedef enum opcode
|
||||
{
|
||||
OP_A,
|
||||
OP_B,
|
||||
OP_END
|
||||
} opcode;
|
||||
|
||||
typedef struct op
|
||||
{
|
||||
opcode opcode;
|
||||
int arg;
|
||||
} op;
|
||||
|
||||
extern void do_stuff_b(int arg);
|
||||
extern void do_stuff_c(int arg);
|
||||
|
||||
extern int someglobal;
|
||||
|
||||
void
|
||||
eval(op *op)
|
||||
{
|
||||
static const void *dispatch_table[] = {
|
||||
&&CASE_OP_A,
|
||||
&&CASE_OP_B,
|
||||
&&CASE_OP_C,
|
||||
&&CASE_OP_END
|
||||
};
|
||||
|
||||
goto *dispatch_table[op->opcode];
|
||||
CASE_OP_A:
|
||||
someglobal++;
|
||||
op++;
|
||||
goto *dispatch_table[op->opcode];
|
||||
CASE_OP_B:
|
||||
do_stuff_b(op->arg);
|
||||
op++;
|
||||
goto *dispatch_table[op->opcode];
|
||||
CASE_OP_C:
|
||||
do_stuff_c(op->arg);
|
||||
op++;
|
||||
goto *dispatch_table[op->opcode];
|
||||
CASE_OP_END:
|
||||
return;
|
||||
}
|
Loading…
Reference in New Issue
Block a user