diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-01 13:30:41 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-01 13:30:41 +0000 |
commit | 19b77997853f319596537b4aa91fc10a891d0cd6 (patch) | |
tree | ffeae9f317ef559f4c1ef9e866d000502ac0dd34 /gcc/testsuite/gcc.c-torture/compile | |
parent | 14f92bf8613f5408023b82199b9b6ea1a6e54af3 (diff) | |
download | gcc-19b77997853f319596537b4aa91fc10a891d0cd6.tar.gz |
Move almost all unsorted c-torture tests to compile.
* gcc.c-torture/unsorted/386.c: Move to ...
* gcc.c-torture/compile/386.c: ... here.
* gcc.c-torture/unsorted/86.c: Move to ...
* gcc.c-torture/compile/86.c: ... here.
* gcc.c-torture/unsorted/a1.c: Move to ...
* gcc.c-torture/compile/a1.c: ... here.
* gcc.c-torture/unsorted/a3.c: Move to ...
* gcc.c-torture/compile/a3.c: ... here.
* gcc.c-torture/unsorted/aaa.c: Move to ...
* gcc.c-torture/compile/aaa.c: ... here.
* gcc.c-torture/unsorted/aa.c: Move to ...
* gcc.c-torture/compile/aa.c: ... here.
* gcc.c-torture/unsorted/abs.c: Move to ...
* gcc.c-torture/compile/abs.c: ... here.
* gcc.c-torture/unsorted/a.c: Move to ...
* gcc.c-torture/compile/a.c: ... here.
* gcc.c-torture/unsorted/ac.c: Move to ...
* gcc.c-torture/compile/ac.c: ... here.
* gcc.c-torture/unsorted/acc.c: Move to ...
* gcc.c-torture/compile/acc.c: ... here.
* gcc.c-torture/unsorted/add386.c: Move to ...
* gcc.c-torture/compile/add386.c: ... here.
* gcc.c-torture/unsorted/add.c: Move to ...
* gcc.c-torture/compile/add.c: ... here.
* gcc.c-torture/unsorted/addcc.c: Move to ...
* gcc.c-torture/compile/addcc.c: ... here.
* gcc.c-torture/unsorted/andm.c: Move to ...
* gcc.c-torture/compile/andm.c: ... here.
* gcc.c-torture/unsorted/andmem.c: Move to ...
* gcc.c-torture/compile/andmem.c: ... here.
* gcc.c-torture/unsorted/andn.c: Move to ...
* gcc.c-torture/compile/andn.c: ... here.
* gcc.c-torture/unsorted/andok.c: Move to ...
* gcc.c-torture/compile/andok.c: ... here.
* gcc.c-torture/unsorted/andsi.c: Move to ...
* gcc.c-torture/compile/andsi.c: ... here.
* gcc.c-torture/unsorted/andsparc.c: Move to ...
* gcc.c-torture/compile/andsparc.c: ... here.
* gcc.c-torture/unsorted/aos.c: Move to ...
* gcc.c-torture/compile/aos.c: ... here.
* gcc.c-torture/unsorted/arr.c: Move to ...
* gcc.c-torture/compile/arr.c: ... here.
* gcc.c-torture/unsorted/as.c: Move to ...
* gcc.c-torture/compile/as.c: ... here.
* gcc.c-torture/unsorted/ase.c: Move to ...
* gcc.c-torture/compile/ase.c: ... here.
* gcc.c-torture/unsorted/b1.c: Move to ...
* gcc.c-torture/compile/b1.c: ... here.
* gcc.c-torture/unsorted/b2.c: Move to ...
* gcc.c-torture/compile/b2.c: ... here.
* gcc.c-torture/unsorted/b3.c: Move to ...
* gcc.c-torture/compile/b3.c: ... here.
* gcc.c-torture/unsorted/b88.c: Move to ...
* gcc.c-torture/compile/b88.c: ... here.
* gcc.c-torture/unsorted/bad.c: Move to ...
* gcc.c-torture/compile/bad.c: ... here.
* gcc.c-torture/unsorted/band.c: Move to ...
* gcc.c-torture/compile/band.c: ... here.
* gcc.c-torture/unsorted/bb0.c: Move to ...
* gcc.c-torture/compile/bb0.c: ... here.
* gcc.c-torture/unsorted/bb1.c: Move to ...
* gcc.c-torture/compile/bb1.c: ... here.
* gcc.c-torture/unsorted/bbb.c: Move to ...
* gcc.c-torture/compile/bbb.c: ... here.
* gcc.c-torture/unsorted/b.c: Move to ...
* gcc.c-torture/compile/b.c: ... here.
* gcc.c-torture/unsorted/bc.c: Move to ...
* gcc.c-torture/compile/bc.c: ... here.
* gcc.c-torture/unsorted/bcopy.c: Move to ...
* gcc.c-torture/compile/bcopy.c: ... here.
* gcc.c-torture/unsorted/bf.c: Move to ...
* gcc.c-torture/compile/bf.c: ... here.
* gcc.c-torture/unsorted/bfins.c: Move to ...
* gcc.c-torture/compile/bfins.c: ... here.
* gcc.c-torture/unsorted/bfx.c: Move to ...
* gcc.c-torture/compile/bfx.c: ... here.
* gcc.c-torture/unsorted/bge.c: Move to ...
* gcc.c-torture/compile/bge.c: ... here.
* gcc.c-torture/unsorted/bit.c: Move to ...
* gcc.c-torture/compile/bit.c: ... here.
* gcc.c-torture/unsorted/bitf.c: Move to ...
* gcc.c-torture/compile/bitf.c: ... here.
* gcc.c-torture/unsorted/bitw.c: Move to ...
* gcc.c-torture/compile/bitw.c: ... here.
* gcc.c-torture/unsorted/blk.c: Move to ...
* gcc.c-torture/compile/blk.c: ... here.
* gcc.c-torture/unsorted/bt386.c: Move to ...
* gcc.c-torture/compile/bt386.c: ... here.
* gcc.c-torture/unsorted/bt.c: Move to ...
* gcc.c-torture/compile/bt.c: ... here.
* gcc.c-torture/unsorted/BUG11.c: Move to ...
* gcc.c-torture/compile/BUG11.c: ... here.
* gcc.c-torture/unsorted/BUG12.c: Move to ...
* gcc.c-torture/compile/BUG12.c: ... here.
* gcc.c-torture/unsorted/BUG13.c: Move to ...
* gcc.c-torture/compile/BUG13.c: ... here.
* gcc.c-torture/unsorted/BUG16.c: Move to ...
* gcc.c-torture/compile/BUG16.c: ... here.
* gcc.c-torture/unsorted/BUG17.c: Move to ...
* gcc.c-torture/compile/BUG17.c: ... here.
* gcc.c-torture/unsorted/BUG18.c: Move to ...
* gcc.c-torture/compile/BUG18.c: ... here.
* gcc.c-torture/unsorted/BUG1.c: Move to ...
* gcc.c-torture/compile/BUG1.c: ... here.
* gcc.c-torture/unsorted/BUG21.c: Move to ...
* gcc.c-torture/compile/BUG21.c: ... here.
* gcc.c-torture/unsorted/BUG22.c: Move to ...
* gcc.c-torture/compile/BUG22.c: ... here.
* gcc.c-torture/unsorted/BUG23.c: Move to ...
* gcc.c-torture/compile/BUG23.c: ... here.
* gcc.c-torture/unsorted/BUG24.c: Move to ...
* gcc.c-torture/compile/BUG24.c: ... here.
* gcc.c-torture/unsorted/BUG25.c: Move to ...
* gcc.c-torture/compile/BUG25.c: ... here.
* gcc.c-torture/unsorted/BUG2.c: Move to ...
* gcc.c-torture/compile/BUG2.c: ... here.
* gcc.c-torture/unsorted/BUG3.c: Move to ...
* gcc.c-torture/compile/BUG3.c: ... here.
* gcc.c-torture/unsorted/BUG4.c: Move to ...
* gcc.c-torture/compile/BUG4.c: ... here.
* gcc.c-torture/unsorted/BUG5.c: Move to ...
* gcc.c-torture/compile/BUG5.c: ... here.
* gcc.c-torture/unsorted/BUG6.c: Move to ...
* gcc.c-torture/compile/BUG6.c: ... here.
* gcc.c-torture/unsorted/bug.c: Move to ...
* gcc.c-torture/compile/bug.c: ... here.
* gcc.c-torture/unsorted/bugc.c: Move to ...
* gcc.c-torture/compile/bugc.c: ... here.
* gcc.c-torture/unsorted/buns.c: Move to ...
* gcc.c-torture/compile/buns.c: ... here.
* gcc.c-torture/unsorted/bx.c: Move to ...
* gcc.c-torture/compile/bx.c: ... here.
* gcc.c-torture/unsorted/c1.c: Move to ...
* gcc.c-torture/compile/c1.c: ... here.
* gcc.c-torture/unsorted/c2.c: Move to ...
* gcc.c-torture/compile/c2.c: ... here.
* gcc.c-torture/unsorted/call386.c: Move to ...
* gcc.c-torture/compile/call386.c: ... here.
* gcc.c-torture/unsorted/call.c: Move to ...
* gcc.c-torture/compile/call.c: ... here.
* gcc.c-torture/unsorted/callind.c: Move to ...
* gcc.c-torture/compile/callind.c: ... here.
* gcc.c-torture/unsorted/c.c: Move to ...
* gcc.c-torture/compile/c.c: ... here.
* gcc.c-torture/unsorted/cc.c: Move to ...
* gcc.c-torture/compile/cc.c: ... here.
* gcc.c-torture/unsorted/charmtst.c: Move to ...
* gcc.c-torture/compile/charmtst.c: ... here.
* gcc.c-torture/unsorted/cmb.c: Move to ...
* gcc.c-torture/compile/cmb.c: ... here.
* gcc.c-torture/unsorted/cmp.c: Move to ...
* gcc.c-torture/compile/cmp.c: ... here.
* gcc.c-torture/unsorted/cmphi.c: Move to ...
* gcc.c-torture/compile/cmphi.c: ... here.
* gcc.c-torture/unsorted/cmpsi386.c: Move to ...
* gcc.c-torture/compile/cmpsi386.c: ... here.
* gcc.c-torture/unsorted/cmul.c: Move to ...
* gcc.c-torture/compile/cmul.c: ... here.
* gcc.c-torture/unsorted/cn1.c: Move to ...
* gcc.c-torture/compile/cn1.c: ... here.
* gcc.c-torture/unsorted/comb.c: Move to ...
* gcc.c-torture/compile/comb.c: ... here.
* gcc.c-torture/unsorted/consec.c: Move to ...
* gcc.c-torture/compile/consec.c: ... here.
* gcc.c-torture/unsorted/const.c: Move to ...
* gcc.c-torture/compile/const.c: ... here.
* gcc.c-torture/unsorted/conv.c: Move to ...
* gcc.c-torture/compile/conv.c: ... here.
* gcc.c-torture/unsorted/conv_tst.c: Move to ...
* gcc.c-torture/compile/conv_tst.c: ... here.
* gcc.c-torture/unsorted/cp.c: Move to ...
* gcc.c-torture/compile/cp.c: ... here.
* gcc.c-torture/unsorted/csebug.c: Move to ...
* gcc.c-torture/compile/csebug.c: ... here.
* gcc.c-torture/unsorted/cvt.c: Move to ...
* gcc.c-torture/compile/cvt.c: ... here.
* gcc.c-torture/unsorted/dblbug.c: Move to ...
* gcc.c-torture/compile/dblbug.c: ... here.
* gcc.c-torture/unsorted/dbl_parm.c: Move to ...
* gcc.c-torture/compile/dbl_parm.c: ... here.
* gcc.c-torture/unsorted/d.c: Move to ...
* gcc.c-torture/compile/d.c: ... here.
* gcc.c-torture/unsorted/ddd.c: Move to ...
* gcc.c-torture/compile/ddd.c: ... here.
* gcc.c-torture/unsorted/dead.c: Move to ...
* gcc.c-torture/compile/dead.c: ... here.
* gcc.c-torture/unsorted/delay.c: Move to ...
* gcc.c-torture/compile/delay.c: ... here.
* gcc.c-torture/unsorted/DFcmp.c: Move to ...
* gcc.c-torture/compile/DFcmp.c: ... here. Require int32plus.
* gcc.c-torture/unsorted/di.c: Move to ...
* gcc.c-torture/compile/di.c: ... here.
* gcc.c-torture/unsorted/dic.c: Move to ...
* gcc.c-torture/compile/dic.c: ... here.
* gcc.c-torture/unsorted/dilayout.c: Move to ...
* gcc.c-torture/compile/dilayout.c: ... here.
* gcc.c-torture/unsorted/dimove.c: Move to ...
* gcc.c-torture/compile/dimove.c: ... here.
* gcc.c-torture/unsorted/dimul.c: Move to ...
* gcc.c-torture/compile/dimul.c: ... here.
* gcc.c-torture/unsorted/div.c: Move to ...
* gcc.c-torture/compile/div.c: ... here.
* gcc.c-torture/unsorted/divdf.c: Move to ...
* gcc.c-torture/compile/divdf.c: ... here.
* gcc.c-torture/unsorted/dm.c: Move to ...
* gcc.c-torture/compile/dm.c: ... here.
* gcc.c-torture/unsorted/dshift.c: Move to ...
* gcc.c-torture/compile/dshift.c: ... here.
* gcc.c-torture/unsorted/e.c: Move to ...
* gcc.c-torture/compile/e.c: ... here.
* gcc.c-torture/unsorted/ex.c: Move to ...
* gcc.c-torture/compile/ex.c: ... here.
* gcc.c-torture/unsorted/ext.c: Move to ...
* gcc.c-torture/compile/ext.c: ... here.
* gcc.c-torture/unsorted/f1.c: Move to ...
* gcc.c-torture/compile/f1.c: ... here.
* gcc.c-torture/unsorted/f2.c: Move to ...
* gcc.c-torture/compile/f2.c: ... here.
* gcc.c-torture/unsorted/fdmul.c: Move to ...
* gcc.c-torture/compile/fdmul.c: ... here.
* gcc.c-torture/unsorted/float.c: Move to ...
* gcc.c-torture/compile/float.c: ... here.
* gcc.c-torture/unsorted/flo.c: Move to ...
* gcc.c-torture/compile/flo.c: ... here.
* gcc.c-torture/unsorted/flt_const.c: Move to ...
* gcc.c-torture/compile/flt_const.c: ... here.
* gcc.c-torture/unsorted/fnul.c: Move to ...
* gcc.c-torture/compile/fnul.c: ... here.
* gcc.c-torture/unsorted/foo.c: Move to ...
* gcc.c-torture/compile/foo.c: ... here.
* gcc.c-torture/unsorted/forgetcc.c: Move to ...
* gcc.c-torture/compile/forgetcc.c: ... here.
* gcc.c-torture/unsorted/fq.c: Move to ...
* gcc.c-torture/compile/fq.c: ... here.
* gcc.c-torture/unsorted/g.c: Move to ...
* gcc.c-torture/compile/g.c: ... here.
* gcc.c-torture/unsorted/gen_tst.c: Move to ...
* gcc.c-torture/compile/gen_tst.c: ... here.
* gcc.c-torture/unsorted/glob.c: Move to ...
* gcc.c-torture/compile/glob.c: ... here.
* gcc.c-torture/unsorted/gronk.c: Move to ...
* gcc.c-torture/compile/gronk.c: ... here.
* gcc.c-torture/unsorted/hibug.c: Move to ...
* gcc.c-torture/compile/hibug.c: ... here.
* gcc.c-torture/unsorted/hi.c: Move to ...
* gcc.c-torture/compile/hi.c: ... here.
* gcc.c-torture/unsorted/HIcmp.c: Move to ...
* gcc.c-torture/compile/HIcmp.c: ... here.
* gcc.c-torture/unsorted/HIset.c: Move to ...
* gcc.c-torture/compile/HIset.c: ... here.
* gcc.c-torture/unsorted/i.c: Move to ...
* gcc.c-torture/compile/i.c: ... here.
* gcc.c-torture/unsorted/i++.c: Move to ...
* gcc.c-torture/compile/i++.c: ... here.
* gcc.c-torture/unsorted/ic.c: Move to ...
* gcc.c-torture/compile/ic.c: ... here.
* gcc.c-torture/unsorted/icmp.c: Move to ...
* gcc.c-torture/compile/icmp.c: ... here.
* gcc.c-torture/unsorted/ifreg.c: Move to ...
* gcc.c-torture/compile/ifreg.c: ... here.
* gcc.c-torture/unsorted/imm.c: Move to ...
* gcc.c-torture/compile/imm.c: ... here.
* gcc.c-torture/unsorted/isinf.c: Move to ...
* gcc.c-torture/compile/isinf.c: ... here.
* gcc.c-torture/unsorted/jmp.c: Move to ...
* gcc.c-torture/compile/jmp.c: ... here.
* gcc.c-torture/unsorted/jumptab.c: Move to ...
* gcc.c-torture/compile/jumptab.c: ... here.
* gcc.c-torture/unsorted/layout.c: Move to ...
* gcc.c-torture/compile/layout.c: ... here.
* gcc.c-torture/unsorted/lbug.c: Move to ...
* gcc.c-torture/compile/lbug.c: ... here.
* gcc.c-torture/unsorted/l.c: Move to ...
* gcc.c-torture/compile/l.c: ... here.
* gcc.c-torture/unsorted/ll1.c: Move to ...
* gcc.c-torture/compile/ll1.c: ... here.
* gcc.c-torture/unsorted/llbug.c: Move to ...
* gcc.c-torture/compile/llbug.c: ... here.
* gcc.c-torture/unsorted/lll.c: Move to ...
* gcc.c-torture/compile/lll.c: ... here.
* gcc.c-torture/unsorted/load8.c: Move to ...
* gcc.c-torture/compile/load8.c: ... here.
* gcc.c-torture/unsorted/loadhicc.c: Move to ...
* gcc.c-torture/compile/loadhicc.c: ... here.
* gcc.c-torture/unsorted/log2.c: Move to ...
* gcc.c-torture/compile/log2.c: ... here.
* gcc.c-torture/unsorted/logic.c: Move to ...
* gcc.c-torture/compile/logic.c: ... here.
* gcc.c-torture/unsorted/loop-1.c: Move to ...
* gcc.c-torture/compile/loop-1.c: ... here.
* gcc.c-torture/unsorted/loop386.c: Move to ...
* gcc.c-torture/compile/loop386.c: ... here.
* gcc.c-torture/unsorted/lop.c: Move to ...
* gcc.c-torture/compile/lop.c: ... here.
* gcc.c-torture/unsorted/m1.c: Move to ...
* gcc.c-torture/compile/m1.c: ... here.
* gcc.c-torture/unsorted/m2.c: Move to ...
* gcc.c-torture/compile/m2.c: ... here.
* gcc.c-torture/unsorted/m5.c: Move to ...
* gcc.c-torture/compile/m5.c: ... here.
* gcc.c-torture/unsorted/m68.c: Move to ...
* gcc.c-torture/compile/m68.c: ... here.
* gcc.c-torture/unsorted/mbyte.c: Move to ...
* gcc.c-torture/compile/mbyte.c: ... here.
* gcc.c-torture/unsorted/mchar.c: Move to ...
* gcc.c-torture/compile/mchar.c: ... here.
* gcc.c-torture/unsorted/mcmp.c: Move to ...
* gcc.c-torture/compile/mcmp.c: ... here.
* gcc.c-torture/unsorted/mdouble.c: Move to ...
* gcc.c-torture/compile/mdouble.c: ... here.
* gcc.c-torture/unsorted/memtst.c: Move to ...
* gcc.c-torture/compile/memtst.c: ... here.
* gcc.c-torture/unsorted/miscomp.c: Move to ...
* gcc.c-torture/compile/miscomp.c: ... here.
* gcc.c-torture/unsorted/mm.c: Move to ...
* gcc.c-torture/compile/mm.c: ... here.
* gcc.c-torture/unsorted/mod.c: Move to ...
* gcc.c-torture/compile/mod.c: ... here.
* gcc.c-torture/unsorted/modcc.c: Move to ...
* gcc.c-torture/compile/modcc.c: ... here.
* gcc.c-torture/unsorted/move.c: Move to ...
* gcc.c-torture/compile/move.c: ... here.
* gcc.c-torture/unsorted/move_qhi.c: Move to ...
* gcc.c-torture/compile/move_qhi.c: ... here.
* gcc.c-torture/unsorted/mregtst.c: Move to ...
* gcc.c-torture/compile/mregtst.c: ... here.
* gcc.c-torture/unsorted/msp.c: Move to ...
* gcc.c-torture/compile/msp.c: ... here.
* gcc.c-torture/unsorted/mtst.c: Move to ...
* gcc.c-torture/compile/mtst.c: ... here.
* gcc.c-torture/unsorted/mu.c: Move to ...
* gcc.c-torture/compile/mu.c: ... here.
* gcc.c-torture/unsorted/mul.c: Move to ...
* gcc.c-torture/compile/mul.c: ... here.
* gcc.c-torture/unsorted/mword1.c: Move to ...
* gcc.c-torture/compile/mword1.c: ... here.
* gcc.c-torture/unsorted/mword.c: Move to ...
* gcc.c-torture/compile/mword.c: ... here.
* gcc.c-torture/unsorted/n1.c: Move to ...
* gcc.c-torture/compile/n1.c: ... here.
* gcc.c-torture/unsorted/nand.c: Move to ...
* gcc.c-torture/compile/nand.c: ... here.
* gcc.c-torture/unsorted/n.c: Move to ...
* gcc.c-torture/compile/n.c: ... here.
* gcc.c-torture/unsorted/neg.c: Move to ...
* gcc.c-torture/compile/neg.c: ... here.
* gcc.c-torture/unsorted/o.c: Move to ...
* gcc.c-torture/compile/o.c: ... here.
* gcc.c-torture/unsorted/omit.c: Move to ...
* gcc.c-torture/compile/omit.c: ... here.
* gcc.c-torture/unsorted/opout.c: Move to ...
* gcc.c-torture/compile/opout.c: ... here.
* gcc.c-torture/unsorted/opt.c: Move to ...
* gcc.c-torture/compile/opt.c: ... here.
* gcc.c-torture/unsorted/or386.c: Move to ...
* gcc.c-torture/compile/or386.c: ... here.
* gcc.c-torture/unsorted/or.c: Move to ...
* gcc.c-torture/compile/or.c: ... here.
* gcc.c-torture/unsorted/parms.c: Move to ...
* gcc.c-torture/compile/parms.c: ... here.
* gcc.c-torture/unsorted/pass.c: Move to ...
* gcc.c-torture/compile/pass.c: ... here.
* gcc.c-torture/unsorted/p.c: Move to ...
* gcc.c-torture/compile/p.c: ... here.
* gcc.c-torture/unsorted/pmt.c: Move to ...
* gcc.c-torture/compile/pmt.c: ... here.
* gcc.c-torture/unsorted/poor.c: Move to ...
* gcc.c-torture/compile/poor.c: ... here.
* gcc.c-torture/unsorted/pp.c: Move to ...
* gcc.c-torture/compile/pp.c: ... here.
* gcc.c-torture/unsorted/pret-arg.c: Move to ...
* gcc.c-torture/compile/pret-arg.c: ... here.
* gcc.c-torture/unsorted/pyr2.c: Move to ...
* gcc.c-torture/compile/pyr2.c: ... here.
* gcc.c-torture/unsorted/PYRBUG.c: Move to ...
* gcc.c-torture/compile/PYRBUG.c: ... here.
* gcc.c-torture/unsorted/pyr.c: Move to ...
* gcc.c-torture/compile/pyr.c: ... here.
* gcc.c-torture/unsorted/q.c: Move to ...
* gcc.c-torture/compile/q.c: ... here.
* gcc.c-torture/unsorted/QIcmp.c: Move to ...
* gcc.c-torture/compile/QIcmp.c: ... here.
* gcc.c-torture/unsorted/QIset.c: Move to ...
* gcc.c-torture/compile/QIset.c: ... here.
* gcc.c-torture/unsorted/r1.c: Move to ...
* gcc.c-torture/compile/r1.c: ... here.
* gcc.c-torture/unsorted/r.c: Move to ...
* gcc.c-torture/compile/r.c: ... here.
* gcc.c-torture/unsorted/rel.c: Move to ...
* gcc.c-torture/compile/rel.c: ... here.
* gcc.c-torture/unsorted/rmsc.c: Move to ...
* gcc.c-torture/compile/rmsc.c: ... here.
* gcc.c-torture/unsorted/round.c: Move to ...
* gcc.c-torture/compile/round.c: ... here.
* gcc.c-torture/unsorted/run.c: Move to ...
* gcc.c-torture/compile/run.c: ... here.
* gcc.c-torture/unsorted/sar.c: Move to ...
* gcc.c-torture/compile/sar.c: ... here.
* gcc.c-torture/unsorted/s.c: Move to ...
* gcc.c-torture/compile/s.c: ... here.
* gcc.c-torture/unsorted/scal.c: Move to ...
* gcc.c-torture/compile/scal.c: ... here.
* gcc.c-torture/unsorted/sc.c: Move to ...
* gcc.c-torture/compile/sc.c: ... here.
* gcc.c-torture/unsorted/scc.c: Move to ...
* gcc.c-torture/compile/scc.c: ... here.
* gcc.c-torture/unsorted/scond.c: Move to ...
* gcc.c-torture/compile/scond.c: ... here.
* gcc.c-torture/unsorted/selfrec.c: Move to ...
* gcc.c-torture/compile/selfrec.c: ... here.
* gcc.c-torture/unsorted/seq.c: Move to ...
* gcc.c-torture/compile/seq.c: ... here.
* gcc.c-torture/unsorted/set386.c: Move to ...
* gcc.c-torture/compile/set386.c: ... here.
* gcc.c-torture/unsorted/set88.c: Move to ...
* gcc.c-torture/compile/set88.c: ... here.
* gcc.c-torture/unsorted/SFset.c: Move to ...
* gcc.c-torture/compile/SFset.c: ... here. Require int32plus.
* gcc.c-torture/unsorted/shand.c: Move to ...
* gcc.c-torture/compile/shand.c: ... here.
* gcc.c-torture/unsorted/sh.c: Move to ...
* gcc.c-torture/compile/sh.c: ... here.
* gcc.c-torture/unsorted/shft.c: Move to ...
* gcc.c-torture/compile/shft.c: ... here.
* gcc.c-torture/unsorted/shift.c: Move to ...
* gcc.c-torture/compile/shift.c: ... here.
* gcc.c-torture/unsorted/shloop.c: Move to ...
* gcc.c-torture/compile/shloop.c: ... here.
* gcc.c-torture/unsorted/shm.c: Move to ...
* gcc.c-torture/compile/shm.c: ... here.
* gcc.c-torture/unsorted/SIcmp.c: Move to ...
* gcc.c-torture/compile/SIcmp.c: ... here.
* gcc.c-torture/unsorted/signext2.c: Move to ...
* gcc.c-torture/compile/signext2.c: ... here.
* gcc.c-torture/unsorted/signext.c: Move to ...
* gcc.c-torture/compile/signext.c: ... here.
* gcc.c-torture/unsorted/sim.c: Move to ...
* gcc.c-torture/compile/sim.c: ... here.
* gcc.c-torture/unsorted/simple.c: Move to ...
* gcc.c-torture/compile/simple.c: ... here.
* gcc.c-torture/unsorted/SIset.c: Move to ...
* gcc.c-torture/compile/SIset.c: ... here.
* gcc.c-torture/unsorted/sne.c: Move to ...
* gcc.c-torture/compile/sne.c: ... here.
* gcc.c-torture/unsorted/sound.c: Move to ...
* gcc.c-torture/compile/sound.c: ... here.
* gcc.c-torture/unsorted/sparcbug.c: Move to ...
* gcc.c-torture/compile/sparcbug.c: ... here.
* gcc.c-torture/unsorted/speed.c: Move to ...
* gcc.c-torture/compile/speed.c: ... here.
* gcc.c-torture/unsorted/stor.c: Move to ...
* gcc.c-torture/compile/stor.c: ... here.
* gcc.c-torture/unsorted/store0.c: Move to ...
* gcc.c-torture/compile/store0.c: ... here.
* gcc.c-torture/unsorted/storecc.c: Move to ...
* gcc.c-torture/compile/storecc.c: ... here.
* gcc.c-torture/unsorted/str.c: Move to ...
* gcc.c-torture/compile/str.c: ... here.
* gcc.c-torture/unsorted/stru.c: Move to ...
* gcc.c-torture/compile/stru.c: ... here.
* gcc.c-torture/unsorted/structret.c: Move to ...
* gcc.c-torture/compile/structret.c: ... here.
* gcc.c-torture/unsorted/stuct.c: Move to ...
* gcc.c-torture/compile/stuct.c: ... here.
* gcc.c-torture/unsorted/sub32.c: Move to ...
* gcc.c-torture/compile/sub32.c: ... here.
* gcc.c-torture/unsorted/subcc.c: Move to ...
* gcc.c-torture/compile/subcc.c: ... here.
* gcc.c-torture/unsorted/subcse.c: Move to ...
* gcc.c-torture/compile/subcse.c: ... here.
* gcc.c-torture/unsorted/sym.c: Move to ...
* gcc.c-torture/compile/sym.c: ... here.
* gcc.c-torture/unsorted/symconst.c: Move to ...
* gcc.c-torture/compile/symconst.c: ... here.
* gcc.c-torture/unsorted/t.c: Move to ...
* gcc.c-torture/compile/t.c: ... here.
* gcc.c-torture/unsorted/test.c: Move to ...
* gcc.c-torture/compile/test.c: ... here.
* gcc.c-torture/unsorted/test-flow.c: Move to ...
* gcc.c-torture/compile/test-flow.c: ... here.
* gcc.c-torture/unsorted/test-loop.c: Move to ...
* gcc.c-torture/compile/test-loop.c: ... here.
* gcc.c-torture/unsorted/time.c: Move to ...
* gcc.c-torture/compile/time.c: ... here.
* gcc.c-torture/unsorted/tmp.c: Move to ...
* gcc.c-torture/compile/tmp.c: ... here.
* gcc.c-torture/unsorted/trivial.c: Move to ...
* gcc.c-torture/compile/trivial.c: ... here.
* gcc.c-torture/unsorted/trunc.c: Move to ...
* gcc.c-torture/compile/trunc.c: ... here.
* gcc.c-torture/unsorted/u.c: Move to ...
* gcc.c-torture/compile/u.c: ... here.
* gcc.c-torture/unsorted/udconvert.c: Move to ...
* gcc.c-torture/compile/udconvert.c: ... here.
* gcc.c-torture/unsorted/udivmod4.c: Move to ...
* gcc.c-torture/compile/udivmod4.c: ... here.
* gcc.c-torture/unsorted/UHIcmp.c: Move to ...
* gcc.c-torture/compile/UHIcmp.c: ... here.
* gcc.c-torture/unsorted/uns.c: Move to ...
* gcc.c-torture/compile/uns.c: ... here.
* gcc.c-torture/unsorted/uns_tst.c: Move to ...
* gcc.c-torture/compile/uns_tst.c: ... here.
* gcc.c-torture/unsorted/UQIcmp.c: Move to ...
* gcc.c-torture/compile/UQIcmp.c: ... here.
* gcc.c-torture/unsorted/USIcmp.c: Move to ...
* gcc.c-torture/compile/USIcmp.c: ... here.
* gcc.c-torture/unsorted/uuarg.c: Move to ...
* gcc.c-torture/compile/uuarg.c: ... here.
* gcc.c-torture/unsorted/v.c: Move to ...
* gcc.c-torture/compile/v.c: ... here.
* gcc.c-torture/unsorted/w.c: Move to ...
* gcc.c-torture/compile/w.c: ... here.
* gcc.c-torture/unsorted/ww.c: Move to ...
* gcc.c-torture/compile/ww.c: ... here.
* gcc.c-torture/unsorted/xb.c: Move to ...
* gcc.c-torture/compile/xb.c: ... here.
* gcc.c-torture/unsorted/xbg.c: Move to ...
* gcc.c-torture/compile/xbg.c: ... here.
* gcc.c-torture/unsorted/x.c: Move to ...
* gcc.c-torture/compile/x.c: ... here.
* gcc.c-torture/unsorted/xc.c: Move to ...
* gcc.c-torture/compile/xc.c: ... here.
* gcc.c-torture/unsorted/xcsebug.c: Move to ...
* gcc.c-torture/compile/xcsebug.c: ... here.
* gcc.c-torture/unsorted/xdi.c: Move to ...
* gcc.c-torture/compile/xdi.c: ... here.
* gcc.c-torture/unsorted/xfoo.c: Move to ...
* gcc.c-torture/compile/xfoo.c: ... here.
* gcc.c-torture/unsorted/xi.c: Move to ...
* gcc.c-torture/compile/xi.c: ... here.
* gcc.c-torture/unsorted/xlop.c: Move to ...
* gcc.c-torture/compile/xlop.c: ... here.
* gcc.c-torture/unsorted/xmtst.c: Move to ...
* gcc.c-torture/compile/xmtst.c: ... here.
* gcc.c-torture/unsorted/xneg.c: Move to ...
* gcc.c-torture/compile/xneg.c: ... here.
* gcc.c-torture/unsorted/xopt.c: Move to ...
* gcc.c-torture/compile/xopt.c: ... here.
* gcc.c-torture/unsorted/xor.c: Move to ...
* gcc.c-torture/compile/xor.c: ... here.
* gcc.c-torture/unsorted/xorn.c: Move to ...
* gcc.c-torture/compile/xorn.c: ... here.
* gcc.c-torture/unsorted/xp.c: Move to ...
* gcc.c-torture/compile/xp.c: ... here.
* gcc.c-torture/unsorted/xpp.c: Move to ...
* gcc.c-torture/compile/xpp.c: ... here.
* gcc.c-torture/unsorted/xs.c: Move to ...
* gcc.c-torture/compile/xs.c: ... here.
* gcc.c-torture/unsorted/xsh.c: Move to ...
* gcc.c-torture/compile/xsh.c: ... here.
* gcc.c-torture/unsorted/xz.c: Move to ...
* gcc.c-torture/compile/xz.c: ... here.
* gcc.c-torture/unsorted/xzz.c: Move to ...
* gcc.c-torture/compile/xzz.c: ... here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile')
277 files changed, 6249 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/386.c b/gcc/testsuite/gcc.c-torture/compile/386.c new file mode 100644 index 00000000000..432cdaddd12 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/386.c @@ -0,0 +1,23 @@ +foo (a, p) + int *p; +{ + p[0] = a; + a = (short) a; + return a; +} + +main () +{ + int i; + foobar (i, &i); +} + + +foobar (a, b) +{ + int c; + + c = a % b; + a = a / b; + return a + b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/86.c b/gcc/testsuite/gcc.c-torture/compile/86.c new file mode 100644 index 00000000000..deea85ee2f4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/86.c @@ -0,0 +1,19 @@ +m32 (a) + int *a; +{ + a[1] = a[0]; +} + +m16 (a) + short *a; +{ + a[1] = a[0]; +} + + +m8 (a) + char *a; +{ + a[1] = a[0]; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG1.c b/gcc/testsuite/gcc.c-torture/compile/BUG1.c new file mode 100644 index 00000000000..ada8eaf49c7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG1.c @@ -0,0 +1,37 @@ +struct _XtTextSource { + /* ... */ + void (* SetSelection)(); + /* ... */ + }; + +typedef struct _XtTextSource *XtTextSource; + +typedef struct _TextPart { + XtTextSource source; + /* ... */ +} TextPart; + +typedef struct _TextRec { + /* ... */ + TextPart text; +} TextRec; + +typedef struct _TextRec *TextWidget; + + +void XtTextUnsetSelection(w) + TextWidget w; /* original is: Widget w; */ +{ + register TextWidget ctx = (TextWidget) w; + void (*nullProc)() = 0; + +/* + * the following line causes the error, when optimizing: + */ + + if (ctx->text.source->SetSelection != nullProc) { + + foo(); + + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG11.c b/gcc/testsuite/gcc.c-torture/compile/BUG11.c new file mode 100644 index 00000000000..fe2923a97f0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG11.c @@ -0,0 +1,29 @@ +#define DD 2410065408 + +unsigned +foo (d) + double d; +{ + return d; +} + +#if foobar + +main () +{ +#if bar + unsigned u = DD; + double d = (double) u; +#else + double d = (double) DD; +#endif + printf ("%u = %u = %lf\n", foo ((double) DD), foo (d), d); +} +#else + +main () +{ + printf ("%lf\n", (double) ((unsigned) DD)); + foo ((double) DD); +} +#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG12.c b/gcc/testsuite/gcc.c-torture/compile/BUG12.c new file mode 100644 index 00000000000..b32fa607176 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG12.c @@ -0,0 +1,5 @@ +long long +main () +{ + return 1.1e10; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG13.c b/gcc/testsuite/gcc.c-torture/compile/BUG13.c new file mode 100644 index 00000000000..9a302b95152 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG13.c @@ -0,0 +1,19 @@ +struct tree_common +{ + int uid; + unsigned int code : 8; + unsigned int code2 : 8; + unsigned external_attr : 1; + unsigned public_attr : 1; + +}; + +static int +duplicate_decls (x) + register struct tree_common *x; +{ + if (x->external_attr) + if (x->code) + if (x->code2) + x->public_attr = 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG16.c b/gcc/testsuite/gcc.c-torture/compile/BUG16.c new file mode 100644 index 00000000000..daeae2ca562 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG16.c @@ -0,0 +1,6 @@ +setgetlen (a) + int *a; +{ + while (*a++ & 0x80000000) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG17.c b/gcc/testsuite/gcc.c-torture/compile/BUG17.c new file mode 100644 index 00000000000..920587046ed --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG17.c @@ -0,0 +1,8 @@ +double d; + +main() +{ + int i; + + i = (int) d; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG18.c b/gcc/testsuite/gcc.c-torture/compile/BUG18.c new file mode 100644 index 00000000000..ed586a7f9d6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG18.c @@ -0,0 +1,5 @@ +main() +{ + if ((signed int) 1 < (signed int) -2147483648) + printf("true\n"); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG2.c b/gcc/testsuite/gcc.c-torture/compile/BUG2.c new file mode 100644 index 00000000000..6dc30be6502 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG2.c @@ -0,0 +1,8 @@ +BUG2 (p) int *p; +{ + int a = 0; + if (*p == a) + return 0; + else + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG21.c b/gcc/testsuite/gcc.c-torture/compile/BUG21.c new file mode 100644 index 00000000000..c8a1157cc46 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG21.c @@ -0,0 +1,22 @@ +typedef struct { + int knock_on_wood; /* leave it out and it works. */ + int f1; +} FOO; + +typedef struct { + FOO *b1; +} BAR; + +Nase () +{ + int i, j; + FOO *foop; + BAR *barp; + + for (i = 0; i < 2; i++) { + foop = &barp->b1[i]; + for (j = 0; j < foop->f1; j++) { + /* dummy() */; /* put it in and it works. */ + } + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG22.c b/gcc/testsuite/gcc.c-torture/compile/BUG22.c new file mode 100644 index 00000000000..9fd95254d3d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG22.c @@ -0,0 +1,6 @@ + +void +Rotate (float angle) +{ + float mag = (angle < 0) ? -angle : angle; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG23.c b/gcc/testsuite/gcc.c-torture/compile/BUG23.c new file mode 100644 index 00000000000..1ff429ef0ac --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG23.c @@ -0,0 +1,18 @@ +main() +{ + static char static_char_array[1]; + static char *static_char_pointer; + static char static_char; + char char_array[1]; + char *char_pointer; + char character; + + char *cp, c; + + c = cp - static_char_array; /* error */ + c = cp - static_char_pointer; + c = cp - &static_char; /* error */ + c = cp - char_array; + c = cp - char_pointer; + c = cp - &character; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG24.c b/gcc/testsuite/gcc.c-torture/compile/BUG24.c new file mode 100644 index 00000000000..7627a3ddcdd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG24.c @@ -0,0 +1,15 @@ +struct ack { + char a, b, c; +}; + +main() +{ + struct ack bad; + + foo(bad); +} + +foo(c) + struct ack c; +{ +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG25.c b/gcc/testsuite/gcc.c-torture/compile/BUG25.c new file mode 100644 index 00000000000..57441706125 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG25.c @@ -0,0 +1,5 @@ + +foo (a) +{ + __builtin_ffs (a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG3.c b/gcc/testsuite/gcc.c-torture/compile/BUG3.c new file mode 100644 index 00000000000..30e6622a566 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG3.c @@ -0,0 +1,8 @@ +BUG2 (p) char *p; +{ + int a = 0; + if (*p == a) + return 0; + else + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG4.c b/gcc/testsuite/gcc.c-torture/compile/BUG4.c new file mode 100644 index 00000000000..be6a14989c2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG4.c @@ -0,0 +1,20 @@ +int foo() +{ + char c; + + return (c ^ 30 ) > (c ^ 40 ); +/* + these also get the signal : + return (c ^ 30 ) == (c ^ 40 ); + return ((int)c ^ 30 ) > (c ^ 40 ); + also fails if c is "extern char" + + these are ok : + return (c + 30 ) > (c ^ 40 ); + return (c ^ 30 ) > (c + 40 ); + return (c ^ 30 ) + (c ^ 40 ); + return ('a' ^ 30 ) > (c ^ 40 ); + return (c ^ 40 ); + return (c ^ 30 ) > (c ^ 40 ); +*/ +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG5.c b/gcc/testsuite/gcc.c-torture/compile/BUG5.c new file mode 100644 index 00000000000..9bed7136f59 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG5.c @@ -0,0 +1,18 @@ +enum bar +{ + one, + two +}; + +enum bar foo; + +void bar() +{ + switch (foo) + { + case one: + case two: + printf ("one to two\n"); + break; + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG6.c b/gcc/testsuite/gcc.c-torture/compile/BUG6.c new file mode 100644 index 00000000000..b1394650964 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/BUG6.c @@ -0,0 +1,8 @@ +main() +{ + unsigned long L; + double D; + D = L = -3; + printf("L=%lu, D=%g\n", L, D); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/DFcmp.c b/gcc/testsuite/gcc.c-torture/compile/DFcmp.c new file mode 100644 index 00000000000..3bb253476d7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/DFcmp.c @@ -0,0 +1,281 @@ +/* { dg-require-effective-target int32plus } */ +#define type double + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)((int)&glob0)) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)((int)&glob1)) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/HIcmp.c b/gcc/testsuite/gcc.c-torture/compile/HIcmp.c new file mode 100644 index 00000000000..77b47886ed1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/HIcmp.c @@ -0,0 +1,280 @@ +#define type short + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/HIset.c b/gcc/testsuite/gcc.c-torture/compile/HIset.c new file mode 100644 index 00000000000..163cb7cbe32 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/HIset.c @@ -0,0 +1,216 @@ +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)(int)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)(int)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +int glob0, glob1; + +#define type short + +reg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = reg1; } + +reg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = indreg1; } + +reg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = imm1; } + +reg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = limm1; } + +reg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adr1; } + +reg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrreg1; } + +reg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrx1; } + +reg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = regx1; } + +indreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = reg1; } + +indreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = indreg1; } + +indreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = imm1; } + +indreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = limm1; } + +indreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adr1; } + +indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrreg1; } + +indreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrx1; } + +indreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = regx1; } + +adr0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = reg1; } + +adr0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = indreg1; } + +adr0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = imm1; } + +adr0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = limm1; } + +adr0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adr1; } + +adr0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrreg1; } + +adr0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrx1; } + +adr0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = regx1; } + +adrreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = reg1; } + +adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = indreg1; } + +adrreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = imm1; } + +adrreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = limm1; } + +adrreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adr1; } + +adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrreg1; } + +adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrx1; } + +adrreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = regx1; } + +adrx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = reg1; } + +adrx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = indreg1; } + +adrx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = imm1; } + +adrx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = limm1; } + +adrx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adr1; } + +adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrreg1; } + +adrx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrx1; } + +adrx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = regx1; } + +regx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = reg1; } + +regx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = indreg1; } + +regx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = imm1; } + +regx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = limm1; } + +regx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adr1; } + +regx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrreg1; } + +regx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrx1; } + +regx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = regx1; } + diff --git a/gcc/testsuite/gcc.c-torture/compile/PYRBUG.c b/gcc/testsuite/gcc.c-torture/compile/PYRBUG.c new file mode 100644 index 00000000000..c64c3f5e1b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/PYRBUG.c @@ -0,0 +1,17 @@ +typedef struct +{ + int v; + int h; +} Point; + +typedef struct +{ + int top, left, bottom, right; +} Rect; + +int +x_PtInRect (Point pt, Rect *r) +{ + return pt.v >= r->top && pt.v < r->bottom + && pt.h >= r->left && pt.h < r->right; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/QIcmp.c b/gcc/testsuite/gcc.c-torture/compile/QIcmp.c new file mode 100644 index 00000000000..c5161646f2c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/QIcmp.c @@ -0,0 +1,280 @@ +#define type signed char + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)11111111) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/QIset.c b/gcc/testsuite/gcc.c-torture/compile/QIset.c new file mode 100644 index 00000000000..212609dc864 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/QIset.c @@ -0,0 +1,216 @@ +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)(int)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)11111111) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)(int)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +int glob0, glob1; + +#define type char + +reg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = reg1; } + +reg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = indreg1; } + +reg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = imm1; } + +reg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = limm1; } + +reg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adr1; } + +reg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrreg1; } + +reg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrx1; } + +reg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = regx1; } + +indreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = reg1; } + +indreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = indreg1; } + +indreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = imm1; } + +indreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = limm1; } + +indreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adr1; } + +indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrreg1; } + +indreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrx1; } + +indreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = regx1; } + +adr0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = reg1; } + +adr0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = indreg1; } + +adr0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = imm1; } + +adr0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = limm1; } + +adr0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adr1; } + +adr0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrreg1; } + +adr0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrx1; } + +adr0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = regx1; } + +adrreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = reg1; } + +adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = indreg1; } + +adrreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = imm1; } + +adrreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = limm1; } + +adrreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adr1; } + +adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrreg1; } + +adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrx1; } + +adrreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = regx1; } + +adrx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = reg1; } + +adrx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = indreg1; } + +adrx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = imm1; } + +adrx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = limm1; } + +adrx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adr1; } + +adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrreg1; } + +adrx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrx1; } + +adrx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = regx1; } + +regx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = reg1; } + +regx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = indreg1; } + +regx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = imm1; } + +regx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = limm1; } + +regx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adr1; } + +regx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrreg1; } + +regx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrx1; } + +regx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = regx1; } + diff --git a/gcc/testsuite/gcc.c-torture/compile/SFset.c b/gcc/testsuite/gcc.c-torture/compile/SFset.c new file mode 100644 index 00000000000..dc7f48dd2dd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/SFset.c @@ -0,0 +1,218 @@ +/* { dg-require-effective-target int32plus } */ + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)(int)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)(int)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +int glob0, glob1; + +#define type float + +reg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = reg1; } + +reg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = indreg1; } + +reg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = imm1; } + +reg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = limm1; } + +reg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adr1; } + +reg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrreg1; } + +reg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrx1; } + +reg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = regx1; } + +indreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = reg1; } + +indreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = indreg1; } + +indreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = imm1; } + +indreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = limm1; } + +indreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adr1; } + +indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrreg1; } + +indreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrx1; } + +indreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = regx1; } + +adr0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = reg1; } + +adr0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = indreg1; } + +adr0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = imm1; } + +adr0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = limm1; } + +adr0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adr1; } + +adr0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrreg1; } + +adr0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrx1; } + +adr0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = regx1; } + +adrreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = reg1; } + +adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = indreg1; } + +adrreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = imm1; } + +adrreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = limm1; } + +adrreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adr1; } + +adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrreg1; } + +adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrx1; } + +adrreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = regx1; } + +adrx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = reg1; } + +adrx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = indreg1; } + +adrx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = imm1; } + +adrx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = limm1; } + +adrx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adr1; } + +adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrreg1; } + +adrx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrx1; } + +adrx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = regx1; } + +regx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = reg1; } + +regx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = indreg1; } + +regx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = imm1; } + +regx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = limm1; } + +regx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adr1; } + +regx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrreg1; } + +regx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrx1; } + +regx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = regx1; } + diff --git a/gcc/testsuite/gcc.c-torture/compile/SIcmp.c b/gcc/testsuite/gcc.c-torture/compile/SIcmp.c new file mode 100644 index 00000000000..4a9e0d57fd7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/SIcmp.c @@ -0,0 +1,280 @@ +#define type int + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/SIset.c b/gcc/testsuite/gcc.c-torture/compile/SIset.c new file mode 100644 index 00000000000..5fb93579f4b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/SIset.c @@ -0,0 +1,216 @@ +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)(int)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)(int)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +int glob0, glob1; + +#define type int + +reg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = reg1; } + +reg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = indreg1; } + +reg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = imm1; } + +reg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = limm1; } + +reg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adr1; } + +reg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrreg1; } + +reg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = adrx1; } + +reg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{reg0 = regx1; } + +indreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = reg1; } + +indreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = indreg1; } + +indreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = imm1; } + +indreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = limm1; } + +indreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adr1; } + +indreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrreg1; } + +indreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = adrx1; } + +indreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{indreg0 = regx1; } + +adr0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = reg1; } + +adr0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = indreg1; } + +adr0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = imm1; } + +adr0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = limm1; } + +adr0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adr1; } + +adr0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrreg1; } + +adr0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = adrx1; } + +adr0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adr0 = regx1; } + +adrreg0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = reg1; } + +adrreg0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = indreg1; } + +adrreg0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = imm1; } + +adrreg0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = limm1; } + +adrreg0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adr1; } + +adrreg0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrreg1; } + +adrreg0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = adrx1; } + +adrreg0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrreg0 = regx1; } + +adrx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = reg1; } + +adrx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = indreg1; } + +adrx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = imm1; } + +adrx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = limm1; } + +adrx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adr1; } + +adrx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrreg1; } + +adrx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = adrx1; } + +adrx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{adrx0 = regx1; } + +regx0reg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = reg1; } + +regx0indreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = indreg1; } + +regx0imm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = imm1; } + +regx0limm1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = limm1; } + +regx0adr1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adr1; } + +regx0adrreg1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrreg1; } + +regx0adrx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = adrx1; } + +regx0regx1_set (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{regx0 = regx1; } + diff --git a/gcc/testsuite/gcc.c-torture/compile/UHIcmp.c b/gcc/testsuite/gcc.c-torture/compile/UHIcmp.c new file mode 100644 index 00000000000..529e3a33fd3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/UHIcmp.c @@ -0,0 +1,280 @@ +#define type unsigned short + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/UQIcmp.c b/gcc/testsuite/gcc.c-torture/compile/UQIcmp.c new file mode 100644 index 00000000000..3e9cdebc903 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/UQIcmp.c @@ -0,0 +1,280 @@ +#define type unsigned char + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)11111111) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/USIcmp.c b/gcc/testsuite/gcc.c-torture/compile/USIcmp.c new file mode 100644 index 00000000000..69788a45b2e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/USIcmp.c @@ -0,0 +1,280 @@ +#define type unsigned int + +type glob0, glob1; + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)(11111111 & ~(__alignof__ (type) - 1))) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +reg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= reg1) return 1; else return 0;} + +reg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= indreg1) return 1; else return 0;} + +reg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= imm1) return 1; else return 0;} + +reg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= limm1) return 1; else return 0;} + +reg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adr1) return 1; else return 0;} + +reg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrreg1) return 1; else return 0;} + +reg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= adrx1) return 1; else return 0;} + +reg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (reg0 <= regx1) return 1; else return 0;} + +indreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= reg1) return 1; else return 0;} + +indreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= indreg1) return 1; else return 0;} + +indreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= imm1) return 1; else return 0;} + +indreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= limm1) return 1; else return 0;} + +indreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adr1) return 1; else return 0;} + +indreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrreg1) return 1; else return 0;} + +indreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= adrx1) return 1; else return 0;} + +indreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (indreg0 <= regx1) return 1; else return 0;} + +imm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= reg1) return 1; else return 0;} + +imm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= indreg1) return 1; else return 0;} + +imm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= imm1) return 1; else return 0;} + +imm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= limm1) return 1; else return 0;} + +imm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adr1) return 1; else return 0;} + +imm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrreg1) return 1; else return 0;} + +imm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= adrx1) return 1; else return 0;} + +imm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (imm0 <= regx1) return 1; else return 0;} + +limm0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= reg1) return 1; else return 0;} + +limm0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= indreg1) return 1; else return 0;} + +limm0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= imm1) return 1; else return 0;} + +limm0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= limm1) return 1; else return 0;} + +limm0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adr1) return 1; else return 0;} + +limm0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrreg1) return 1; else return 0;} + +limm0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= adrx1) return 1; else return 0;} + +limm0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (limm0 <= regx1) return 1; else return 0;} + +adr0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= reg1) return 1; else return 0;} + +adr0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= indreg1) return 1; else return 0;} + +adr0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= imm1) return 1; else return 0;} + +adr0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= limm1) return 1; else return 0;} + +adr0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adr1) return 1; else return 0;} + +adr0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrreg1) return 1; else return 0;} + +adr0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= adrx1) return 1; else return 0;} + +adr0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adr0 <= regx1) return 1; else return 0;} + +adrreg0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= reg1) return 1; else return 0;} + +adrreg0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= indreg1) return 1; else return 0;} + +adrreg0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= imm1) return 1; else return 0;} + +adrreg0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= limm1) return 1; else return 0;} + +adrreg0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adr1) return 1; else return 0;} + +adrreg0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrreg1) return 1; else return 0;} + +adrreg0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= adrx1) return 1; else return 0;} + +adrreg0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrreg0 <= regx1) return 1; else return 0;} + +adrx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= reg1) return 1; else return 0;} + +adrx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= indreg1) return 1; else return 0;} + +adrx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= imm1) return 1; else return 0;} + +adrx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= limm1) return 1; else return 0;} + +adrx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adr1) return 1; else return 0;} + +adrx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrreg1) return 1; else return 0;} + +adrx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= adrx1) return 1; else return 0;} + +adrx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (adrx0 <= regx1) return 1; else return 0;} + +regx0reg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= reg1) return 1; else return 0;} + +regx0indreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= indreg1) return 1; else return 0;} + +regx0imm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= imm1) return 1; else return 0;} + +regx0limm1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= limm1) return 1; else return 0;} + +regx0adr1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adr1) return 1; else return 0;} + +regx0adrreg1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrreg1) return 1; else return 0;} + +regx0adrx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= adrx1) return 1; else return 0;} + +regx0regx1 (r0, r1, x0, x1, p0, p1) +type r0, r1; type *p0, *p1; +{if (regx0 <= regx1) return 1; else return 0;} + diff --git a/gcc/testsuite/gcc.c-torture/compile/a.c b/gcc/testsuite/gcc.c-torture/compile/a.c new file mode 100644 index 00000000000..47fb1f493f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/a.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a & 65535; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/a1.c b/gcc/testsuite/gcc.c-torture/compile/a1.c new file mode 100644 index 00000000000..654781d05ea --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/a1.c @@ -0,0 +1,7 @@ +int +foo (a, p) + int *p; +{ + p[0] = 85 * a; + p[1] = -86 * a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/a3.c b/gcc/testsuite/gcc.c-torture/compile/a3.c new file mode 100644 index 00000000000..85d2a242630 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/a3.c @@ -0,0 +1,12 @@ +foo (a) +{ + int i; + + for (i = 1; i < a; i++) + ; + { + int b = (int) &foo; + + return (a & b) == 0; + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/aa.c b/gcc/testsuite/gcc.c-torture/compile/aa.c new file mode 100644 index 00000000000..61a4147afa6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/aa.c @@ -0,0 +1,8 @@ +#define w 20 +#define c 1 + +foo (a) + unsigned a; +{ + return ((a & ((1 << w) - 1)) << c) > 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/aaa.c b/gcc/testsuite/gcc.c-torture/compile/aaa.c new file mode 100644 index 00000000000..e31fb567c1c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/aaa.c @@ -0,0 +1,11 @@ +foo (a, b) +{ + int t; + while (b < 0) + { + t = a; + a = b; + b = t; + } + return a + b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/abs.c b/gcc/testsuite/gcc.c-torture/compile/abs.c new file mode 100644 index 00000000000..6a746b12639 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/abs.c @@ -0,0 +1,9 @@ +foo (a) +{ + return __builtin_abs (a); +} + +main () +{ + printf ("%d %d\n", foo (0x80000000), foo (12)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ac.c b/gcc/testsuite/gcc.c-torture/compile/ac.c new file mode 100644 index 00000000000..1d3c085eec1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ac.c @@ -0,0 +1,30 @@ +barfoo (a) +{ + return (a << 16) & ~0xffff; +} + +foobar (a) +{ + return ((unsigned short) a) << 15;} + +foo (a) +{ + return (a & 0x121) << 31; +} + +bar (a) +{ + return (a & ~0xffff) << 16; +} + +main () +{ + int a; + + for (a = 1; a; a += a) + { + printf ("%d", (foo (a))); + } + puts (""); +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/acc.c b/gcc/testsuite/gcc.c-torture/compile/acc.c new file mode 100644 index 00000000000..a4a027a5fce --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/acc.c @@ -0,0 +1,8 @@ +foo (a) +{ + int b = a + 1; + int c = (short) a; + if (b) + return b; + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/add.c b/gcc/testsuite/gcc.c-torture/compile/add.c new file mode 100644 index 00000000000..d796e41c712 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/add.c @@ -0,0 +1,5 @@ +foo (a, b, p) + int *p; +{ + return 34 + *p; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/add386.c b/gcc/testsuite/gcc.c-torture/compile/add386.c new file mode 100644 index 00000000000..bfdffbfe2f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/add386.c @@ -0,0 +1,4 @@ +main (a) +{ + return a + 128; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/addcc.c b/gcc/testsuite/gcc.c-torture/compile/addcc.c new file mode 100644 index 00000000000..cf52307aa97 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/addcc.c @@ -0,0 +1,18 @@ +foo (p, a, b) + int *p; + int a; + int b; +{ + + a += p[0]; + b += p[1]; + if (a == 0) + return b; + return a; +} + + +bar (a) +{ + return -a > 0 ? 1 : 2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andm.c b/gcc/testsuite/gcc.c-torture/compile/andm.c new file mode 100644 index 00000000000..17101ae3050 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andm.c @@ -0,0 +1,15 @@ +foo (p) + int *p; +{ + return (*p & 255) == 0; +} + +bar (a) +{ + return (a & 0xfff00000) == 0; +} + +main () +{ + printf ("%d%d\n", bar (-1), bar(0)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andmem.c b/gcc/testsuite/gcc.c-torture/compile/andmem.c new file mode 100644 index 00000000000..10bad00f445 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andmem.c @@ -0,0 +1,22 @@ +void p1 (p) int *p; +{ *p &= ~0xff; +} +void p2 (p) int *p; +{ *p &= ~0xff00; +} +void p3 (p) int *p; +{ *p &= ~0xffff0000; +} +void p4 (p) int *p; +{ *p &= ~0xffff; +} + +main () +{ + int a; + + a = 0x12345678; p1 (&a); printf ("%x\n", a); + a = 0x12345678; p2 (&a); printf ("%x\n", a); + a = 0x12345678; p3 (&a); printf ("%x\n", a); + a = 0x12345678; p4 (&a); printf ("%x\n", a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andn.c b/gcc/testsuite/gcc.c-torture/compile/andn.c new file mode 100644 index 00000000000..2e38dd0e36e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andn.c @@ -0,0 +1,5 @@ +foo (a) +{ + int b = 0x1fff; + return a & ~b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andok.c b/gcc/testsuite/gcc.c-torture/compile/andok.c new file mode 100644 index 00000000000..d55bd01b70d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andok.c @@ -0,0 +1,6 @@ +foo (a, b, p) + int *p; +{ + p[1] = a & 0xfff0000; + p[2] = b & 0xfff0000; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andsi.c b/gcc/testsuite/gcc.c-torture/compile/andsi.c new file mode 100644 index 00000000000..b9c3c76de03 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andsi.c @@ -0,0 +1,4 @@ +foo () +{ + return (int)&foo; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/andsparc.c b/gcc/testsuite/gcc.c-torture/compile/andsparc.c new file mode 100644 index 00000000000..62f0de003b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/andsparc.c @@ -0,0 +1,11 @@ +foo (int *p) +{ + int a, b; + + a = 123456; + a += p[0]; + b = p[0]; + if (a == 0) + return b; + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/aos.c b/gcc/testsuite/gcc.c-torture/compile/aos.c new file mode 100644 index 00000000000..77c92f677e4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/aos.c @@ -0,0 +1,8 @@ +foo (p) + int *p; +{ + if ((int) p > 0) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/arr.c b/gcc/testsuite/gcc.c-torture/compile/arr.c new file mode 100644 index 00000000000..ed56667dd75 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/arr.c @@ -0,0 +1,9 @@ +foo (a, b, c) +{ + bar (a, b); + { + int arr[10]; + arr[c] = b; + bar (arr[0], arr[1]); + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/as.c b/gcc/testsuite/gcc.c-torture/compile/as.c new file mode 100644 index 00000000000..172f88355d9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/as.c @@ -0,0 +1,14 @@ + +#define S 31 +#define A 17 + +foo (a) + unsigned a; +{ + return (a >> S) & ((1 << A) - 1); +} + +main () +{ + printf ("%d%d\n", foo (-1), foo (0)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ase.c b/gcc/testsuite/gcc.c-torture/compile/ase.c new file mode 100644 index 00000000000..2d3d8edbd0b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ase.c @@ -0,0 +1,10 @@ +ase (p) + short *p; +{ + int a; + a = p[1]; + p[2] = a; + if ((short) a) + p[a]++; + return (a == 0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/b.c b/gcc/testsuite/gcc.c-torture/compile/b.c new file mode 100644 index 00000000000..498d7552af9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/b.c @@ -0,0 +1,4 @@ +main () +{ + *(short *) 25 = 123; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/b1.c b/gcc/testsuite/gcc.c-torture/compile/b1.c new file mode 100644 index 00000000000..b6737594cb1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/b1.c @@ -0,0 +1,11 @@ +foo (long long x) +{ + if (x--) + return 255; + return 0; +} + +main () +{ + printf ("%d\n", foo (0)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/b2.c b/gcc/testsuite/gcc.c-torture/compile/b2.c new file mode 100644 index 00000000000..96e4556a53a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/b2.c @@ -0,0 +1,24 @@ + +struct s +{ + unsigned a : 8; + unsigned b : 8; + unsigned c : 8; + unsigned d : 8; +}; + +/* +struct +{ + unsigned a : 8; + unsigned b : 16; + unsigned c : 8; +}; +*/ + +struct s +foo (struct s s, int i) +{ + s.b = i; + return s; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/b3.c b/gcc/testsuite/gcc.c-torture/compile/b3.c new file mode 100644 index 00000000000..af693f77931 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/b3.c @@ -0,0 +1,12 @@ +struct tree_common +{ + unsigned int code : 9; + unsigned int code2 : 7; +}; + +static int +duplicate_decls (x) + register struct tree_common x; +{ + return x.code2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/b88.c b/gcc/testsuite/gcc.c-torture/compile/b88.c new file mode 100644 index 00000000000..971c7c76d92 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/b88.c @@ -0,0 +1,12 @@ +foo (double d) +{ + d = -d; + if (d < 0.0) + return 1; + return 2; +} + +main () +{ + foo (0.0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bad.c b/gcc/testsuite/gcc.c-torture/compile/bad.c new file mode 100644 index 00000000000..8cc84973b72 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bad.c @@ -0,0 +1,26 @@ +typedef union longlong +{ + struct {unsigned short h0, h1, h2, h3;} h; + struct {signed long low, high;} si; + struct {unsigned long low, high;} ui; + signed long long sll; + unsigned long long ull; +} long_long; + + +long long +__negdi2 (u) + long long u; +{ + long_long uu; + + uu.sll = u; + + uu.si.low = -uu.si.low; + if (uu.si.low == 0) + uu.si.high = -uu.si.high; + else + uu.si.high = ~uu.si.high; + + return uu.sll; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/band.c b/gcc/testsuite/gcc.c-torture/compile/band.c new file mode 100644 index 00000000000..74b02fd3b34 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/band.c @@ -0,0 +1,16 @@ +foo (a) +{ + return (a & (1 << 31)) != 0; +} + +main () +{ + if (foo (0)) + puts ("foo"); + else + puts ("bar"); + if (foo (~0)) + puts ("foo"); + else + puts ("bar"); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bb0.c b/gcc/testsuite/gcc.c-torture/compile/bb0.c new file mode 100644 index 00000000000..aab6d683fbd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bb0.c @@ -0,0 +1,5 @@ +foo (a) +{ + return (a & 0xfff000) != 0; + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bb1.c b/gcc/testsuite/gcc.c-torture/compile/bb1.c new file mode 100644 index 00000000000..3f9aebe0364 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bb1.c @@ -0,0 +1,8 @@ +foo (a) +{ + int b = 32; + if (b & a) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bbb.c b/gcc/testsuite/gcc.c-torture/compile/bbb.c new file mode 100644 index 00000000000..837dd9ecf93 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bbb.c @@ -0,0 +1,12 @@ +struct looksets + { + int lset[10]; + }; + +struct looksets lkst[]; + +flset( p ) +struct looksets *p; +{ + p-- > lkst; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bc.c b/gcc/testsuite/gcc.c-torture/compile/bc.c new file mode 100644 index 00000000000..c713bb61b3d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bc.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a % (1 << b); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bcopy.c b/gcc/testsuite/gcc.c-torture/compile/bcopy.c new file mode 100644 index 00000000000..aed994e578a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bcopy.c @@ -0,0 +1,68 @@ +void +bcopy1 (s, d, c) + long long *s; + long long *d; + int c; +{ + int i; + c = c / 8; + for (i = 0; i < c; i++) + d[i] = s[i]; +} + +void +bcopy2 (s, d, c) + long *s; + long *d; + int c; +{ + int i; + c = c / 4; + for (i = 0; i < c; i++) + d[i] = s[i]; +} + + +void +bcopy3 (s, d, c) + char *s; + char *d; + int c; +{ + long long z0, z1; + int r = d - s; + + int i; + + c /= 16; + + z0 = *((long long *) s); + s += 8; + z1 = *((long long *) s); + s += 8; + for (i = 0; i < c; i++) + { + *(long long *)(s + r) = z0; + z0 = *((long long *) s); + s += 8; + *(long long *)(s + r) = z1; + z1 = *((long long *) s); + s += 8; + } +} + +#if defined(STACK_SIZE) && STACK_SIZE < 16384 +#define BYTES STACK_SIZE +#else +#define BYTES 16384 +#endif + +main () +{ + long long s[BYTES / 8]; + long long d[BYTES / 8]; + int i; + + for (i = 1; i < 67108864 / BYTES; i++) + bcopy (s, d, BYTES); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bf.c b/gcc/testsuite/gcc.c-torture/compile/bf.c new file mode 100644 index 00000000000..821623df09c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bf.c @@ -0,0 +1,31 @@ +typedef unsigned long uint32; +typedef signed long sint32; + +uint32 +ext (sint32 src, unsigned o5, unsigned w5) +{ + return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5); +} + +uint32 +extu (uint32 src, unsigned o5, unsigned w5) +{ + return (w5 == 0) ? src >> o5 : (src << (( - o5 - w5) & 31)) >> (32 - w5); +} + +uint32 +mak (uint32 src, unsigned o5, unsigned w5) +{ + return (w5 == 0) ? src << o5 : (src << (32 - w5)) >> (( - o5 - w5) & 31); +} + +uint32 +rot (uint32 src, unsigned o5) +{ + return (src >> o5) | (src << (( - o5) & 31)); +} + +main (int argc, char **argv) +{ + printf ("%x\n", clr (0xffffffff, atoi (argv[2]), atoi (argv[1]))); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bfins.c b/gcc/testsuite/gcc.c-torture/compile/bfins.c new file mode 100644 index 00000000000..e626d82b3cb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bfins.c @@ -0,0 +1,15 @@ +struct foo +{ + unsigned j : 16; + unsigned i : 16; +}; + +struct foo +foo (a, b) + struct foo a; + int b; +{ + a.j = 123; + a.i = b; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bfx.c b/gcc/testsuite/gcc.c-torture/compile/bfx.c new file mode 100644 index 00000000000..d47bd7d18bc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bfx.c @@ -0,0 +1,9 @@ +foo (x, c) +{ + return x << -c; +} + +main () +{ + printf ("%x\n", foo (0xf05, -4)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bge.c b/gcc/testsuite/gcc.c-torture/compile/bge.c new file mode 100644 index 00000000000..55f4788299a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bge.c @@ -0,0 +1,7 @@ +foo (a) + double a; +{ + if (a >= 0) + return 1; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bit.c b/gcc/testsuite/gcc.c-torture/compile/bit.c new file mode 100644 index 00000000000..e76bb45e7cd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bit.c @@ -0,0 +1,13 @@ +bar (a) +{ + return (a == 0); +} + +foo (a) + int a; +{ + if ((a & (1 << 26)) >= 0) + return 1; + else + return 2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bitf.c b/gcc/testsuite/gcc.c-torture/compile/bitf.c new file mode 100644 index 00000000000..5b0aefc83d4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bitf.c @@ -0,0 +1,17 @@ +#define int unsigned + +struct foo +{ + int aa : 1; + int a : 9; + int c : 16; + int d : 6; +}; + + +int +foo (a, b) + struct foo a; +{ + return a.d == 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bitw.c b/gcc/testsuite/gcc.c-torture/compile/bitw.c new file mode 100644 index 00000000000..585cd32e603 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bitw.c @@ -0,0 +1,9 @@ +foo (a) + unsigned a; +{ + unsigned b = 0; + + if ((a & 12345678) > b) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/blk.c b/gcc/testsuite/gcc.c-torture/compile/blk.c new file mode 100644 index 00000000000..18a9545cc28 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/blk.c @@ -0,0 +1,18 @@ +struct +{ + double a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t; +} foo, bar; + +foobar () +{ + foo = bar; + xxx (&foo, &bar); +} + +main () +{ + bar.g = 1.0; + foo.g = 2.0; + foobar (); + printf ("%lf\n", foo.g); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bt.c b/gcc/testsuite/gcc.c-torture/compile/bt.c new file mode 100644 index 00000000000..ac20c05674d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bt.c @@ -0,0 +1,7 @@ +main () +{ + int i; + + for (i = 1000000; --i;) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bt386.c b/gcc/testsuite/gcc.c-torture/compile/bt386.c new file mode 100644 index 00000000000..283ab5fa64a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bt386.c @@ -0,0 +1,18 @@ +foo (a, b) +{ + return (a & (1 << b)) != 0; +} + +bar (a, b) +{ + a ^= (1 << b); + return a != 0; +} + +main () +{ + int i; + for (i = 0; i < 32; i++) + printf ("%d ", foo (0x8000000f, i)); + puts (""); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bug.c b/gcc/testsuite/gcc.c-torture/compile/bug.c new file mode 100644 index 00000000000..447eb7af297 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bug.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a - 65536; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bugc.c b/gcc/testsuite/gcc.c-torture/compile/bugc.c new file mode 100644 index 00000000000..b2ce1fad8ac --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bugc.c @@ -0,0 +1,7 @@ + +int +reg0indreg1 (r0, p1) + short r0; short *p1; +{ + return (r0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/buns.c b/gcc/testsuite/gcc.c-torture/compile/buns.c new file mode 100644 index 00000000000..f206bfaed0c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/buns.c @@ -0,0 +1,12 @@ +foo (a) +{ + int bar = 0; + + return (unsigned) (a - 1) <= (unsigned) bar; +} + +main () +{ + if (foo (-1)) + puts ("The largest possible unsigned <= 0 on this machine..."); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/bx.c b/gcc/testsuite/gcc.c-torture/compile/bx.c new file mode 100644 index 00000000000..274fb015cf5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bx.c @@ -0,0 +1,12 @@ +unsigned +good (unsigned src, unsigned o5, unsigned w5) +{ + return src & ~((w5 == 0) ? (~0 << o5) : (1 << o5)); +} + +unsigned +bad (unsigned src, unsigned o5, unsigned w5) +{ + return src & ((w5 == 0) ? ~(~0 << o5) : ~(1 << o5)); +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/c.c b/gcc/testsuite/gcc.c-torture/compile/c.c new file mode 100644 index 00000000000..384ee3e3cf3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/c.c @@ -0,0 +1,17 @@ +foo (a, b) + long long a, b; +{ + if (a & ~b) + return 1; + else + return 0; +} + +bar (a, b) + long long a, b; +{ + if (a & ~b & ((long long) 87612378)) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/c1.c b/gcc/testsuite/gcc.c-torture/compile/c1.c new file mode 100644 index 00000000000..f50d437f60b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/c1.c @@ -0,0 +1,7 @@ +unsigned +rec (a, b) + unsigned a; + unsigned b; +{ + return a * rec (a - 1, b + 1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/c2.c b/gcc/testsuite/gcc.c-torture/compile/c2.c new file mode 100644 index 00000000000..ef5a71188d3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/c2.c @@ -0,0 +1,5 @@ +foo (a) +{ + bar (a); + bar (a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/call.c b/gcc/testsuite/gcc.c-torture/compile/call.c new file mode 100644 index 00000000000..c8106038371 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/call.c @@ -0,0 +1,7 @@ +int foo () {} + +main (a, b) +{ + foo (foo (a, b), foo (b, a)); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/call386.c b/gcc/testsuite/gcc.c-torture/compile/call386.c new file mode 100644 index 00000000000..c82a3be3450 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/call386.c @@ -0,0 +1,20 @@ +void foo () {} + +int main () +{ + int i; + for (i = 100000; i >= 0; i--) + { + foo (); + foo (); + foo (); + foo (); + foo (); + foo (); + foo (); + foo (); + foo (); + foo (); + } + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/callind.c b/gcc/testsuite/gcc.c-torture/compile/callind.c new file mode 100644 index 00000000000..74c0f1f9cef --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/callind.c @@ -0,0 +1,8 @@ +call (foo, a) + int (**foo) (); +{ + + (foo)[1] = call; + + foo[a] (1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cc.c b/gcc/testsuite/gcc.c-torture/compile/cc.c new file mode 100644 index 00000000000..e29bec49d41 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cc.c @@ -0,0 +1,96 @@ +cc8 (a, b) +{ + if (a < 0) + goto L1; + if (a == 0) + goto L2; + L1:b++; + L2:b++; + return b; +} + +cc7 (a) + long long a; +{ + if (a < 0) + return 1; + else + return 0; +} + +cc6 (float a, double p) +{ + p = a; + if (p < 0) + return p; + else + return p + 1; +} + +cc5 (p, a) + char *p; + char a; +{ + p[2] = a; + if (a) + return 0; + else + return 1; +} + + +cc4 (a, b, p) + int a, b; + int *p; +{ + a = (int short)b; + *p = a; + if ((int) a < 0) + return 0; + else + return 1; +} + + +cc1 (a, b) +{ + int x = 0; + + if ((int) a < (int) b) + { + if ((unsigned) a < (unsigned) b) + x++; + x++; + } + + return x; +} + +cc2 (a, b) +{ + int x = 0; + + if ((int) a <= (int) b) + { + if ((int) a < (int) b) + x++; + x++; + } + + return x; +} + +cc3 (a, b) +{ + int x = 0; + + a += b; + if ((unsigned) a > 0) + { + if (a == 0) + x++; + x++; + } + + return x; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/charmtst.c b/gcc/testsuite/gcc.c-torture/compile/charmtst.c new file mode 100644 index 00000000000..2945f198e5e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/charmtst.c @@ -0,0 +1,15 @@ +c_move_tst (char b) +{ + char a; + + a = b; + b = 'b'; + foo (a); + foo (b); + foo (a); + bar (a, b); + b = a; + if (b == 0) + a++; + return a + b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmb.c b/gcc/testsuite/gcc.c-torture/compile/cmb.c new file mode 100644 index 00000000000..1fd946182ba --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cmb.c @@ -0,0 +1,6 @@ +foo (p1, p2) + short p1, *p2; +{ + int a; + return (int) p1 + (int) *p2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmp.c b/gcc/testsuite/gcc.c-torture/compile/cmp.c new file mode 100644 index 00000000000..a82fe424735 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cmp.c @@ -0,0 +1,11 @@ +struct fooalign {char x; double d;}; +union fooround {long x; double d;}; + +int +foo () +{ + int extra = 4; + if (extra < sizeof (union fooround)) + extra = sizeof (union fooround); + return extra; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmphi.c b/gcc/testsuite/gcc.c-torture/compile/cmphi.c new file mode 100644 index 00000000000..1ffc2140fba --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cmphi.c @@ -0,0 +1,4 @@ +foo (short *p, short a) +{ + return a < *p; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmpsi386.c b/gcc/testsuite/gcc.c-torture/compile/cmpsi386.c new file mode 100644 index 00000000000..50b08d7126d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cmpsi386.c @@ -0,0 +1,14 @@ +foo (a, p) + register int a; + int *p; +{ + + for (a = 10000000; a >= *p; a--) + ; +} + +main () +{ + int a; + foo (a, a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmul.c b/gcc/testsuite/gcc.c-torture/compile/cmul.c new file mode 100644 index 00000000000..cce20bc358d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cmul.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a * 84; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cn1.c b/gcc/testsuite/gcc.c-torture/compile/cn1.c new file mode 100644 index 00000000000..866778ca199 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cn1.c @@ -0,0 +1,5 @@ +int +foo () +{ + return 7561; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/comb.c b/gcc/testsuite/gcc.c-torture/compile/comb.c new file mode 100644 index 00000000000..a4689079b79 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/comb.c @@ -0,0 +1,7 @@ +foo (a, b) +{ + int c = a & b; + if ((a & b) == 0) + return 0; + return c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/consec.c b/gcc/testsuite/gcc.c-torture/compile/consec.c new file mode 100644 index 00000000000..fd76cd2eec4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/consec.c @@ -0,0 +1,17 @@ +int glob; + +conseq (a, b, c, d) + int *a, *b; +{ + a[2] = d; + a[1] = c; + sequence (a, b, c, d); + sequence (d, c, b, a); + b[0] = 0; + b[1] = 123; + a[0] = 321; + a[1] = 0; + sequence (111, 0, 0, 222, 0, 333); + ((int *)glob)[2] = c; + ((int *)glob)[3] = d; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/const.c b/gcc/testsuite/gcc.c-torture/compile/const.c new file mode 100644 index 00000000000..209fc768887 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/const.c @@ -0,0 +1,4 @@ +main (a) +{ + return a + (~0 - 240); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/conv.c b/gcc/testsuite/gcc.c-torture/compile/conv.c new file mode 100644 index 00000000000..70fc024127c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/conv.c @@ -0,0 +1,32 @@ +double +u2d (unsigned int u) +{ + return u; +} + +double +i2d (signed int i) +{ + return i; +} + +unsigned int +d2u (double d) +{ + return d; +} + +signed int +d2i (double d) +{ + return d; +} + +main () +{ + printf ("%lf, %lf, %lf\n", u2d (~0), u2d (1 << 31), u2d (1)); + printf ("%lf, %lf, %lf\n", i2d (~0), i2d (1 << 31), i2d (1)); + + printf ("%u, %u, %u\n", d2u (u2d (~0)), d2u (u2d (1 << 31)), d2u (u2d (1))); + printf ("%d, %d, %d\n", d2i (i2d (~0)), d2i (i2d (1 << 31)), d2i (i2d (1))); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/conv_tst.c b/gcc/testsuite/gcc.c-torture/compile/conv_tst.c new file mode 100644 index 00000000000..513d6a2471e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/conv_tst.c @@ -0,0 +1,66 @@ +#define ID_1 2400000000.0 +#define ID_2 1.7 +#define ID_3 -1.7 + +unsigned ui; +int si; + +conv_i1 () +{ +/* + ui = (unsigned) ID_1; + si = (int) ID_1; +*/ +} + +conv_i2 () +{ + ui = (unsigned) ID_2; + si = (int) ID_2; +} + +conv_i3 () +{ +/* ui = (unsigned) ID_3;*/ + si = (int) ID_3; +} + +conv_1 (d) + double d; +{ + ui = (unsigned) d; +/* + si = (int) d; +*/ +} + +double +foo (u) + unsigned u; +{ + return u; +} + +main () +{ + printf ("%lf\n", foo (2400000000)); + + conv_i1 (); + printf ("%lf, %u, %d\n", ID_1, ui, si); + + conv_i2 (); + printf ("%lf, %u, %d\n", ID_2, ui, si); + + conv_i3 (); + printf ("%lf, %u, %d\n", ID_3, ui, si); + + conv_1 (ID_1); + printf ("%lf, %u, %d\n", ID_1, ui, si); + + conv_1 (ID_2); + printf ("%lf, %u, %d\n", ID_2, ui, si); + + conv_1 (ID_3); + printf ("%lf, %u, %d\n", ID_3, ui, si); + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cp.c b/gcc/testsuite/gcc.c-torture/compile/cp.c new file mode 100644 index 00000000000..04b1420cb30 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cp.c @@ -0,0 +1,42 @@ +struct _obstack_chunk +{ + char *limit; + struct _obstack_chunk *prev; + char contents[4]; +}; + +struct obstack +{ + long chunk_size; + struct _obstack_chunk* chunk; + char *object_base; + char *next_free; + char *chunk_limit; + int temp; + int alignment_mask; + struct _obstack_chunk *(*chunkfun) (); + void (*freefun) (); +}; + +struct fooalign {char x; double d;}; +union fooround {long x; double d;}; + +void +_obstack_begin (h, size, alignment, chunkfun, freefun) + struct obstack *h; + int size; + int alignment; + void * (*chunkfun) (); + void (*freefun) (); +{ + register struct _obstack_chunk* chunk; + + if (alignment == 0) + alignment = ((char *)&((struct fooalign *) 0)->d - (char *)0); + if (size == 0) + { + int extra = 4; + if (extra < (sizeof (union fooround))) + extra = (sizeof (union fooround)); + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/csebug.c b/gcc/testsuite/gcc.c-torture/compile/csebug.c new file mode 100644 index 00000000000..f49f6842c1a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/csebug.c @@ -0,0 +1,7 @@ + +int +reg0indreg1 (r0, p1) + short r0; short *p1; +{ + return (r0 + *p1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/cvt.c b/gcc/testsuite/gcc.c-torture/compile/cvt.c new file mode 100644 index 00000000000..716659c4798 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/cvt.c @@ -0,0 +1,9 @@ +foo (p) + unsigned char *p; +{ + unsigned char a = 0; + + if (*p > 0) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/d.c b/gcc/testsuite/gcc.c-torture/compile/d.c new file mode 100644 index 00000000000..5fca120d85a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/d.c @@ -0,0 +1,19 @@ +long long unsigned +str2llu (str) + char *str; +{ + long long unsigned acc; + long long b = 10; + char d; + acc = *str++ - '0'; + for (;;) + { + d = *str++; + if (d == '\0') + break; + d -= '0'; + acc = acc * 10 + d; + } + + return acc; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dbl_parm.c b/gcc/testsuite/gcc.c-torture/compile/dbl_parm.c new file mode 100644 index 00000000000..ce5ba4f16d5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dbl_parm.c @@ -0,0 +1,10 @@ +foo (a, b, c) + double a; + int b; + double c; +{ + if (b) + return a + c; + else + return a - c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dblbug.c b/gcc/testsuite/gcc.c-torture/compile/dblbug.c new file mode 100644 index 00000000000..cd13b796297 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dblbug.c @@ -0,0 +1,21 @@ +union real_extract +{ + double d; + int i[sizeof (double ) / sizeof (int)]; +}; + +typedef struct +{ + int zzzz; +} *rtx; + +rtx +immed_real_const_1 (d) + double d; +{ + union real_extract u; + register rtx r; + + u.d = d; + foo (&(r->zzzz), &u); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ddd.c b/gcc/testsuite/gcc.c-torture/compile/ddd.c new file mode 100644 index 00000000000..b0b6809dd69 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ddd.c @@ -0,0 +1,7 @@ +int foo; +int bar; + +main () +{ + return foo + bar; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dead.c b/gcc/testsuite/gcc.c-torture/compile/dead.c new file mode 100644 index 00000000000..795f7c7e467 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dead.c @@ -0,0 +1,5 @@ +foo (a) +{ + ++a; + return a == 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/delay.c b/gcc/testsuite/gcc.c-torture/compile/delay.c new file mode 100644 index 00000000000..c776383520a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/delay.c @@ -0,0 +1,11 @@ +foo (a, b) +{ + if (a == 1) + goto foo1; + if (a == 2) + goto foo2; + foo1: + return 2; + foo2: + return 3; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/di.c b/gcc/testsuite/gcc.c-torture/compile/di.c new file mode 100644 index 00000000000..476bf700fb3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/di.c @@ -0,0 +1,12 @@ +long long +foo (a, b) + long long a, b; +{ + return a * b; +} + +main () +{ + int a = foo ((long long) 2, (long long) 3); + printf ("%d\n", a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dic.c b/gcc/testsuite/gcc.c-torture/compile/dic.c new file mode 100644 index 00000000000..9c2c9f90fd6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dic.c @@ -0,0 +1,5 @@ +unsigned long long +main () +{ + return (unsigned long long) 7816234 << 671111; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dilayout.c b/gcc/testsuite/gcc.c-torture/compile/dilayout.c new file mode 100644 index 00000000000..4bba661c0a4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dilayout.c @@ -0,0 +1,33 @@ +struct ii +{ + int a; + int b; +}; + +struct foo +{ + int a; + struct ii ab; + int b; +}; + +struct ii +foo (int *p, struct foo a) +{ + p[0] = a.a; + p[1] = a.ab.a; + p[2] = a.ab.b; + p[3] = a.b; + return a.ab; +} + +str (struct ii ab, struct ii *p) +{ + *p = ab; +} + +ll (long long ab, long long *p) +{ + *p = ab; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/dimove.c b/gcc/testsuite/gcc.c-torture/compile/dimove.c new file mode 100644 index 00000000000..7caf3fa468b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dimove.c @@ -0,0 +1,4 @@ +foo (long long *p) +{ + p[0] = p[1]; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dimul.c b/gcc/testsuite/gcc.c-torture/compile/dimul.c new file mode 100644 index 00000000000..c8529565fa9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dimul.c @@ -0,0 +1,6 @@ +long long +foo (a, b) + long long a, b; +{ + return a * b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/div.c b/gcc/testsuite/gcc.c-torture/compile/div.c new file mode 100644 index 00000000000..1f0904a649d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/div.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a / b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/divdf.c b/gcc/testsuite/gcc.c-torture/compile/divdf.c new file mode 100644 index 00000000000..5ea89ae3ddc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/divdf.c @@ -0,0 +1,5 @@ +double +foo (float a, float b) +{ + return (double)a / (double)b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dm.c b/gcc/testsuite/gcc.c-torture/compile/dm.c new file mode 100644 index 00000000000..67c60ee9820 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dm.c @@ -0,0 +1,24 @@ +struct dm +{ + unsigned q; + unsigned r; +}; + +struct dm +dm (a, b) + unsigned a, b; +{ + struct dm qr; + + qr.q = a / b; + qr.r = a % b; + return qr; +} + +main () +{ + struct dm qr; + + qr = dm (100, 30); + printf ("%u, %u\n", qr.q, qr.r); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/dshift.c b/gcc/testsuite/gcc.c-torture/compile/dshift.c new file mode 100644 index 00000000000..94750cc3cbc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/dshift.c @@ -0,0 +1,10 @@ +foo (b, c) + unsigned b, c; +{ + return (b << 12) | (c >> 20); +} + +main () +{ + printf ("0x%x\n", foo (0x11223344, 0xaabbccdd)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/e.c b/gcc/testsuite/gcc.c-torture/compile/e.c new file mode 100644 index 00000000000..fa20e00ef8f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/e.c @@ -0,0 +1,10 @@ +foo (short a, int *p, short *s) +{ + int i; + for (i = 10; i >= 0; i--) + { + a = (short) bar (); + p[i] = a; + s[i] = a; + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ex.c b/gcc/testsuite/gcc.c-torture/compile/ex.c new file mode 100644 index 00000000000..f5d90fd2e65 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ex.c @@ -0,0 +1,11 @@ +foo (a, b) +{ + if ((a & (1 << b)) == 0) + return 1; + return 0; +} + +main () +{ + printf ("%d\n", foo ()); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ext.c b/gcc/testsuite/gcc.c-torture/compile/ext.c new file mode 100644 index 00000000000..9e8604ef2b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ext.c @@ -0,0 +1,23 @@ +/* The bit-field below would have a problem if __INT_MAX__ is too + small. */ +#if __INT_MAX__ < 2147483647 +int +main (void) +{ + exit (0); +} +#else +struct foo +{ + unsigned b31 : 1; + unsigned b30 : 1; + unsigned b29 : 1; + unsigned b28 : 1; + unsigned rest : 28; +}; +foo(a) + struct foo a; +{ + return a.b30; +} +#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/f1.c b/gcc/testsuite/gcc.c-torture/compile/f1.c new file mode 100644 index 00000000000..446acc6e1a1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/f1.c @@ -0,0 +1,5 @@ +double +foo () +{ + return 1.2587624368724; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/f2.c b/gcc/testsuite/gcc.c-torture/compile/f2.c new file mode 100644 index 00000000000..8bb384902b9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/f2.c @@ -0,0 +1,4 @@ +foo (double *p) +{ + p[0] = p[1]; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/fdmul.c b/gcc/testsuite/gcc.c-torture/compile/fdmul.c new file mode 100644 index 00000000000..711707b51fc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/fdmul.c @@ -0,0 +1,2 @@ +double +foo (float a, float b) { return (double) a * (double) b; } diff --git a/gcc/testsuite/gcc.c-torture/compile/flo.c b/gcc/testsuite/gcc.c-torture/compile/flo.c new file mode 100644 index 00000000000..2a213b7ab79 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/flo.c @@ -0,0 +1,7 @@ +foo (a) + double a; +{ + double b = 0.0; + + return (a == 0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/float.c b/gcc/testsuite/gcc.c-torture/compile/float.c new file mode 100644 index 00000000000..b6789203b5d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/float.c @@ -0,0 +1,6 @@ +double +foo (a, b, c) + double a, b, c; +{ + return a * b + c * a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/flt_const.c b/gcc/testsuite/gcc.c-torture/compile/flt_const.c new file mode 100644 index 00000000000..65700ba7730 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/flt_const.c @@ -0,0 +1,5 @@ +double +foo () +{ + return 3.141592653589793238462643; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/fnul.c b/gcc/testsuite/gcc.c-torture/compile/fnul.c new file mode 100644 index 00000000000..b0c9816adf7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/fnul.c @@ -0,0 +1,23 @@ +main () +{ + int i; + int f; + + for (i = 0;; i--) + { + f = 0; + + if ((i & (i - 1)) == 0) + { + printf ("d"); + f = 1; + } + if ((i & -i) == i) + { + printf ("t"); + f = 1; + } + if (f) + printf ("%d\n", i); + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/foo.c b/gcc/testsuite/gcc.c-torture/compile/foo.c new file mode 100644 index 00000000000..762d7e457d0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/foo.c @@ -0,0 +1,8 @@ +int * +main (s1, s2) + int *s1; int *s2; +{ + while ((*s1++ = *s2++) != '\0') + ; + return s1 - 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/forgetcc.c b/gcc/testsuite/gcc.c-torture/compile/forgetcc.c new file mode 100644 index 00000000000..4105408a050 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/forgetcc.c @@ -0,0 +1,11 @@ +foo (hp, p, a) + short *hp; + int *p; + int a; +{ + hp[10] = a; + p[0] = 10; + if (hp[10] > 0) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/fq.c b/gcc/testsuite/gcc.c-torture/compile/fq.c new file mode 100644 index 00000000000..c4ac3696096 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/fq.c @@ -0,0 +1,25 @@ +expand_to_ascii (int *i, int *o) +{ + unsigned x, y, out; + unsigned x1; + + /* Big endian code. */ + + x = *i++; + + y = x >> (32 - 13); + out = (y / 91); + out = (out << 8) | (y % 91); + + x <<= 13; + y = x >> (32 - 13); + out = (out << 8) | (y / 91); + out = (out << 8) | (y % 91); + + *o++ = out + 0x20202020; + + /* 6 bits left in x. */ + + x1 = *i++; + x = (x << 26) | (x1 >> 6); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/g.c b/gcc/testsuite/gcc.c-torture/compile/g.c new file mode 100644 index 00000000000..e00f1244fc4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/g.c @@ -0,0 +1,9 @@ +foo (a, b) + long long a, b; + +{ + if (a == b) + return 0; + else + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/gen_tst.c b/gcc/testsuite/gcc.c-torture/compile/gen_tst.c new file mode 100644 index 00000000000..5a7a3763a3a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/gen_tst.c @@ -0,0 +1,67 @@ +/* Compiler Test Generator Program. + Copyright (C) 1989 FSF. */ + + +#define E0 ((type *)10000000) +#define reg0 r0 +#define indreg0 (*p0) +#define imm0 22 +#define limm0 ((type)(int)&glob0) +#define adr0 (*E0) +#define adrreg0 (p0[10000000]) +#define adrx0 (E0[x0]) +#define regx0 (p0[x0]) + +#define E1 ((type *)11111111) +#define reg1 r1 +#define indreg1 (*p1) +#define imm1 33 +#define limm1 ((type)(int)&glob1) +#define adr1 (*E1) +#define adrreg1 (p1[1111111/4]) +#define adrx1 (E1[x1]) +#define regx1 (p1[x1]) + +int glob0, glob1; + +#define type double + +char *a0[] = {"reg0", "indreg0", "imm0", "limm0", + "adr0", "adrreg0", "adrx0", "regx0"}; +char *a1[] = {"reg1", "indreg1", "imm1", "limm1", + "adr1", "adrreg1", "adrx1", "regx1"}; + +main_compare () +{ + int i0, i1; + + for (i0 = 0; i0 < 8; i0++) + { + for (i1 = 0; i1 < 8; i1++) + { + printf ("%s%s_cmp (r0, r1, x0, x1, p0, p1)\n", a0[i0], a1[i1]); + printf ("type r0, r1; type *p0, *p1;\n"); + printf ("{if (%s <= %s) return 1; else return 0;}\n\n", + a0[i0], a1[i1], a0[i0]); + } + } +} + +main_assign () +{ + int i0, i1; + + for (i0 = 0; i0 < 8; i0++) + { + if (i0 < 2 || i0 > 3) + for (i1 = 0; i1 < 8; i1++) + { + printf ("%s%s_set (r0, r1, x0, x1, p0, p1)\n", a0[i0], a1[i1]); + printf ("type r0, r1; type *p0, *p1;\n"); + printf ("{%s = %s; }\n\n", + a0[i0], a1[i1]); + } + } +} + +main () {main_assign ();} diff --git a/gcc/testsuite/gcc.c-torture/compile/glob.c b/gcc/testsuite/gcc.c-torture/compile/glob.c new file mode 100644 index 00000000000..e3206154fd9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/glob.c @@ -0,0 +1,12 @@ +typedef int tt; + +tt a1; +tt a2; +tt a3; + +foo () +{ + a1++; + a2++; + a1++; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/gronk.c b/gcc/testsuite/gcc.c-torture/compile/gronk.c new file mode 100644 index 00000000000..c1bb767e576 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/gronk.c @@ -0,0 +1,8 @@ +test_opt (a, b) + unsigned a, b; +{ + a = a / b; + if (a == 0) + a++; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/hi.c b/gcc/testsuite/gcc.c-torture/compile/hi.c new file mode 100644 index 00000000000..1624f777995 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/hi.c @@ -0,0 +1,5 @@ +foo (a, b) + short a, b; +{ + return a < b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/hibug.c b/gcc/testsuite/gcc.c-torture/compile/hibug.c new file mode 100644 index 00000000000..ad5c8267994 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/hibug.c @@ -0,0 +1,15 @@ +struct foo +{ + short d; + int a; +}; + +int +bar (d, u) + short d; + struct foo u; +{ + + u.d = d; + return (int) (&u); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/i++.c b/gcc/testsuite/gcc.c-torture/compile/i++.c new file mode 100644 index 00000000000..01d9ca95a8a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/i++.c @@ -0,0 +1,7 @@ +int main () +{ + int i = 2; + + i = i++; + printf ("%d\n",i); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/i.c b/gcc/testsuite/gcc.c-torture/compile/i.c new file mode 100644 index 00000000000..3bee8eacb80 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/i.c @@ -0,0 +1,8 @@ +ase (p) + short *p; +{ + int a; + + a = *p; + *p = a + 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ic.c b/gcc/testsuite/gcc.c-torture/compile/ic.c new file mode 100644 index 00000000000..150e1e8ed7e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ic.c @@ -0,0 +1,7 @@ +foo (int *ip, int a) +{ + a++; + if (a < ip[a]) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/icmp.c b/gcc/testsuite/gcc.c-torture/compile/icmp.c new file mode 100644 index 00000000000..dc9678ec335 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/icmp.c @@ -0,0 +1,10 @@ +foo (a, b) +{ + b++; + if (a <= b) + if ((int) a < (int) b) + b--; + else + b++; + return b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ifreg.c b/gcc/testsuite/gcc.c-torture/compile/ifreg.c new file mode 100644 index 00000000000..9e2f9562e38 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ifreg.c @@ -0,0 +1,12 @@ +union foo +{ + float f; + int i; +}; + +foo (int a, float c) +{ + union foo b; + b.i = a; + return b.f + c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/imm.c b/gcc/testsuite/gcc.c-torture/compile/imm.c new file mode 100644 index 00000000000..c3efba45eee --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/imm.c @@ -0,0 +1,7 @@ +int +imm () + +{ + return 11234; + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/isinf.c b/gcc/testsuite/gcc.c-torture/compile/isinf.c new file mode 100644 index 00000000000..12a8283747f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/isinf.c @@ -0,0 +1,5 @@ +int +isinf () +{ + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/jmp.c b/gcc/testsuite/gcc.c-torture/compile/jmp.c new file mode 100644 index 00000000000..474206a1f5e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/jmp.c @@ -0,0 +1,20 @@ +foo (a) +{ + if (a) + goto a1; + goto a2; + a1: goto a3; + a2: goto a4; + a3: goto a5; + a4: goto a6; + a5: goto a7; + a6: goto a8; + a7: goto a9; + a8: goto a10; + a9: goto a11; + a10: goto a12; + a11: goto a13; + a12:; + a13:; + return -a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/jumptab.c b/gcc/testsuite/gcc.c-torture/compile/jumptab.c new file mode 100644 index 00000000000..d86c30e40d6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/jumptab.c @@ -0,0 +1,20 @@ +jumptab (a) +{ + int b; + switch (a) + { + case 0: + b = 6;break; + case 1: + b = 5;break; + case 2: + b = 4;break; + case 3: + b = 3;break; + case 4: + b = 2;break; + case 5: + b = 1;break; + } + return b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/l.c b/gcc/testsuite/gcc.c-torture/compile/l.c new file mode 100644 index 00000000000..cc23b190b1d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/l.c @@ -0,0 +1,4 @@ +main (a) +{ + return - 256 + a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/layout.c b/gcc/testsuite/gcc.c-torture/compile/layout.c new file mode 100644 index 00000000000..04c825df645 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/layout.c @@ -0,0 +1,13 @@ +struct foo +{ + char a; +}; + +foo () +{ + struct foo bar[3]; + bar[0].a = '0'; + bar[1].a = '1'; + bar[2].a = '2'; + foof (bar); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/lbug.c b/gcc/testsuite/gcc.c-torture/compile/lbug.c new file mode 100644 index 00000000000..0440a0a7a9d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/lbug.c @@ -0,0 +1,7 @@ +long long x = 0; +main() +{ + if (x--) + return 255; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/ll1.c b/gcc/testsuite/gcc.c-torture/compile/ll1.c new file mode 100644 index 00000000000..9009e77b6f4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ll1.c @@ -0,0 +1,5 @@ +long long +foo (long long a) +{ + return a + ((long long) 10230101 << 32) + 7561; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/llbug.c b/gcc/testsuite/gcc.c-torture/compile/llbug.c new file mode 100644 index 00000000000..8c56dfbe70d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/llbug.c @@ -0,0 +1,13 @@ +union foo +{ + long long d; +}; + +int +bar (long long d) +{ + union foo u; + + u.d = d; + return (int) &u; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/lll.c b/gcc/testsuite/gcc.c-torture/compile/lll.c new file mode 100644 index 00000000000..dee9dc37d15 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/lll.c @@ -0,0 +1,45 @@ + +byte_match_count2 (buf, n, xm, m1, m2, m3, m4) + unsigned *buf; + unsigned n; + unsigned xm; + unsigned m1, m2, m3, m4; +{ + unsigned w, cnt = 0; + unsigned *bp; + + n /= 4; + + bp = buf; + while (bp < buf + n) + { + w = *bp++; + w ^= xm; + cnt += ((m1 & w) == 0); + cnt += ((m2 & w) == 0); + cnt += ((m3 & w) == 0); + cnt += ((m4 & w) == 0); + + w = *bp++; + w ^= xm; + cnt += ((m1 & w) == 0); + cnt += ((m2 & w) == 0); + cnt += ((m3 & w) == 0); + cnt += ((m4 & w) == 0); + + w = *bp++; + w ^= xm; + cnt += ((m1 & w) == 0); + cnt += ((m2 & w) == 0); + cnt += ((m3 & w) == 0); + cnt += ((m4 & w) == 0); + + w = *bp++; + w ^= xm; + cnt += ((m1 & w) == 0); + cnt += ((m2 & w) == 0); + cnt += ((m3 & w) == 0); + cnt += ((m4 & w) == 0); + } + return cnt; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/load8.c b/gcc/testsuite/gcc.c-torture/compile/load8.c new file mode 100644 index 00000000000..947a8165c29 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/load8.c @@ -0,0 +1,4 @@ +foo () +{ + return *(short *) 126; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/loadhicc.c b/gcc/testsuite/gcc.c-torture/compile/loadhicc.c new file mode 100644 index 00000000000..a7540894f5e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/loadhicc.c @@ -0,0 +1,15 @@ +typedef int xtype; + +foo (p, pc) + xtype *p; + char *pc; +{ + xtype a; + unsigned b = 0; + + a = *p; + p[1] = a; + if ((unsigned) p[1] > 0) + return 1; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/log2.c b/gcc/testsuite/gcc.c-torture/compile/log2.c new file mode 100644 index 00000000000..39b85784069 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/log2.c @@ -0,0 +1,6 @@ +log2 (a, b) +{ + int c; + c = ~(~a & ~b); + return c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/logic.c b/gcc/testsuite/gcc.c-torture/compile/logic.c new file mode 100644 index 00000000000..a9d6e9d0c2d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/logic.c @@ -0,0 +1,37 @@ +logic (a, b) + int *a, b; +{ + if (*a & 123) + b = 1; + if (*a & ~222) + b = 2; + if (124 & *a) + b = 3; + if (~111 & *a) + b = 4; + + if (~*a & 23) + b = 1; + if (~*a & ~22) + b = 2; + if (24 & ~*a) + b = 3; + if (~11 & ~*a) + b = 4; + + if (~*a & b) + b = 1; + if (~*a & ~b) + b = 2; + if (*a & ~*a) + b = 3; + return b; +} + +x (a, b, c) +{ + for (a = 0; --a > 0;); + for (b = -1; --b > 0;); + for (c = -65536; --c > 0;); + return a + b + c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/loop-1.c b/gcc/testsuite/gcc.c-torture/compile/loop-1.c new file mode 100644 index 00000000000..e50687a9fdd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/loop-1.c @@ -0,0 +1,11 @@ +foo (a) +{ + while ((a -= 1) != -1) + bar (270000); + putchar ('\n'); +} + +main () +{ + foo (5); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/loop386.c b/gcc/testsuite/gcc.c-torture/compile/loop386.c new file mode 100644 index 00000000000..429a320abbd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/loop386.c @@ -0,0 +1,15 @@ +foo (a) +{ + do + { + puts ("a"); + a -= 1; + } + while (a != 0); +} + +main () +{ + int p[100]; + printf ("%d\n", foo (3)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/lop.c b/gcc/testsuite/gcc.c-torture/compile/lop.c new file mode 100644 index 00000000000..72464111d4d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/lop.c @@ -0,0 +1,6 @@ +lop (a) +{ + do + a--; + while (a >= -1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/m1.c b/gcc/testsuite/gcc.c-torture/compile/m1.c new file mode 100644 index 00000000000..8660f60c950 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/m1.c @@ -0,0 +1,5 @@ +foo (p) + int *p; +{ + *p = 1234; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/m2.c b/gcc/testsuite/gcc.c-torture/compile/m2.c new file mode 100644 index 00000000000..203c855b5eb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/m2.c @@ -0,0 +1,44 @@ +void +store16 (p, a) + short *p; + short a; +{ + *p = a; +} + +signed int +sign_extend16 (p) + signed short *p; +{ + return *p; +} + +unsigned int +zero_extend16 (p) + unsigned short *p; +{ + return *p; +} + +void +store8 (p, a) + char *p; + char a; +{ + *p = a; +} + +signed int +sign_extend8 (p) + signed char *p; +{ + return *p; +} + +unsigned int +zero_extend8 (p) + unsigned char *p; +{ + return *p; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/m5.c b/gcc/testsuite/gcc.c-torture/compile/m5.c new file mode 100644 index 00000000000..23ad8445d32 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/m5.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a * 5 + 12; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/m68.c b/gcc/testsuite/gcc.c-torture/compile/m68.c new file mode 100644 index 00000000000..a1ee486d4c2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/m68.c @@ -0,0 +1,14 @@ +foo (a) +{ + return a | 12345; +} + +bar (a) +{ + return a & (0xffff0000 | 12345); +} + +foobar (a) +{ + return a - 128; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mbyte.c b/gcc/testsuite/gcc.c-torture/compile/mbyte.c new file mode 100644 index 00000000000..a8a23eab90a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mbyte.c @@ -0,0 +1,14 @@ +foo1 (p) + char *p; +{ + p[0] = p[1]; + return p[0]; +} + +foo2 (p, x) + char *p; +{ + p[0] = x; + return p[0]; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/mchar.c b/gcc/testsuite/gcc.c-torture/compile/mchar.c new file mode 100644 index 00000000000..a1b106037f7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mchar.c @@ -0,0 +1,11 @@ +int +foo (char *a, char *b) +{ + int x; + *a = *b; + x = *b; + if ((char) x) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mcmp.c b/gcc/testsuite/gcc.c-torture/compile/mcmp.c new file mode 100644 index 00000000000..6008008e164 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mcmp.c @@ -0,0 +1,9 @@ +foo (ip, a, x) + int a; + int *ip; + int x; +{ + if (a >= 1) + x++; + return x; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mdouble.c b/gcc/testsuite/gcc.c-torture/compile/mdouble.c new file mode 100644 index 00000000000..992db2205f2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mdouble.c @@ -0,0 +1,6 @@ +double +foo (double a) +{ + + return 1.123486712; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/memtst.c b/gcc/testsuite/gcc.c-torture/compile/memtst.c new file mode 100644 index 00000000000..b5ef2607073 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/memtst.c @@ -0,0 +1,26 @@ +#ifdef STACK_SIZE +#define SIZE STACK_SIZE / 8 +#else +#define SIZE 65536 +#endif + +memtst (int *p, int a) +{ + do + { + if (p[a] == 1) + break; + } + while (--a); +} + +main () +{ + int a[SIZE]; + int i; + bzero (a, SIZE * 4); + for (i = 0; i < 100; i++) + { + memtst (a, SIZE); + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/miscomp.c b/gcc/testsuite/gcc.c-torture/compile/miscomp.c new file mode 100644 index 00000000000..0bcb568d54b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/miscomp.c @@ -0,0 +1,15 @@ +unsigned char foo(unsigned long); +main() +{ + unsigned char AChar; + unsigned long ALong = 0x12345678; + + AChar = foo(ALong); + + printf("AChar = %x\n",(int)AChar); +} +unsigned char +foo( unsigned long TheLong) +{ + return( (unsigned char) (TheLong & 0xff) ); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mm.c b/gcc/testsuite/gcc.c-torture/compile/mm.c new file mode 100644 index 00000000000..a8efaae21cb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mm.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a * 2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mod.c b/gcc/testsuite/gcc.c-torture/compile/mod.c new file mode 100644 index 00000000000..c33211dc7fc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mod.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a % b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/modcc.c b/gcc/testsuite/gcc.c-torture/compile/modcc.c new file mode 100644 index 00000000000..2574090e96c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/modcc.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return (a % b) == 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/move.c b/gcc/testsuite/gcc.c-torture/compile/move.c new file mode 100644 index 00000000000..78e00ff2100 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/move.c @@ -0,0 +1,9 @@ +typedef char type; + +type +foo (b) +{ + type a; + for (a = 10; a < b; a++) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/move_qhi.c b/gcc/testsuite/gcc.c-torture/compile/move_qhi.c new file mode 100644 index 00000000000..9bc9cb6630c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/move_qhi.c @@ -0,0 +1,12 @@ +move (a, b) + char a, b; +{ + char s; + s = a; + if (s) + gurka (s); + foo (b, a); + a = bar (); + b = bar (); + gra (s); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mregtst.c b/gcc/testsuite/gcc.c-torture/compile/mregtst.c new file mode 100644 index 00000000000..b6bb6c21f55 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mregtst.c @@ -0,0 +1,17 @@ +foo (a, p) + int *p; +{ + int old, new, i; + + old = 0; + for (i = 1; i < 100; i++) + { + new = p[i]; + if (new < old) + a++; + old = new; + if (old == 0) + return 0; + } + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/msp.c b/gcc/testsuite/gcc.c-torture/compile/msp.c new file mode 100644 index 00000000000..5d350fd5ee0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/msp.c @@ -0,0 +1,10 @@ +#ifdef STACK_SIZE +# define A_SIZE (STACK_SIZE/sizeof(int)) +#else +# define A_SIZE 16384 +#endif +foo () +{ + int a[A_SIZE]; + bar (a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mtst.c b/gcc/testsuite/gcc.c-torture/compile/mtst.c new file mode 100644 index 00000000000..4f43137b705 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mtst.c @@ -0,0 +1,17 @@ +foo (int *p, int c) +{ + int a, b; + a = p[0]; + b = p[1]; + c = p[2]; + if (b == 0) + goto foo1; + if (b < 0) + goto foo2;; + + return a + b + c; + foo1: + return 1; + foo2: + return 2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mu.c b/gcc/testsuite/gcc.c-torture/compile/mu.c new file mode 100644 index 00000000000..c469a6e3a9b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mu.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a * b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mul.c b/gcc/testsuite/gcc.c-torture/compile/mul.c new file mode 100644 index 00000000000..cc5d06b5fac --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mul.c @@ -0,0 +1,5 @@ +void +mulqi (char *p, char a, char b) +{ + p[0] = a/b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/mword.c b/gcc/testsuite/gcc.c-torture/compile/mword.c new file mode 100644 index 00000000000..873e08868c5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mword.c @@ -0,0 +1,29 @@ +int +foo (a, b) +int *a, *b; +{ + int x, y; + x++; + *a = *b; + y = *b; + + if ((int) x) + return 1; + else + return y; +} + +foo1 (p) + int *p; +{ + p[0] = p[1]; + return p[0]; +} + +foo2 (p, x) + int *p; +{ + p[0] = x; + return p[0]; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/mword1.c b/gcc/testsuite/gcc.c-torture/compile/mword1.c new file mode 100644 index 00000000000..690703eb8bf --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/mword1.c @@ -0,0 +1,12 @@ +int +foo (a, b) +int *a, *b; +{ + int x; + *a = (*b + 1); + x = *b; + if ((int) x) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/n.c b/gcc/testsuite/gcc.c-torture/compile/n.c new file mode 100644 index 00000000000..1a9a8697417 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/n.c @@ -0,0 +1,6 @@ +char_autoincr (b1, c) + short *b1; + short c; +{ + *b1 = c; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/n1.c b/gcc/testsuite/gcc.c-torture/compile/n1.c new file mode 100644 index 00000000000..dfa93cebed4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/n1.c @@ -0,0 +1,10 @@ +foo (a, p) + long long a; + int *p; +{ + int b = (int)-a; + if (b > 32) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/nand.c b/gcc/testsuite/gcc.c-torture/compile/nand.c new file mode 100644 index 00000000000..8228a3c3a42 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/nand.c @@ -0,0 +1,4 @@ +nadn (a, b) +{ + return (~a) | (~b); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/neg.c b/gcc/testsuite/gcc.c-torture/compile/neg.c new file mode 100644 index 00000000000..c005b1327dd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/neg.c @@ -0,0 +1 @@ +foo (a) {return -a;} diff --git a/gcc/testsuite/gcc.c-torture/compile/o.c b/gcc/testsuite/gcc.c-torture/compile/o.c new file mode 100644 index 00000000000..e8b78e383cb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/o.c @@ -0,0 +1,12 @@ +foo (a, p) + char a; + int *p; +{ + int b = a; + *p = b; + a = (char) a; + if (a) + return b; + else + return b + 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/omit.c b/gcc/testsuite/gcc.c-torture/compile/omit.c new file mode 100644 index 00000000000..f59d6ee8f27 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/omit.c @@ -0,0 +1,11 @@ +omit (a, b) + char a; + char *b; +{ + char x; + int i; + x = *b; + b[1] = x; + foo ((int)x); + return x + 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/opout.c b/gcc/testsuite/gcc.c-torture/compile/opout.c new file mode 100644 index 00000000000..6d3736e059a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/opout.c @@ -0,0 +1,10 @@ +x () +{} + +y () +{} + +z (a, b) +{ + return (int) &a + (int) &b + (int) x + (int) z; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/opt.c b/gcc/testsuite/gcc.c-torture/compile/opt.c new file mode 100644 index 00000000000..faad10e48fe --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/opt.c @@ -0,0 +1,5 @@ +int +foo (a) +{ + return (a == 2); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/or.c b/gcc/testsuite/gcc.c-torture/compile/or.c new file mode 100644 index 00000000000..2a2e3b668b7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/or.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a | 0xffff0101; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/or386.c b/gcc/testsuite/gcc.c-torture/compile/or386.c new file mode 100644 index 00000000000..ad49f35043c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/or386.c @@ -0,0 +1,13 @@ +typedef int xtype; + +xtype +foo (a) + xtype a; +{ + return a | 0x7f; +} + +main () +{ + printf ("%08x\n", foo (-1)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/p.c b/gcc/testsuite/gcc.c-torture/compile/p.c new file mode 100644 index 00000000000..465e741592a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/p.c @@ -0,0 +1,6 @@ +foo (a, b, p) + short *p; +{ + p[0] = a; + p[1] = b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/parms.c b/gcc/testsuite/gcc.c-torture/compile/parms.c new file mode 100644 index 00000000000..26c2c701756 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/parms.c @@ -0,0 +1,7 @@ +#define alloca __builtin_alloca + +x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y) +{ + foo (alloca (8)); + return a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+x+y; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pass.c b/gcc/testsuite/gcc.c-torture/compile/pass.c new file mode 100644 index 00000000000..6b663828aee --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pass.c @@ -0,0 +1,13 @@ +int +foo (a, b, c) +{ + return a + b + c; +} + +int +bar () +{ + int q, w, e, r, t, y; + + return foo ((int) & q, q, w, e, q, (int) &w); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pmt.c b/gcc/testsuite/gcc.c-torture/compile/pmt.c new file mode 100644 index 00000000000..b6aced6ec81 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pmt.c @@ -0,0 +1,6 @@ +long long +foo (a, b) + long long a, b; +{ + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/poor.c b/gcc/testsuite/gcc.c-torture/compile/poor.c new file mode 100644 index 00000000000..66d584aff43 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/poor.c @@ -0,0 +1,34 @@ +typedef struct +{ + char c[510]; +} s510; + +typedef struct +{ + char c[511]; +} s511; + +s510 G510, s1; +s511 G511; +int I, J; +double D; + +void main(void); +void f0(double D, ...); +s510 f1(double D, ...); +void f2a(s510 S); +void f2b(s511 S); + + +void main(void) +{ + + f0(D, I, J); + + s1 = f1(D, I, D); + + f2a(G510); + + f2b(G511); + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pp.c b/gcc/testsuite/gcc.c-torture/compile/pp.c new file mode 100644 index 00000000000..7d38d53de0f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pp.c @@ -0,0 +1,9 @@ +foo (a, b, c, d, e, i0, f, i1) + double a, b, c, d, e, f; + int i0, i1; +{} + +main () +{ + foo (1.0, 2.0, 3.0, 4.0, 5.0, 1, 6.0, 2); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pret-arg.c b/gcc/testsuite/gcc.c-torture/compile/pret-arg.c new file mode 100644 index 00000000000..a7fa8562830 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pret-arg.c @@ -0,0 +1,5 @@ +foo (a, b, c, d, e, f, g, h, i, j, xx) + double xx; +{ + return xx + 1.2345; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pyr.c b/gcc/testsuite/gcc.c-torture/compile/pyr.c new file mode 100644 index 00000000000..d25b2a99aa5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pyr.c @@ -0,0 +1,11 @@ +foo (char *a) +{ + char b; + int c; + b = *a; + c = b; + if (c < 0) + return 1; + a[1] = b; + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pyr2.c b/gcc/testsuite/gcc.c-torture/compile/pyr2.c new file mode 100644 index 00000000000..12e2ccd24b2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pyr2.c @@ -0,0 +1,4 @@ +foo (a) +{ + return ((int *)0)[a]; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/q.c b/gcc/testsuite/gcc.c-torture/compile/q.c new file mode 100644 index 00000000000..fa08e758a52 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/q.c @@ -0,0 +1,7 @@ + +unsigned +reg0indreg1 (r0, p1) + unsigned short r0; unsigned short p1; +{ + return (r0 + p1); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/r.c b/gcc/testsuite/gcc.c-torture/compile/r.c new file mode 100644 index 00000000000..19eeda7ab44 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/r.c @@ -0,0 +1,7 @@ +r (a, b) +{ + if (a < b) + return 1; + else + return 2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/r1.c b/gcc/testsuite/gcc.c-torture/compile/r1.c new file mode 100644 index 00000000000..0b277b0f8dc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/r1.c @@ -0,0 +1,29 @@ +void assert (a) {if (a != 1) abort ();} + +int h1 (int *p) {return *p & 255;} + +void p1 () {int a = 0x01020304; assert (h1 (&a) == 0x04);} + + +int h2 (a) {return a > 0;} + +p2 () {assert (h2 (1));} + +h3 (int *p) +{ + *p |= 255; +} + +p3 () +{ + int *p; + h3 (p); +} + +main () +{ + p1 (); + p2 (); + p3 (); + puts ("Compiler test passed."); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/rel.c b/gcc/testsuite/gcc.c-torture/compile/rel.c new file mode 100644 index 00000000000..54d36052ed3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/rel.c @@ -0,0 +1,8 @@ +foo (int *c, int b) +{ + int a; + + a = *c + b; + c[1] = a; + return b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/rmsc.c b/gcc/testsuite/gcc.c-torture/compile/rmsc.c new file mode 100644 index 00000000000..5c97c6dae14 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/rmsc.c @@ -0,0 +1,46 @@ + +cc1 (x, y) + int x, y; +{ + int z; + z = x - y; + if (x >= y) + return z + 1; + else + return z + 0; +} + +cc2 (x, y) + int x, y; +{ + int z; + + z = x - y; + if (z >= 0) + return z + 1; + else + return z + 0; +} + +cc3 (x, y) + unsigned x, y; +{ + unsigned z; + z = x - y; + if (x >= y) + return z + 1; + else + return z + 0; +} + +cc4 (x, y) + unsigned x, y; +{ + unsigned z; + + z = x - y; + if (z >= 0) + return z + 1; + else + return z + 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/round.c b/gcc/testsuite/gcc.c-torture/compile/round.c new file mode 100644 index 00000000000..5233e65ea90 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/round.c @@ -0,0 +1,13 @@ +foo (a) + double a; +{ + printf ("%d\n", (int) a); +} + +main () +{ + foo (1.6); + foo (1.4); + foo (-1.4); + foo (-1.6); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/run.c b/gcc/testsuite/gcc.c-torture/compile/run.c new file mode 100644 index 00000000000..40892f6037f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/run.c @@ -0,0 +1,11 @@ +main () +{ + typedef short int xtype; + + xtype i; + xtype ii; + + for (i = 0; i < 100; i++) + for (ii = 65535; --ii;) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/s.c b/gcc/testsuite/gcc.c-torture/compile/s.c new file mode 100644 index 00000000000..e0c84262208 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/s.c @@ -0,0 +1,24 @@ +struct foo +{ + int a, b, c, d; + double doubl; +} s1, s2; + +struct foo +structret (s1, i1, i2, s2) + struct foo s1, s2; + int i1, i2; +{ + if (i1 != i2) + { + if (i1 < i2) + return s1; + else + return s2; + } + s2.a = 11; + s2.b = 22; + s2.c = s1.c; + s2.d = s1.d; + return s2; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sar.c b/gcc/testsuite/gcc.c-torture/compile/sar.c new file mode 100644 index 00000000000..9bf9bec0625 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sar.c @@ -0,0 +1,10 @@ +struct foo +{ + char a; +} foo[100]; + +main () +{ + foo[1].a = '1'; + foo[2].a = '2'; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sc.c b/gcc/testsuite/gcc.c-torture/compile/sc.c new file mode 100644 index 00000000000..84dc60f7e90 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sc.c @@ -0,0 +1,5 @@ +foo (a, b) + int a, b; +{ + return (a < 0) | (a <= 0) | (a == 0) | (a != 0) | (a >= 0) | (a > 0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/scal.c b/gcc/testsuite/gcc.c-torture/compile/scal.c new file mode 100644 index 00000000000..94e22aa80f5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/scal.c @@ -0,0 +1,19 @@ +int g1, g2; + +void +write_at (addr, off, val) + int *addr; + int off; + int val; +{ + g2 = 1; + addr[off] = val; + g2++; +} + +main () +{ + g2 = 12; + write_at (&g1, &g2 - &g1, 12345); + printf ("%d\n", g2); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/scc.c b/gcc/testsuite/gcc.c-torture/compile/scc.c new file mode 100644 index 00000000000..79ae4e12f45 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/scc.c @@ -0,0 +1,11 @@ +foo (a, b) +{ + if (a < 0) + goto ret1; + if (a == 0) + return 2; + return 3; + ret1: + return 1; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/scond.c b/gcc/testsuite/gcc.c-torture/compile/scond.c new file mode 100644 index 00000000000..087b0a66e94 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/scond.c @@ -0,0 +1,4 @@ +scond (a, b, c, d) +{ + return (a > b) & (c < d); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/selfrec.c b/gcc/testsuite/gcc.c-torture/compile/selfrec.c new file mode 100644 index 00000000000..c7aaca552a0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/selfrec.c @@ -0,0 +1,5 @@ +int +foo (a) +{ + return foo (a - 1) * a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/seq.c b/gcc/testsuite/gcc.c-torture/compile/seq.c new file mode 100644 index 00000000000..0793228b491 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/seq.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a < 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/set386.c b/gcc/testsuite/gcc.c-torture/compile/set386.c new file mode 100644 index 00000000000..c16ae8dbdfe --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/set386.c @@ -0,0 +1,5 @@ +foo (a, p) + int *p; +{ + *p = a > 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/set88.c b/gcc/testsuite/gcc.c-torture/compile/set88.c new file mode 100644 index 00000000000..8069ea622a3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/set88.c @@ -0,0 +1,9 @@ +foo (a) +{ + return -1 << a; +} + +bar (a, b) +{ + return b | (-1 << a); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sh.c b/gcc/testsuite/gcc.c-torture/compile/sh.c new file mode 100644 index 00000000000..8d3265f83f7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sh.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a << b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/shand.c b/gcc/testsuite/gcc.c-torture/compile/shand.c new file mode 100644 index 00000000000..5a401961355 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/shand.c @@ -0,0 +1,11 @@ +int +foo (x, c) + int x; +{ + return x >> 24 & 0xff; +} + +bar (x) +{ + return (int)(x & 0xfffff) << 13; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/shft.c b/gcc/testsuite/gcc.c-torture/compile/shft.c new file mode 100644 index 00000000000..7d318c863c5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/shft.c @@ -0,0 +1,15 @@ +foo (a) + int a; +{ + int b = 8; + + if ((a << b) >= 0) + return 1; + return a; +} + +main () +{ + if (foo (0x00ffffff) == 1) + puts ("y"); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/shift.c b/gcc/testsuite/gcc.c-torture/compile/shift.c new file mode 100644 index 00000000000..1ed1879c616 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/shift.c @@ -0,0 +1,7 @@ +foo (a) +{ + if (a >= 0) + return (unsigned) a << 10; + else + return (int) a << 10; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/shloop.c b/gcc/testsuite/gcc.c-torture/compile/shloop.c new file mode 100644 index 00000000000..f4c9366394a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/shloop.c @@ -0,0 +1,7 @@ +main () +{ + int volatile p; + int i; + for (i = 10000000; i > 0; i--) + p = i >> 10; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/shm.c b/gcc/testsuite/gcc.c-torture/compile/shm.c new file mode 100644 index 00000000000..b667b26abe9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/shm.c @@ -0,0 +1,5 @@ +foo (int *p) +{ + int a = *p; + return a >> 24; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/signext.c b/gcc/testsuite/gcc.c-torture/compile/signext.c new file mode 100644 index 00000000000..2724098d031 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/signext.c @@ -0,0 +1,27 @@ +void longprint (x) + long long x; +{ + printf (" %d, %d\n", (unsigned) ((unsigned long long) x >> 32), + (unsigned) x); +} + +void +k_min (p, qa, d) + int d; +{ + int s = 1; + long long x; + + if (s >= d) + s -= d; + + x = ((long long)((8 * s) % 3) + qa) % d; + longprint (x); +} + +int +main () +{ + k_min (100003, -600017, 3); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/signext2.c b/gcc/testsuite/gcc.c-torture/compile/signext2.c new file mode 100644 index 00000000000..d2eb6370df8 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/signext2.c @@ -0,0 +1,11 @@ +long long +foo (a) + int a; +{ + return a; +} + +main () +{ + printf ("%d\n", (int) (foo (-1) >> 32)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sim.c b/gcc/testsuite/gcc.c-torture/compile/sim.c new file mode 100644 index 00000000000..e8c4fb42f53 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sim.c @@ -0,0 +1,7 @@ +main () +{ + int i; + + for (i = 1; i < 10000; i++) + ; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/simple.c b/gcc/testsuite/gcc.c-torture/compile/simple.c new file mode 100644 index 00000000000..614acba82d9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/simple.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sne.c b/gcc/testsuite/gcc.c-torture/compile/sne.c new file mode 100644 index 00000000000..6844a6e53b9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sne.c @@ -0,0 +1,4 @@ +foo (double a) +{ + return (a != 0); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sound.c b/gcc/testsuite/gcc.c-torture/compile/sound.c new file mode 100644 index 00000000000..be727e3febb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sound.c @@ -0,0 +1,13 @@ + +main () +{ + char audio[8192]; + int i; + + for (i = 0; i < 4095; i += 1) + audio[i] = i / 8, + audio[8191 - i] = i / 8; + + for (;;) + write (1, audio, 8192); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sparcbug.c b/gcc/testsuite/gcc.c-torture/compile/sparcbug.c new file mode 100644 index 00000000000..cd42a86cccc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sparcbug.c @@ -0,0 +1,5 @@ +foo (a) +{ + int b = a; + return b + 8762345; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/speed.c b/gcc/testsuite/gcc.c-torture/compile/speed.c new file mode 100644 index 00000000000..d61407e321d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/speed.c @@ -0,0 +1,8 @@ +main () +{ + int i; + + for (i = 5000000; i >=0; i--) + { + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/stor.c b/gcc/testsuite/gcc.c-torture/compile/stor.c new file mode 100644 index 00000000000..57981eff5a6 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/stor.c @@ -0,0 +1,12 @@ +#define C 1 + +foo (p) + int *p; +{ + p[0] = C; + p[1] = C; + p[2] = C; + p[3] = C; + p[4] = C; + p[5] = C; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/store0.c b/gcc/testsuite/gcc.c-torture/compile/store0.c new file mode 100644 index 00000000000..3b7b16ef3bc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/store0.c @@ -0,0 +1,4 @@ +foo (int *p) +{ + p[10] = 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/storecc.c b/gcc/testsuite/gcc.c-torture/compile/storecc.c new file mode 100644 index 00000000000..11634691091 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/storecc.c @@ -0,0 +1,6 @@ +foo (char *p, int a) +{ + *p = a; + if ((char) a) + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/str.c b/gcc/testsuite/gcc.c-torture/compile/str.c new file mode 100644 index 00000000000..d2dec4b2303 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/str.c @@ -0,0 +1,13 @@ +typedef struct +{ + char a; + char b; +} foo; + +bar () +{ + foo foobar[100]; + foobar[1].a = 'a'; + foobar[2].a = 'b'; + barfoo (foobar); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/stru.c b/gcc/testsuite/gcc.c-torture/compile/stru.c new file mode 100644 index 00000000000..042c5221784 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/stru.c @@ -0,0 +1,9 @@ +struct foo +{ + int a, b, c; +}; + +foo (struct foo *a) +{ + a[0] = a[1]; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/structret.c b/gcc/testsuite/gcc.c-torture/compile/structret.c new file mode 100644 index 00000000000..9c705d4c0a2 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/structret.c @@ -0,0 +1,69 @@ +struct foo +{ + int a, b, c, d; + double doubl; +} s1, s2; + +#ifndef ONLY2 + +struct foo +structret (s1, i1, i2, s2) + struct foo s1, s2; + int i1, i2; +{ + if (i1 != i2) + { + if (i1 < i2) + return s1; + else + return s2; + } + s2.a = 11; + s2.b = 22; + s2.c = s1.c; + s2.d = s1.d; + return s2; +} + +#endif + +#ifndef ONLY1 + +struct foo +mani (a, b) +{ + return structret (s1, a, b, s2); +} + +init () +{ + s1.a = 1; + s1.b = 2; + s1.c = 3; + s1.d = 4; + s1.doubl = 3.1415; + s2.a = -1; + s2.b = -2; + s2.c = -3; + s2.d = -4; + s2.doubl = 2.71818; +} + +main () +{ + struct foo s; + + init (); + s = mani (1, 1); + printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl); + + init (); + s = mani (2, 1); + printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl); + + init (); + s = mani (1, 2); + printf ("%d, %d, %d, %d : %f\n", s.a, s.b, s.c, s.d, s.doubl); +} + +#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/stuct.c b/gcc/testsuite/gcc.c-torture/compile/stuct.c new file mode 100644 index 00000000000..deb838d8099 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/stuct.c @@ -0,0 +1,22 @@ +#ifdef STACK_SIZE +#define SIZE STACK_SIZE / 8 +#else +#define SIZE 10000000 +#endif + +struct foo +{ + int a, b, c; + int arr[SIZE]; +}; + +struct foo s, ss; + +main () +{ + + s.b = 2; + s.c = 3; + ss.b = 2; + ss.c = 3; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sub32.c b/gcc/testsuite/gcc.c-torture/compile/sub32.c new file mode 100644 index 00000000000..93114d96cd7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sub32.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a + 32; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/subcc.c b/gcc/testsuite/gcc.c-torture/compile/subcc.c new file mode 100644 index 00000000000..d89b50dbdff --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/subcc.c @@ -0,0 +1,33 @@ +int foo (a, c) +{ + int b; + + if (a + c >= 0) /* b < 0 ==== a < 10? */ + return a | 0x80000000; + return 0; +} + +void bar (a) + int a; +{ + if (foo (a, 10) & 0x80000000) + printf ("y"); + else + printf ("n"); +} + +int main () +{ + bar (0); + bar (1); + bar (-1); + bar (10); + bar (-10); + bar (11); + bar (-11); + bar (0x7fffffff); + bar (-0x7fffffff); + + puts (""); + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/subcse.c b/gcc/testsuite/gcc.c-torture/compile/subcse.c new file mode 100644 index 00000000000..0a10991f18a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/subcse.c @@ -0,0 +1,6 @@ +foo (a, b, p) + int *p; +{ + p[0] = 1230 - a; + p[1] = 1230 - b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/sym.c b/gcc/testsuite/gcc.c-torture/compile/sym.c new file mode 100644 index 00000000000..8a0fe323b03 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/sym.c @@ -0,0 +1,4 @@ +foo () +{ + return (int) &foo; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/symconst.c b/gcc/testsuite/gcc.c-torture/compile/symconst.c new file mode 100644 index 00000000000..7add218108e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/symconst.c @@ -0,0 +1,4 @@ +foo () +{ + return (int)foo; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/t.c b/gcc/testsuite/gcc.c-torture/compile/t.c new file mode 100644 index 00000000000..48095e7c38b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/t.c @@ -0,0 +1,18 @@ +#define B 95 + +foo (a, b, p) + unsigned a, b; + int *p; +{ + p[1] = a % B; + p[0] = a / B; +} + +bar (a, b, p) + unsigned a, b; + int *p; +{ + p[0] = a / B; + p[1] = a % B; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/test-flow.c b/gcc/testsuite/gcc.c-torture/compile/test-flow.c new file mode 100644 index 00000000000..01ec724eb2f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/test-flow.c @@ -0,0 +1,12 @@ +foo (a, b, c, d) +{ + if (a < 0) + { + b = c; + } + else + { + b = d; + } + return b + 75; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/test-loop.c b/gcc/testsuite/gcc.c-torture/compile/test-loop.c new file mode 100644 index 00000000000..d441dde0ca9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/test-loop.c @@ -0,0 +1,7 @@ +main () +{ + int i; + for (i = 100; i >= -1; i--) + foo (); + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/test.c b/gcc/testsuite/gcc.c-torture/compile/test.c new file mode 100644 index 00000000000..46e830a3521 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/test.c @@ -0,0 +1,6 @@ +foo (a) +{ + if (a & 38) + return 1; + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/time.c b/gcc/testsuite/gcc.c-torture/compile/time.c new file mode 100644 index 00000000000..7e22681d98b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/time.c @@ -0,0 +1,7 @@ +main () +{ + int i; + for (i = 3000000; --i;) + { + } +} diff --git a/gcc/testsuite/gcc.c-torture/compile/tmp.c b/gcc/testsuite/gcc.c-torture/compile/tmp.c new file mode 100644 index 00000000000..463d9fb530d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/tmp.c @@ -0,0 +1,5 @@ +foo (a, b) +{ + return (a - b) == 0; +} + diff --git a/gcc/testsuite/gcc.c-torture/compile/trivial.c b/gcc/testsuite/gcc.c-torture/compile/trivial.c new file mode 100644 index 00000000000..e9665cd8dd7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/trivial.c @@ -0,0 +1 @@ +foo () {} diff --git a/gcc/testsuite/gcc.c-torture/compile/trunc.c b/gcc/testsuite/gcc.c-torture/compile/trunc.c new file mode 100644 index 00000000000..dee0e158728 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/trunc.c @@ -0,0 +1,11 @@ +main () +{ + printf ("%x, %x\n", (unsigned char) main, main); +} + +foo (p) + char *p; +{ + p[0] = (char)foo; + p[1] = (char)foo; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/u.c b/gcc/testsuite/gcc.c-torture/compile/u.c new file mode 100644 index 00000000000..7fc0dda3784 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/u.c @@ -0,0 +1 @@ +foo (a, b) { return a % b; } diff --git a/gcc/testsuite/gcc.c-torture/compile/udconvert.c b/gcc/testsuite/gcc.c-torture/compile/udconvert.c new file mode 100644 index 00000000000..31b494fe08a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/udconvert.c @@ -0,0 +1,30 @@ +double +unsigned_to_double1 (u) + unsigned u; +{ + double d; + d = (int) u; /* convert as from a *signed* integer */ + return ((int) u < 0) + ? d + 4294967296.0 + : d; +} + +/* Alternatively */ + +double +unsigned_to_double2 (u) + unsigned u; +{ + double d; + u -= 2147483648; /* complement sign bit */ + d = (int) u; /* convert as from a *signed* integer */ + return d + 2147483648.0; +} + +unsigned +double_to_unsigned (d) + double d; +{ + d += 2147483648.0; + return ((int) d) - 2147483648; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c new file mode 100644 index 00000000000..40d2fa8d07c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c @@ -0,0 +1,56 @@ +long long +xlrandom () +{ + long long x; + unsigned a; + int bits = 64; + unsigned b; + + do + { + a = random (); + b = (a & 15) + 1; + x <<= b; /* shift up 1-16 steps */ + a = (a >> 18) & 1; + if (a) + x |= (unsigned) (1 << b) - 1; + bits -= b; + } + while (bits >= 0); + return x; +} + + +unsigned long long __udivmoddi4(); + +main () +{ + int i; + unsigned long long n, d, q, r, rr; + + for (i = 0; ;i++) + { + n = xlrandom (); + d = xlrandom (); + if (d == 0) + continue; + + q = __udivmoddi4 (n, d, &r); + + if (i % 1000000 == 0) + printf ("Testing udivmoddi4: %d iterations made\n", i); + + rr = n - q * d; + if (rr != r || r >= d) + { + printf ("Testing udivmoddi4: failure after %d iterations\n", i); + printf ("n=%lX%08lX\n", (unsigned) (n >> 32), (unsigned) n); + printf ("d=%lX%08lX\n", (unsigned) (d >> 32), (unsigned) d); + printf ("q=%lX%08lX\n", (unsigned) (q >> 32), (unsigned) q); + printf ("r=%lX%08lX\n", (unsigned) (r >> 32), (unsigned) r); + printf ("rr=%lX%08lX\n", (unsigned) (rr >> 32), (unsigned) rr); + abort (); + } + } + +} diff --git a/gcc/testsuite/gcc.c-torture/compile/uns.c b/gcc/testsuite/gcc.c-torture/compile/uns.c new file mode 100644 index 00000000000..314704f89d3 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/uns.c @@ -0,0 +1,5 @@ +foo (a) +{ + if ((unsigned) a < 234) + return 1; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/uns_tst.c b/gcc/testsuite/gcc.c-torture/compile/uns_tst.c new file mode 100644 index 00000000000..e34ffaf30eb --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/uns_tst.c @@ -0,0 +1,19 @@ +a (c) + unsigned char c; +{ + unsigned u = c; + if ((int)u < 0) + return 1; + else + return 0; +} + +b (x, y) + unsigned x, y; +{ + x /= y; + if ((int)x < 0) + return 1; + else + return 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/uuarg.c b/gcc/testsuite/gcc.c-torture/compile/uuarg.c new file mode 100644 index 00000000000..8928b3e0768 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/uuarg.c @@ -0,0 +1,4 @@ +foo (a, b, c, d, e, f, g, h, i) +{ + return foo () + i; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/v.c b/gcc/testsuite/gcc.c-torture/compile/v.c new file mode 100644 index 00000000000..87ac00aef64 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/v.c @@ -0,0 +1,11 @@ +main (int *p) +{ + int a; + + a = 0; + p[1] = a; + a = 0; + p[2] = a; + a = 123456; + p[3] = a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/w.c b/gcc/testsuite/gcc.c-torture/compile/w.c new file mode 100644 index 00000000000..1acfe1512a5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/w.c @@ -0,0 +1 @@ +int foo (unsigned short a, unsigned short b) { return a + b; } diff --git a/gcc/testsuite/gcc.c-torture/compile/ww.c b/gcc/testsuite/gcc.c-torture/compile/ww.c new file mode 100644 index 00000000000..657f8c6b839 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/ww.c @@ -0,0 +1,7 @@ +foo (p) + short *p; +{ + static int *foo; + *p = 1234; + *foo = 1234; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/x.c b/gcc/testsuite/gcc.c-torture/compile/x.c new file mode 100644 index 00000000000..baf98960cfd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/x.c @@ -0,0 +1 @@ +f(m){int i,s=0;for(i=0;i<m;i++)s+=i;return s;} diff --git a/gcc/testsuite/gcc.c-torture/compile/xb.c b/gcc/testsuite/gcc.c-torture/compile/xb.c new file mode 100644 index 00000000000..09087ccf387 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xb.c @@ -0,0 +1,17 @@ +foo (a, b) +{ + unsigned x = 1; + + a += b; + a += x; + if (a <= 0) + return 1; + return 0; +} + +main () +{ + printf ("%d\n", foo (1, ~0)); + printf ("%d\n", foo (0, ~0)); + printf ("%d\n", foo (-1, ~0)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xbg.c b/gcc/testsuite/gcc.c-torture/compile/xbg.c new file mode 100644 index 00000000000..b600964d420 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xbg.c @@ -0,0 +1,14 @@ +typedef short type; + +short +foo (type *sp, int a) +{ + type t; + int i; + + t = sp[a]; + i = (int)(type)sp[a]; + if (i) + return 0; + return t; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xc.c b/gcc/testsuite/gcc.c-torture/compile/xc.c new file mode 100644 index 00000000000..aed06a04ecd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xc.c @@ -0,0 +1,11 @@ +foo (a, p) + int *p; +{ + int b; + + a++; + b = *p; + if (a) + return 1; + return b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xcsebug.c b/gcc/testsuite/gcc.c-torture/compile/xcsebug.c new file mode 100644 index 00000000000..614a6e80ebf --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xcsebug.c @@ -0,0 +1,14 @@ +int g1; +int g2; + +foo () +{ + int i = 1; + int x; + + x = g1; + (*(&g1 + i - 1)) = x + 1; + x = g1; + (*(&g1 + i - 1)) = x + 1; + g1++; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xdi.c b/gcc/testsuite/gcc.c-torture/compile/xdi.c new file mode 100644 index 00000000000..413dd6cf84d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xdi.c @@ -0,0 +1,15 @@ +foo (long long *p, int a, int b) +{ + *(p + a + b) = 876243243874343LL; +} + +bar (p, pp) + long long *p, *pp; +{ + long long a; + *p++ = a; + fee (*p); + *p++ = *pp--; + *p++ = *pp--; + return (int) p; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xfoo.c b/gcc/testsuite/gcc.c-torture/compile/xfoo.c new file mode 100644 index 00000000000..da879d2aa13 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xfoo.c @@ -0,0 +1,4 @@ +foo (a) +{ + return (a & ~0xfff) == 0; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xi.c b/gcc/testsuite/gcc.c-torture/compile/xi.c new file mode 100644 index 00000000000..54b42c5a377 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xi.c @@ -0,0 +1,7 @@ +foo (a) +{ + int r = 0; + if (a) + r = 1; + return r; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xlop.c b/gcc/testsuite/gcc.c-torture/compile/xlop.c new file mode 100644 index 00000000000..6506bfd3415 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xlop.c @@ -0,0 +1,11 @@ +foo (a) +{ + int b; + do + { + b = bar (); + a = b - 10; + } + while (a > 10); + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xmtst.c b/gcc/testsuite/gcc.c-torture/compile/xmtst.c new file mode 100644 index 00000000000..ca78fcaac12 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xmtst.c @@ -0,0 +1,26 @@ +p1 (int b, int *p, int a) +{ + p[0] = p[1]; + return p[0]; +} +p2 (int b, int *p, int a) +{ + p[0] = p[1]; + return p[0] == 0; +} +p3 (int b, int *p, int a) +{ + p[0] = p[1]; + a = p[0]; + if (a) + return 0; + return a; +} +p4 (int b, int *p, int a) +{ + a = p[1]; + p[0] = p[1]; + if (a) + return 0; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xneg.c b/gcc/testsuite/gcc.c-torture/compile/xneg.c new file mode 100644 index 00000000000..ff5b8503482 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xneg.c @@ -0,0 +1,5 @@ +foo (a) + double a; +{ + return -a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xopt.c b/gcc/testsuite/gcc.c-torture/compile/xopt.c new file mode 100644 index 00000000000..b1a50f86cef --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xopt.c @@ -0,0 +1,35 @@ +proc1 (a) + unsigned a; +{ + return (a >> 20) & 0x010fffff; +} + +proc2 (a) + unsigned a; +{ + return (a << 17) & 0xfffff001; +} + +proc3 (a) + unsigned a; +{ + return (a & 0xff00000a) >> 25; +} + +proc4 (a) + unsigned a; +{ + return (a & 0x100000ff) << 25; +} + +proc5 (a) + unsigned a; +{ + return (unsigned char) (a >> 24); +} + +proc6 (a) + unsigned a; +{ + return ((unsigned char) a) << 30; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xor.c b/gcc/testsuite/gcc.c-torture/compile/xor.c new file mode 100644 index 00000000000..435f2231e64 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xor.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return ~(a ^ ~123); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xorn.c b/gcc/testsuite/gcc.c-torture/compile/xorn.c new file mode 100644 index 00000000000..d7b75f936bd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xorn.c @@ -0,0 +1,31 @@ +int +xorn (a, b) + int a, b; +{ + return a ^ ~b; +} + +int +not (a) + int a; +{ + return ~a; +} + +int +xor (a, b) + int a, b; +{ + return a ^ b; +} + +main () +{ + int i, j; + + for (i = 0; i <= 1; i++) + for (j = 0; j <= 1; j++) + printf ("%d op %d = %d = %d?\n", i, j, + 1 & xor (i, not (j)), + 1 & xorn (i, j)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xp.c b/gcc/testsuite/gcc.c-torture/compile/xp.c new file mode 100644 index 00000000000..139335c0287 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xp.c @@ -0,0 +1,4 @@ +foo (a) +{ + return a & 255; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xpp.c b/gcc/testsuite/gcc.c-torture/compile/xpp.c new file mode 100644 index 00000000000..daf3399a3f4 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xpp.c @@ -0,0 +1,12 @@ +foo (a) +{ + a++; + if (a < 10) + return 1; + return a; +} + +main () +{ + printf ("%d\n", foo ((1 << 31) - 1)); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xs.c b/gcc/testsuite/gcc.c-torture/compile/xs.c new file mode 100644 index 00000000000..24f773e7577 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xs.c @@ -0,0 +1,9 @@ +foo (a, b) +{ + for (b = 0; b < 10; b++) + ; + for (a = 0; a < 10; a++) + ; + a = b << 1; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xsh.c b/gcc/testsuite/gcc.c-torture/compile/xsh.c new file mode 100644 index 00000000000..9ba0b6c9e02 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xsh.c @@ -0,0 +1,7 @@ +foo (a, b) +{ + a = b + b; + if (a) + return a; + return b; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xz.c b/gcc/testsuite/gcc.c-torture/compile/xz.c new file mode 100644 index 00000000000..97a1d1e2cdc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xz.c @@ -0,0 +1,4 @@ +foo (int *p) +{ + *p = (unsigned short) *p; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/xzz.c b/gcc/testsuite/gcc.c-torture/compile/xzz.c new file mode 100644 index 00000000000..f1972b6c618 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/xzz.c @@ -0,0 +1,4 @@ +foo (a, b) +{ + return a >> (char) b; +} |