]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Update to current version of Go testsuite.
authorIan Lance Taylor <iant@google.com>
Sat, 29 Sep 2012 18:16:01 +0000 (18:16 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 29 Sep 2012 18:16:01 +0000 (18:16 +0000)
* go.test/go-test.exp: Update for latest version of Go testsuite.

From-SVN: r191858

749 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/go.test/go-test.exp
gcc/testsuite/go.test/test/235.go
gcc/testsuite/go.test/test/64bit.go
gcc/testsuite/go.test/test/alias.go
gcc/testsuite/go.test/test/alias1.go
gcc/testsuite/go.test/test/append.go
gcc/testsuite/go.test/test/args.go
gcc/testsuite/go.test/test/assign.go
gcc/testsuite/go.test/test/assign1.go
gcc/testsuite/go.test/test/bench/garbage/Makefile
gcc/testsuite/go.test/test/bench/garbage/parser.go
gcc/testsuite/go.test/test/bench/garbage/peano.go
gcc/testsuite/go.test/test/bench/garbage/stats.go
gcc/testsuite/go.test/test/bench/garbage/tree2.go
gcc/testsuite/go.test/test/bench/go1/Makefile [deleted file]
gcc/testsuite/go.test/test/bench/go1/_testmain.go [deleted file]
gcc/testsuite/go.test/test/bench/go1/dummy.go [deleted file]
gcc/testsuite/go.test/test/bench/go1/fasta_test.go
gcc/testsuite/go.test/test/bench/go1/gob_test.go
gcc/testsuite/go.test/test/bench/go1/gzip_test.go
gcc/testsuite/go.test/test/bench/go1/json_test.go
gcc/testsuite/go.test/test/bench/go1/mandel_test.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bench/go1/parser_test.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bench/go1/parserdata_test.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bench/go1/revcomp_test.go
gcc/testsuite/go.test/test/bench/shootout/Makefile [deleted file]
gcc/testsuite/go.test/test/bench/shootout/binary-tree.c
gcc/testsuite/go.test/test/bench/shootout/k-nucleotide.c
gcc/testsuite/go.test/test/bench/shootout/mandelbrot.go
gcc/testsuite/go.test/test/bench/shootout/threadring.c
gcc/testsuite/go.test/test/bench/shootout/timing.log
gcc/testsuite/go.test/test/bench/shootout/timing.sh
gcc/testsuite/go.test/test/bigalg.go
gcc/testsuite/go.test/test/bigmap.go
gcc/testsuite/go.test/test/blank.go
gcc/testsuite/go.test/test/blank1.go
gcc/testsuite/go.test/test/bom.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bombad.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bounds.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bugs/bug395.go
gcc/testsuite/go.test/test/bugs/bug434.dir/one.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bugs/bug434.dir/two.go [new file with mode: 0644]
gcc/testsuite/go.test/test/bugs/bug434.go [new file with mode: 0644]
gcc/testsuite/go.test/test/chan/doubleselect.go
gcc/testsuite/go.test/test/chan/fifo.go
gcc/testsuite/go.test/test/chan/goroutines.go
gcc/testsuite/go.test/test/chan/nonblock.go
gcc/testsuite/go.test/test/chan/perm.go
gcc/testsuite/go.test/test/chan/powser1.go
gcc/testsuite/go.test/test/chan/powser2.go
gcc/testsuite/go.test/test/chan/select.go
gcc/testsuite/go.test/test/chan/select2.go
gcc/testsuite/go.test/test/chan/select3.go
gcc/testsuite/go.test/test/chan/select4.go
gcc/testsuite/go.test/test/chan/select5.go
gcc/testsuite/go.test/test/chan/select6.go
gcc/testsuite/go.test/test/chan/select7.go
gcc/testsuite/go.test/test/chan/sendstmt.go
gcc/testsuite/go.test/test/chan/sieve1.go
gcc/testsuite/go.test/test/chan/sieve2.go
gcc/testsuite/go.test/test/chan/zerosize.go
gcc/testsuite/go.test/test/chancap.go
gcc/testsuite/go.test/test/char_lit.go
gcc/testsuite/go.test/test/char_lit1.go
gcc/testsuite/go.test/test/closedchan.go
gcc/testsuite/go.test/test/closure.go
gcc/testsuite/go.test/test/cmp.go
gcc/testsuite/go.test/test/cmp6.go
gcc/testsuite/go.test/test/cmplx.go
gcc/testsuite/go.test/test/cmplxdivide.c
gcc/testsuite/go.test/test/cmplxdivide.go
gcc/testsuite/go.test/test/cmplxdivide1.go
gcc/testsuite/go.test/test/complit.go
gcc/testsuite/go.test/test/complit1.go
gcc/testsuite/go.test/test/compos.go
gcc/testsuite/go.test/test/const.go
gcc/testsuite/go.test/test/const1.go
gcc/testsuite/go.test/test/const2.go
gcc/testsuite/go.test/test/const3.go
gcc/testsuite/go.test/test/const4.go [new file with mode: 0644]
gcc/testsuite/go.test/test/const5.go [new file with mode: 0644]
gcc/testsuite/go.test/test/convT2X.go [new file with mode: 0644]
gcc/testsuite/go.test/test/convert.go
gcc/testsuite/go.test/test/convert1.go
gcc/testsuite/go.test/test/convert3.go
gcc/testsuite/go.test/test/convlit.go
gcc/testsuite/go.test/test/convlit1.go
gcc/testsuite/go.test/test/copy.go
gcc/testsuite/go.test/test/crlf.go
gcc/testsuite/go.test/test/ddd.go
gcc/testsuite/go.test/test/ddd1.go
gcc/testsuite/go.test/test/ddd2.go
gcc/testsuite/go.test/test/ddd3.go
gcc/testsuite/go.test/test/decl.go
gcc/testsuite/go.test/test/declbad.go
gcc/testsuite/go.test/test/defer.go
gcc/testsuite/go.test/test/deferprint.go
gcc/testsuite/go.test/test/divide.go
gcc/testsuite/go.test/test/dwarf/linedirectives.go
gcc/testsuite/go.test/test/dwarf/main.go
gcc/testsuite/go.test/test/empty.go
gcc/testsuite/go.test/test/env.go
gcc/testsuite/go.test/test/eof.go
gcc/testsuite/go.test/test/eof1.go
gcc/testsuite/go.test/test/escape.go
gcc/testsuite/go.test/test/escape2.go
gcc/testsuite/go.test/test/escape3.go
gcc/testsuite/go.test/test/escape4.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug000.go
gcc/testsuite/go.test/test/fixedbugs/bug002.go
gcc/testsuite/go.test/test/fixedbugs/bug003.go
gcc/testsuite/go.test/test/fixedbugs/bug004.go
gcc/testsuite/go.test/test/fixedbugs/bug005.go
gcc/testsuite/go.test/test/fixedbugs/bug006.go
gcc/testsuite/go.test/test/fixedbugs/bug007.go
gcc/testsuite/go.test/test/fixedbugs/bug008.go
gcc/testsuite/go.test/test/fixedbugs/bug009.go
gcc/testsuite/go.test/test/fixedbugs/bug010.go
gcc/testsuite/go.test/test/fixedbugs/bug011.go
gcc/testsuite/go.test/test/fixedbugs/bug012.go
gcc/testsuite/go.test/test/fixedbugs/bug013.go
gcc/testsuite/go.test/test/fixedbugs/bug014.go
gcc/testsuite/go.test/test/fixedbugs/bug015.go
gcc/testsuite/go.test/test/fixedbugs/bug016.go
gcc/testsuite/go.test/test/fixedbugs/bug017.go
gcc/testsuite/go.test/test/fixedbugs/bug020.go
gcc/testsuite/go.test/test/fixedbugs/bug021.go
gcc/testsuite/go.test/test/fixedbugs/bug022.go
gcc/testsuite/go.test/test/fixedbugs/bug023.go
gcc/testsuite/go.test/test/fixedbugs/bug024.go
gcc/testsuite/go.test/test/fixedbugs/bug026.go
gcc/testsuite/go.test/test/fixedbugs/bug027.go
gcc/testsuite/go.test/test/fixedbugs/bug028.go
gcc/testsuite/go.test/test/fixedbugs/bug030.go
gcc/testsuite/go.test/test/fixedbugs/bug031.go
gcc/testsuite/go.test/test/fixedbugs/bug035.go
gcc/testsuite/go.test/test/fixedbugs/bug036.go [deleted file]
gcc/testsuite/go.test/test/fixedbugs/bug037.go
gcc/testsuite/go.test/test/fixedbugs/bug038.go [deleted file]
gcc/testsuite/go.test/test/fixedbugs/bug039.go
gcc/testsuite/go.test/test/fixedbugs/bug040.go
gcc/testsuite/go.test/test/fixedbugs/bug045.go
gcc/testsuite/go.test/test/fixedbugs/bug046.go
gcc/testsuite/go.test/test/fixedbugs/bug047.go
gcc/testsuite/go.test/test/fixedbugs/bug048.go
gcc/testsuite/go.test/test/fixedbugs/bug049.go
gcc/testsuite/go.test/test/fixedbugs/bug050.go
gcc/testsuite/go.test/test/fixedbugs/bug051.go
gcc/testsuite/go.test/test/fixedbugs/bug052.go
gcc/testsuite/go.test/test/fixedbugs/bug053.go
gcc/testsuite/go.test/test/fixedbugs/bug054.go
gcc/testsuite/go.test/test/fixedbugs/bug055.go
gcc/testsuite/go.test/test/fixedbugs/bug056.go
gcc/testsuite/go.test/test/fixedbugs/bug057.go
gcc/testsuite/go.test/test/fixedbugs/bug058.go
gcc/testsuite/go.test/test/fixedbugs/bug059.go
gcc/testsuite/go.test/test/fixedbugs/bug060.go
gcc/testsuite/go.test/test/fixedbugs/bug061.go
gcc/testsuite/go.test/test/fixedbugs/bug062.go
gcc/testsuite/go.test/test/fixedbugs/bug063.go
gcc/testsuite/go.test/test/fixedbugs/bug064.go
gcc/testsuite/go.test/test/fixedbugs/bug065.go
gcc/testsuite/go.test/test/fixedbugs/bug066.go
gcc/testsuite/go.test/test/fixedbugs/bug067.go
gcc/testsuite/go.test/test/fixedbugs/bug068.go
gcc/testsuite/go.test/test/fixedbugs/bug069.go
gcc/testsuite/go.test/test/fixedbugs/bug070.go
gcc/testsuite/go.test/test/fixedbugs/bug071.go
gcc/testsuite/go.test/test/fixedbugs/bug072.go
gcc/testsuite/go.test/test/fixedbugs/bug073.go
gcc/testsuite/go.test/test/fixedbugs/bug074.go
gcc/testsuite/go.test/test/fixedbugs/bug075.go
gcc/testsuite/go.test/test/fixedbugs/bug076.go
gcc/testsuite/go.test/test/fixedbugs/bug077.go
gcc/testsuite/go.test/test/fixedbugs/bug078.go
gcc/testsuite/go.test/test/fixedbugs/bug080.go
gcc/testsuite/go.test/test/fixedbugs/bug081.go
gcc/testsuite/go.test/test/fixedbugs/bug082.go
gcc/testsuite/go.test/test/fixedbugs/bug083.go
gcc/testsuite/go.test/test/fixedbugs/bug084.go
gcc/testsuite/go.test/test/fixedbugs/bug085.go
gcc/testsuite/go.test/test/fixedbugs/bug086.go
gcc/testsuite/go.test/test/fixedbugs/bug087.go
gcc/testsuite/go.test/test/fixedbugs/bug088.go
gcc/testsuite/go.test/test/fixedbugs/bug089.go
gcc/testsuite/go.test/test/fixedbugs/bug090.go
gcc/testsuite/go.test/test/fixedbugs/bug091.go
gcc/testsuite/go.test/test/fixedbugs/bug092.go
gcc/testsuite/go.test/test/fixedbugs/bug093.go
gcc/testsuite/go.test/test/fixedbugs/bug094.go
gcc/testsuite/go.test/test/fixedbugs/bug096.go
gcc/testsuite/go.test/test/fixedbugs/bug097.go
gcc/testsuite/go.test/test/fixedbugs/bug098.go
gcc/testsuite/go.test/test/fixedbugs/bug099.go
gcc/testsuite/go.test/test/fixedbugs/bug101.go
gcc/testsuite/go.test/test/fixedbugs/bug102.go
gcc/testsuite/go.test/test/fixedbugs/bug103.go
gcc/testsuite/go.test/test/fixedbugs/bug104.go
gcc/testsuite/go.test/test/fixedbugs/bug106.go
gcc/testsuite/go.test/test/fixedbugs/bug107.go
gcc/testsuite/go.test/test/fixedbugs/bug108.go
gcc/testsuite/go.test/test/fixedbugs/bug109.go
gcc/testsuite/go.test/test/fixedbugs/bug110.go
gcc/testsuite/go.test/test/fixedbugs/bug111.go
gcc/testsuite/go.test/test/fixedbugs/bug112.go
gcc/testsuite/go.test/test/fixedbugs/bug113.go
gcc/testsuite/go.test/test/fixedbugs/bug114.go
gcc/testsuite/go.test/test/fixedbugs/bug115.go
gcc/testsuite/go.test/test/fixedbugs/bug116.go
gcc/testsuite/go.test/test/fixedbugs/bug117.go
gcc/testsuite/go.test/test/fixedbugs/bug118.go
gcc/testsuite/go.test/test/fixedbugs/bug119.go
gcc/testsuite/go.test/test/fixedbugs/bug120.go
gcc/testsuite/go.test/test/fixedbugs/bug121.go
gcc/testsuite/go.test/test/fixedbugs/bug122.go
gcc/testsuite/go.test/test/fixedbugs/bug123.go
gcc/testsuite/go.test/test/fixedbugs/bug126.go
gcc/testsuite/go.test/test/fixedbugs/bug127.go
gcc/testsuite/go.test/test/fixedbugs/bug128.go
gcc/testsuite/go.test/test/fixedbugs/bug129.go
gcc/testsuite/go.test/test/fixedbugs/bug130.go
gcc/testsuite/go.test/test/fixedbugs/bug131.go
gcc/testsuite/go.test/test/fixedbugs/bug132.go
gcc/testsuite/go.test/test/fixedbugs/bug133.go
gcc/testsuite/go.test/test/fixedbugs/bug135.go
gcc/testsuite/go.test/test/fixedbugs/bug136.go
gcc/testsuite/go.test/test/fixedbugs/bug137.go
gcc/testsuite/go.test/test/fixedbugs/bug139.go
gcc/testsuite/go.test/test/fixedbugs/bug140.go
gcc/testsuite/go.test/test/fixedbugs/bug141.go
gcc/testsuite/go.test/test/fixedbugs/bug142.go
gcc/testsuite/go.test/test/fixedbugs/bug143.go
gcc/testsuite/go.test/test/fixedbugs/bug144.go
gcc/testsuite/go.test/test/fixedbugs/bug145.go
gcc/testsuite/go.test/test/fixedbugs/bug146.go
gcc/testsuite/go.test/test/fixedbugs/bug147.go
gcc/testsuite/go.test/test/fixedbugs/bug148.go
gcc/testsuite/go.test/test/fixedbugs/bug149.go
gcc/testsuite/go.test/test/fixedbugs/bug150.go
gcc/testsuite/go.test/test/fixedbugs/bug151.go
gcc/testsuite/go.test/test/fixedbugs/bug1515.go
gcc/testsuite/go.test/test/fixedbugs/bug152.go
gcc/testsuite/go.test/test/fixedbugs/bug154.go
gcc/testsuite/go.test/test/fixedbugs/bug155.go
gcc/testsuite/go.test/test/fixedbugs/bug156.go
gcc/testsuite/go.test/test/fixedbugs/bug157.go
gcc/testsuite/go.test/test/fixedbugs/bug158.go
gcc/testsuite/go.test/test/fixedbugs/bug159.go
gcc/testsuite/go.test/test/fixedbugs/bug160.go
gcc/testsuite/go.test/test/fixedbugs/bug161.go
gcc/testsuite/go.test/test/fixedbugs/bug163.go
gcc/testsuite/go.test/test/fixedbugs/bug164.go
gcc/testsuite/go.test/test/fixedbugs/bug165.go
gcc/testsuite/go.test/test/fixedbugs/bug167.go
gcc/testsuite/go.test/test/fixedbugs/bug168.go
gcc/testsuite/go.test/test/fixedbugs/bug169.go
gcc/testsuite/go.test/test/fixedbugs/bug170.go
gcc/testsuite/go.test/test/fixedbugs/bug171.go
gcc/testsuite/go.test/test/fixedbugs/bug172.go
gcc/testsuite/go.test/test/fixedbugs/bug173.go
gcc/testsuite/go.test/test/fixedbugs/bug174.go
gcc/testsuite/go.test/test/fixedbugs/bug175.go
gcc/testsuite/go.test/test/fixedbugs/bug176.go
gcc/testsuite/go.test/test/fixedbugs/bug177.go
gcc/testsuite/go.test/test/fixedbugs/bug178.go
gcc/testsuite/go.test/test/fixedbugs/bug179.go
gcc/testsuite/go.test/test/fixedbugs/bug180.go
gcc/testsuite/go.test/test/fixedbugs/bug181.go
gcc/testsuite/go.test/test/fixedbugs/bug182.go
gcc/testsuite/go.test/test/fixedbugs/bug183.go
gcc/testsuite/go.test/test/fixedbugs/bug184.go
gcc/testsuite/go.test/test/fixedbugs/bug185.go
gcc/testsuite/go.test/test/fixedbugs/bug186.go
gcc/testsuite/go.test/test/fixedbugs/bug187.go
gcc/testsuite/go.test/test/fixedbugs/bug188.go
gcc/testsuite/go.test/test/fixedbugs/bug189.go
gcc/testsuite/go.test/test/fixedbugs/bug190.go
gcc/testsuite/go.test/test/fixedbugs/bug191.go
gcc/testsuite/go.test/test/fixedbugs/bug192.go
gcc/testsuite/go.test/test/fixedbugs/bug193.go
gcc/testsuite/go.test/test/fixedbugs/bug194.go
gcc/testsuite/go.test/test/fixedbugs/bug195.go
gcc/testsuite/go.test/test/fixedbugs/bug196.go
gcc/testsuite/go.test/test/fixedbugs/bug197.go
gcc/testsuite/go.test/test/fixedbugs/bug198.go
gcc/testsuite/go.test/test/fixedbugs/bug199.go
gcc/testsuite/go.test/test/fixedbugs/bug200.go
gcc/testsuite/go.test/test/fixedbugs/bug201.go
gcc/testsuite/go.test/test/fixedbugs/bug202.go
gcc/testsuite/go.test/test/fixedbugs/bug203.go
gcc/testsuite/go.test/test/fixedbugs/bug204.go
gcc/testsuite/go.test/test/fixedbugs/bug205.go
gcc/testsuite/go.test/test/fixedbugs/bug206.go
gcc/testsuite/go.test/test/fixedbugs/bug206.out [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug207.go
gcc/testsuite/go.test/test/fixedbugs/bug208.go
gcc/testsuite/go.test/test/fixedbugs/bug209.go
gcc/testsuite/go.test/test/fixedbugs/bug211.go
gcc/testsuite/go.test/test/fixedbugs/bug212.go
gcc/testsuite/go.test/test/fixedbugs/bug213.go
gcc/testsuite/go.test/test/fixedbugs/bug214.go
gcc/testsuite/go.test/test/fixedbugs/bug215.go
gcc/testsuite/go.test/test/fixedbugs/bug216.go
gcc/testsuite/go.test/test/fixedbugs/bug217.go
gcc/testsuite/go.test/test/fixedbugs/bug218.go
gcc/testsuite/go.test/test/fixedbugs/bug219.go
gcc/testsuite/go.test/test/fixedbugs/bug221.go
gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug.go
gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug2.go
gcc/testsuite/go.test/test/fixedbugs/bug222.go
gcc/testsuite/go.test/test/fixedbugs/bug223.go
gcc/testsuite/go.test/test/fixedbugs/bug224.go
gcc/testsuite/go.test/test/fixedbugs/bug225.go
gcc/testsuite/go.test/test/fixedbugs/bug227.go
gcc/testsuite/go.test/test/fixedbugs/bug228.go
gcc/testsuite/go.test/test/fixedbugs/bug229.go
gcc/testsuite/go.test/test/fixedbugs/bug230.go
gcc/testsuite/go.test/test/fixedbugs/bug231.go
gcc/testsuite/go.test/test/fixedbugs/bug232.go
gcc/testsuite/go.test/test/fixedbugs/bug233.go
gcc/testsuite/go.test/test/fixedbugs/bug234.go
gcc/testsuite/go.test/test/fixedbugs/bug235.go
gcc/testsuite/go.test/test/fixedbugs/bug236.go
gcc/testsuite/go.test/test/fixedbugs/bug237.go
gcc/testsuite/go.test/test/fixedbugs/bug238.go
gcc/testsuite/go.test/test/fixedbugs/bug239.go
gcc/testsuite/go.test/test/fixedbugs/bug240.go
gcc/testsuite/go.test/test/fixedbugs/bug241.go
gcc/testsuite/go.test/test/fixedbugs/bug242.go
gcc/testsuite/go.test/test/fixedbugs/bug243.go
gcc/testsuite/go.test/test/fixedbugs/bug244.go
gcc/testsuite/go.test/test/fixedbugs/bug245.go
gcc/testsuite/go.test/test/fixedbugs/bug246.go
gcc/testsuite/go.test/test/fixedbugs/bug247.go
gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug0.go
gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug1.go
gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go
gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go
gcc/testsuite/go.test/test/fixedbugs/bug248.go
gcc/testsuite/go.test/test/fixedbugs/bug249.go
gcc/testsuite/go.test/test/fixedbugs/bug250.go
gcc/testsuite/go.test/test/fixedbugs/bug251.go
gcc/testsuite/go.test/test/fixedbugs/bug252.go
gcc/testsuite/go.test/test/fixedbugs/bug253.go
gcc/testsuite/go.test/test/fixedbugs/bug254.go
gcc/testsuite/go.test/test/fixedbugs/bug255.go
gcc/testsuite/go.test/test/fixedbugs/bug256.go
gcc/testsuite/go.test/test/fixedbugs/bug257.go
gcc/testsuite/go.test/test/fixedbugs/bug258.go
gcc/testsuite/go.test/test/fixedbugs/bug259.go
gcc/testsuite/go.test/test/fixedbugs/bug260.go
gcc/testsuite/go.test/test/fixedbugs/bug261.go
gcc/testsuite/go.test/test/fixedbugs/bug262.go
gcc/testsuite/go.test/test/fixedbugs/bug263.go
gcc/testsuite/go.test/test/fixedbugs/bug264.go
gcc/testsuite/go.test/test/fixedbugs/bug265.go
gcc/testsuite/go.test/test/fixedbugs/bug266.go
gcc/testsuite/go.test/test/fixedbugs/bug267.go
gcc/testsuite/go.test/test/fixedbugs/bug269.go
gcc/testsuite/go.test/test/fixedbugs/bug271.go
gcc/testsuite/go.test/test/fixedbugs/bug272.go
gcc/testsuite/go.test/test/fixedbugs/bug273.go
gcc/testsuite/go.test/test/fixedbugs/bug274.go
gcc/testsuite/go.test/test/fixedbugs/bug275.go
gcc/testsuite/go.test/test/fixedbugs/bug276.go
gcc/testsuite/go.test/test/fixedbugs/bug277.go
gcc/testsuite/go.test/test/fixedbugs/bug278.go
gcc/testsuite/go.test/test/fixedbugs/bug279.go
gcc/testsuite/go.test/test/fixedbugs/bug280.go
gcc/testsuite/go.test/test/fixedbugs/bug281.go
gcc/testsuite/go.test/test/fixedbugs/bug282.go
gcc/testsuite/go.test/test/fixedbugs/bug283.go
gcc/testsuite/go.test/test/fixedbugs/bug284.go
gcc/testsuite/go.test/test/fixedbugs/bug285.go
gcc/testsuite/go.test/test/fixedbugs/bug286.go
gcc/testsuite/go.test/test/fixedbugs/bug287.go
gcc/testsuite/go.test/test/fixedbugs/bug288.go
gcc/testsuite/go.test/test/fixedbugs/bug289.go
gcc/testsuite/go.test/test/fixedbugs/bug290.go
gcc/testsuite/go.test/test/fixedbugs/bug291.go
gcc/testsuite/go.test/test/fixedbugs/bug292.go
gcc/testsuite/go.test/test/fixedbugs/bug293.go
gcc/testsuite/go.test/test/fixedbugs/bug294.go
gcc/testsuite/go.test/test/fixedbugs/bug295.go
gcc/testsuite/go.test/test/fixedbugs/bug296.go
gcc/testsuite/go.test/test/fixedbugs/bug297.go
gcc/testsuite/go.test/test/fixedbugs/bug298.go
gcc/testsuite/go.test/test/fixedbugs/bug299.go
gcc/testsuite/go.test/test/fixedbugs/bug300.go
gcc/testsuite/go.test/test/fixedbugs/bug301.go
gcc/testsuite/go.test/test/fixedbugs/bug302.go
gcc/testsuite/go.test/test/fixedbugs/bug303.go
gcc/testsuite/go.test/test/fixedbugs/bug304.go
gcc/testsuite/go.test/test/fixedbugs/bug305.go
gcc/testsuite/go.test/test/fixedbugs/bug306.go
gcc/testsuite/go.test/test/fixedbugs/bug307.go
gcc/testsuite/go.test/test/fixedbugs/bug308.go
gcc/testsuite/go.test/test/fixedbugs/bug309.go
gcc/testsuite/go.test/test/fixedbugs/bug311.go
gcc/testsuite/go.test/test/fixedbugs/bug312.go
gcc/testsuite/go.test/test/fixedbugs/bug313.go
gcc/testsuite/go.test/test/fixedbugs/bug314.go
gcc/testsuite/go.test/test/fixedbugs/bug315.go
gcc/testsuite/go.test/test/fixedbugs/bug316.go
gcc/testsuite/go.test/test/fixedbugs/bug317.go
gcc/testsuite/go.test/test/fixedbugs/bug318.go
gcc/testsuite/go.test/test/fixedbugs/bug319.go
gcc/testsuite/go.test/test/fixedbugs/bug320.go
gcc/testsuite/go.test/test/fixedbugs/bug321.go
gcc/testsuite/go.test/test/fixedbugs/bug322.go
gcc/testsuite/go.test/test/fixedbugs/bug323.go
gcc/testsuite/go.test/test/fixedbugs/bug324.go
gcc/testsuite/go.test/test/fixedbugs/bug325.go
gcc/testsuite/go.test/test/fixedbugs/bug326.go
gcc/testsuite/go.test/test/fixedbugs/bug327.go
gcc/testsuite/go.test/test/fixedbugs/bug328.go
gcc/testsuite/go.test/test/fixedbugs/bug329.go
gcc/testsuite/go.test/test/fixedbugs/bug330.go
gcc/testsuite/go.test/test/fixedbugs/bug331.go
gcc/testsuite/go.test/test/fixedbugs/bug332.go
gcc/testsuite/go.test/test/fixedbugs/bug333.go
gcc/testsuite/go.test/test/fixedbugs/bug334.go
gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go
gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go
gcc/testsuite/go.test/test/fixedbugs/bug335.go
gcc/testsuite/go.test/test/fixedbugs/bug336.go
gcc/testsuite/go.test/test/fixedbugs/bug337.go
gcc/testsuite/go.test/test/fixedbugs/bug338.go
gcc/testsuite/go.test/test/fixedbugs/bug339.go
gcc/testsuite/go.test/test/fixedbugs/bug340.go
gcc/testsuite/go.test/test/fixedbugs/bug341.go
gcc/testsuite/go.test/test/fixedbugs/bug342.go
gcc/testsuite/go.test/test/fixedbugs/bug343.go
gcc/testsuite/go.test/test/fixedbugs/bug344.go
gcc/testsuite/go.test/test/fixedbugs/bug345.go
gcc/testsuite/go.test/test/fixedbugs/bug346.go
gcc/testsuite/go.test/test/fixedbugs/bug347.go
gcc/testsuite/go.test/test/fixedbugs/bug348.go
gcc/testsuite/go.test/test/fixedbugs/bug349.go
gcc/testsuite/go.test/test/fixedbugs/bug350.go
gcc/testsuite/go.test/test/fixedbugs/bug351.go
gcc/testsuite/go.test/test/fixedbugs/bug352.go
gcc/testsuite/go.test/test/fixedbugs/bug353.go
gcc/testsuite/go.test/test/fixedbugs/bug354.go
gcc/testsuite/go.test/test/fixedbugs/bug355.go
gcc/testsuite/go.test/test/fixedbugs/bug356.go
gcc/testsuite/go.test/test/fixedbugs/bug357.go
gcc/testsuite/go.test/test/fixedbugs/bug358.go
gcc/testsuite/go.test/test/fixedbugs/bug361.go
gcc/testsuite/go.test/test/fixedbugs/bug362.go
gcc/testsuite/go.test/test/fixedbugs/bug363.go
gcc/testsuite/go.test/test/fixedbugs/bug364.go
gcc/testsuite/go.test/test/fixedbugs/bug365.go
gcc/testsuite/go.test/test/fixedbugs/bug366.go
gcc/testsuite/go.test/test/fixedbugs/bug367.dir/main.go
gcc/testsuite/go.test/test/fixedbugs/bug367.dir/p.go
gcc/testsuite/go.test/test/fixedbugs/bug367.go
gcc/testsuite/go.test/test/fixedbugs/bug368.go
gcc/testsuite/go.test/test/fixedbugs/bug369.go
gcc/testsuite/go.test/test/fixedbugs/bug370.go
gcc/testsuite/go.test/test/fixedbugs/bug371.go
gcc/testsuite/go.test/test/fixedbugs/bug372.go
gcc/testsuite/go.test/test/fixedbugs/bug373.go
gcc/testsuite/go.test/test/fixedbugs/bug374.go
gcc/testsuite/go.test/test/fixedbugs/bug375.go
gcc/testsuite/go.test/test/fixedbugs/bug376.go
gcc/testsuite/go.test/test/fixedbugs/bug377.dir/one.go
gcc/testsuite/go.test/test/fixedbugs/bug377.dir/two.go
gcc/testsuite/go.test/test/fixedbugs/bug377.go
gcc/testsuite/go.test/test/fixedbugs/bug378.go
gcc/testsuite/go.test/test/fixedbugs/bug379.go
gcc/testsuite/go.test/test/fixedbugs/bug380.go
gcc/testsuite/go.test/test/fixedbugs/bug381.go
gcc/testsuite/go.test/test/fixedbugs/bug382.go
gcc/testsuite/go.test/test/fixedbugs/bug383.go
gcc/testsuite/go.test/test/fixedbugs/bug384.go
gcc/testsuite/go.test/test/fixedbugs/bug385_32.go
gcc/testsuite/go.test/test/fixedbugs/bug385_64.go
gcc/testsuite/go.test/test/fixedbugs/bug386.go
gcc/testsuite/go.test/test/fixedbugs/bug387.go
gcc/testsuite/go.test/test/fixedbugs/bug388.go
gcc/testsuite/go.test/test/fixedbugs/bug389.go
gcc/testsuite/go.test/test/fixedbugs/bug390.go
gcc/testsuite/go.test/test/fixedbugs/bug391.go
gcc/testsuite/go.test/test/fixedbugs/bug392.dir/one.go
gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg2.go [moved from gcc/testsuite/go.test/test/fixedbugs/bug392.dir/two.go with 83% similarity]
gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug392.go
gcc/testsuite/go.test/test/fixedbugs/bug393.go
gcc/testsuite/go.test/test/fixedbugs/bug394.go
gcc/testsuite/go.test/test/fixedbugs/bug396.dir/one.go
gcc/testsuite/go.test/test/fixedbugs/bug396.go
gcc/testsuite/go.test/test/fixedbugs/bug397.go
gcc/testsuite/go.test/test/fixedbugs/bug398.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug399.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug401.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug402.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug403.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug404.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug405.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug406.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug407.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug409.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug409.out [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug410.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug411.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug412.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug413.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug414.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug415.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug416.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug417.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug418.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug419.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug420.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug421.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug422.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug423.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug424.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug425.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug426.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug427.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug428.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug429.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug430.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug431.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug432.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug433.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug434.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug435.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug436.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug437.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug438.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug439.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug440_32.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug440_64.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug441.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug442.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug443.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug444.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug445.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug446.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug447.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug448.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug449.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug450.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug451.go [new file with mode: 0644]
gcc/testsuite/go.test/test/fixedbugs/bug452.go [new file with mode: 0644]
gcc/testsuite/go.test/test/float_lit.go
gcc/testsuite/go.test/test/floatcmp.go
gcc/testsuite/go.test/test/for.go
gcc/testsuite/go.test/test/func.go
gcc/testsuite/go.test/test/func1.go
gcc/testsuite/go.test/test/func2.go
gcc/testsuite/go.test/test/func3.go
gcc/testsuite/go.test/test/func4.go
gcc/testsuite/go.test/test/func5.go
gcc/testsuite/go.test/test/func6.go
gcc/testsuite/go.test/test/func7.go
gcc/testsuite/go.test/test/func8.go [new file with mode: 0644]
gcc/testsuite/go.test/test/gc.go
gcc/testsuite/go.test/test/gc1.go
gcc/testsuite/go.test/test/gc2.go
gcc/testsuite/go.test/test/golden.out
gcc/testsuite/go.test/test/goprint.go
gcc/testsuite/go.test/test/goto.go
gcc/testsuite/go.test/test/hashmap.go [deleted file]
gcc/testsuite/go.test/test/helloworld.go
gcc/testsuite/go.test/test/if.go
gcc/testsuite/go.test/test/import.go
gcc/testsuite/go.test/test/import1.go
gcc/testsuite/go.test/test/import2.go
gcc/testsuite/go.test/test/import3.go
gcc/testsuite/go.test/test/import4.go
gcc/testsuite/go.test/test/import5.go [new file with mode: 0644]
gcc/testsuite/go.test/test/index.go
gcc/testsuite/go.test/test/indirect.go
gcc/testsuite/go.test/test/indirect1.go
gcc/testsuite/go.test/test/init.go
gcc/testsuite/go.test/test/init1.go
gcc/testsuite/go.test/test/initcomma.go
gcc/testsuite/go.test/test/initialize.go
gcc/testsuite/go.test/test/initializerr.go
gcc/testsuite/go.test/test/initsyscall.go [deleted file]
gcc/testsuite/go.test/test/int_lit.go
gcc/testsuite/go.test/test/intcvt.go
gcc/testsuite/go.test/test/interface/bigdata.go
gcc/testsuite/go.test/test/interface/convert.go
gcc/testsuite/go.test/test/interface/convert1.go
gcc/testsuite/go.test/test/interface/convert2.go
gcc/testsuite/go.test/test/interface/embed.go
gcc/testsuite/go.test/test/interface/embed0.go
gcc/testsuite/go.test/test/interface/embed1.go
gcc/testsuite/go.test/test/interface/embed2.go
gcc/testsuite/go.test/test/interface/explicit.go
gcc/testsuite/go.test/test/interface/fail.go
gcc/testsuite/go.test/test/interface/fake.go
gcc/testsuite/go.test/test/interface/noeq.go
gcc/testsuite/go.test/test/interface/pointer.go
gcc/testsuite/go.test/test/interface/private.go
gcc/testsuite/go.test/test/interface/private1.go
gcc/testsuite/go.test/test/interface/receiver.go
gcc/testsuite/go.test/test/interface/receiver1.go
gcc/testsuite/go.test/test/interface/recursive.go
gcc/testsuite/go.test/test/interface/recursive1.go
gcc/testsuite/go.test/test/interface/recursive2.go
gcc/testsuite/go.test/test/interface/returntype.go
gcc/testsuite/go.test/test/interface/struct.go
gcc/testsuite/go.test/test/iota.go
gcc/testsuite/go.test/test/ken/array.go
gcc/testsuite/go.test/test/ken/chan.go
gcc/testsuite/go.test/test/ken/chan1.go
gcc/testsuite/go.test/test/ken/complit.go
gcc/testsuite/go.test/test/ken/convert.go
gcc/testsuite/go.test/test/ken/cplx0.go
gcc/testsuite/go.test/test/ken/cplx1.go
gcc/testsuite/go.test/test/ken/cplx2.go
gcc/testsuite/go.test/test/ken/cplx3.go
gcc/testsuite/go.test/test/ken/cplx4.go
gcc/testsuite/go.test/test/ken/cplx5.go
gcc/testsuite/go.test/test/ken/divconst.go
gcc/testsuite/go.test/test/ken/divmod.go
gcc/testsuite/go.test/test/ken/embed.go
gcc/testsuite/go.test/test/ken/for.go
gcc/testsuite/go.test/test/ken/interbasic.go
gcc/testsuite/go.test/test/ken/interfun.go
gcc/testsuite/go.test/test/ken/intervar.go
gcc/testsuite/go.test/test/ken/label.go
gcc/testsuite/go.test/test/ken/litfun.go
gcc/testsuite/go.test/test/ken/mfunc.go
gcc/testsuite/go.test/test/ken/modconst.go
gcc/testsuite/go.test/test/ken/ptrfun.go
gcc/testsuite/go.test/test/ken/ptrvar.go
gcc/testsuite/go.test/test/ken/range.go
gcc/testsuite/go.test/test/ken/rob1.go
gcc/testsuite/go.test/test/ken/rob2.go
gcc/testsuite/go.test/test/ken/robfor.go
gcc/testsuite/go.test/test/ken/robfunc.go
gcc/testsuite/go.test/test/ken/shift.go
gcc/testsuite/go.test/test/ken/simparray.go
gcc/testsuite/go.test/test/ken/simpbool.go
gcc/testsuite/go.test/test/ken/simpconv.go
gcc/testsuite/go.test/test/ken/simpfun.go
gcc/testsuite/go.test/test/ken/simpswitch.go
gcc/testsuite/go.test/test/ken/simpvar.go
gcc/testsuite/go.test/test/ken/slicearray.go
gcc/testsuite/go.test/test/ken/sliceslice.go
gcc/testsuite/go.test/test/ken/string.go
gcc/testsuite/go.test/test/ken/strvar.go
gcc/testsuite/go.test/test/label.go
gcc/testsuite/go.test/test/label1.go
gcc/testsuite/go.test/test/linkx.go [new file with mode: 0644]
gcc/testsuite/go.test/test/literal.go
gcc/testsuite/go.test/test/mallocfin.go
gcc/testsuite/go.test/test/map.go
gcc/testsuite/go.test/test/map1.go
gcc/testsuite/go.test/test/method.go
gcc/testsuite/go.test/test/method1.go
gcc/testsuite/go.test/test/method2.go
gcc/testsuite/go.test/test/method3.go
gcc/testsuite/go.test/test/method4.go [new file with mode: 0644]
gcc/testsuite/go.test/test/method4a.go [new file with mode: 0644]
gcc/testsuite/go.test/test/named.go
gcc/testsuite/go.test/test/named1.go
gcc/testsuite/go.test/test/nil.go
gcc/testsuite/go.test/test/nilptr.go
gcc/testsuite/go.test/test/nul1.go
gcc/testsuite/go.test/test/parentype.go
gcc/testsuite/go.test/test/peano.go
gcc/testsuite/go.test/test/printbig.go
gcc/testsuite/go.test/test/range.go
gcc/testsuite/go.test/test/recover.go
gcc/testsuite/go.test/test/recover1.go
gcc/testsuite/go.test/test/recover2.go
gcc/testsuite/go.test/test/recover3.go
gcc/testsuite/go.test/test/rename.go
gcc/testsuite/go.test/test/rename1.go
gcc/testsuite/go.test/test/reorder.go
gcc/testsuite/go.test/test/reorder2.go [new file with mode: 0644]
gcc/testsuite/go.test/test/rotate.go [new file with mode: 0644]
gcc/testsuite/go.test/test/run
gcc/testsuite/go.test/test/run.go [new file with mode: 0644]
gcc/testsuite/go.test/test/rune.go
gcc/testsuite/go.test/test/runtime.go
gcc/testsuite/go.test/test/safe/main.go [new file with mode: 0644]
gcc/testsuite/go.test/test/safe/nousesafe.go [new file with mode: 0644]
gcc/testsuite/go.test/test/safe/pkg.go [new file with mode: 0644]
gcc/testsuite/go.test/test/safe/usesafe.go [new file with mode: 0644]
gcc/testsuite/go.test/test/shift1.go
gcc/testsuite/go.test/test/shift2.go
gcc/testsuite/go.test/test/sieve.go
gcc/testsuite/go.test/test/sigchld.go
gcc/testsuite/go.test/test/simassign.go
gcc/testsuite/go.test/test/sinit.go
gcc/testsuite/go.test/test/sizeof.go
gcc/testsuite/go.test/test/solitaire.go
gcc/testsuite/go.test/test/stack.go
gcc/testsuite/go.test/test/string_lit.go
gcc/testsuite/go.test/test/stringrange.go
gcc/testsuite/go.test/test/struct0.go
gcc/testsuite/go.test/test/switch.go
gcc/testsuite/go.test/test/switch1.go [deleted file]
gcc/testsuite/go.test/test/switch3.go
gcc/testsuite/go.test/test/syntax/chan.go
gcc/testsuite/go.test/test/syntax/chan1.go
gcc/testsuite/go.test/test/syntax/composite.go [new file with mode: 0644]
gcc/testsuite/go.test/test/syntax/else.go
gcc/testsuite/go.test/test/syntax/forvar.go
gcc/testsuite/go.test/test/syntax/if.go
gcc/testsuite/go.test/test/syntax/import.go
gcc/testsuite/go.test/test/syntax/interface.go
gcc/testsuite/go.test/test/syntax/semi1.go
gcc/testsuite/go.test/test/syntax/semi2.go
gcc/testsuite/go.test/test/syntax/semi3.go
gcc/testsuite/go.test/test/syntax/semi4.go
gcc/testsuite/go.test/test/syntax/semi5.go
gcc/testsuite/go.test/test/syntax/semi6.go
gcc/testsuite/go.test/test/syntax/semi7.go
gcc/testsuite/go.test/test/syntax/topexpr.go
gcc/testsuite/go.test/test/syntax/typesw.go
gcc/testsuite/go.test/test/syntax/vareq.go
gcc/testsuite/go.test/test/syntax/vareq1.go
gcc/testsuite/go.test/test/test0.go [deleted file]
gcc/testsuite/go.test/test/testlib [new file with mode: 0644]
gcc/testsuite/go.test/test/times.out [deleted file]
gcc/testsuite/go.test/test/turing.go
gcc/testsuite/go.test/test/typeswitch.go
gcc/testsuite/go.test/test/typeswitch1.go
gcc/testsuite/go.test/test/typeswitch2.go
gcc/testsuite/go.test/test/typeswitch3.go
gcc/testsuite/go.test/test/undef.go
gcc/testsuite/go.test/test/utf.go
gcc/testsuite/go.test/test/varerr.go
gcc/testsuite/go.test/test/varinit.go
gcc/testsuite/go.test/test/zerodivide.go

index 502ffdc511e584eb32022c3edc49ee65332d37ee..fe022d54e342b6a2b793a75f682883f43561c999 100644 (file)
@@ -1,3 +1,7 @@
+2012-09-29  Ian Lance Taylor  <iant@google.com>
+
+       * go.test/go-test.exp: Update for latest version of Go testsuite.
+
 2012-09-29  Thomas König  <tkoenig@gcc.gnu.org>
 
        PR fortran/52724
index 943a7f1a1a72f0f352f13cfbe3c33ecd676b1944..b093f01c843f88dee9325f36c098ac02f9fa82d4 100644 (file)
@@ -26,6 +26,8 @@
 #   D   The directory of the test.
 #
 # Typical command lines:
+# // compile
+# // run
 # // $G $D/$F.go && $L $F.$A && ./$A.out
 # // $G $D/$F.go && $L $F.$A || echo BUG: known to fail incorrectly
 # // $G $D/$F.go && echo BUG: compilation succeeds incorrectly
@@ -267,7 +269,7 @@ proc go-gc-tests { } {
     # frontend ignores the standard options, it doesn't significantly
     # improve testing.
     set saved_torture_options $TORTURE_OPTIONS
-    set TORTURE_OPTIONS [ list { -O2 -g }]
+    set TORTURE_OPTIONS [list { -O2 -g }]
 
     set saved-dg-do-what-default ${dg-do-what-default}
 
@@ -316,13 +318,6 @@ proc go-gc-tests { } {
            }
        }
 
-       if { [string match "*bug347*" $test] \
-                || [string match "*bug348*" $test] } {
-           # These bugs rely on runtime.Caller which currently fails.
-           untested $name
-           continue
-       }
-
        if { [file tail $test] == "init1.go" } {
            # This tests whether GC runs during init, which for gccgo
            # it currently does not.
@@ -347,6 +342,22 @@ proc go-gc-tests { } {
            continue
        }
 
+       if { [file tail $test] == "rotate.go" } {
+           # This test produces a temporary file that takes too long
+           # to compile--5 minutes on my laptop without optimization.
+           # When compiling without optimization it tests nothing
+           # useful, since the point of the test is to see whether
+           # the compiler generates rotate instructions.
+           untested $name
+           continue
+       }
+
+       if { [file tail $test] == "bug347.go" \
+                || [file tail $test] == "bug348.go" } {
+           # These tests don't work if the functions are inlined.
+           set TORTURE_OPTIONS [list { -O0 -g }]
+       }
+
        set fd [open $test r]
 
        set lines_ok 1
@@ -424,9 +435,24 @@ proc go-gc-tests { } {
            }
        }
 
-       if { $test_line == "// \$G \$D/\$F\.go && \$L \$F\.\$A && \./\$A\.out >tmp.go &&" \
-            && $test_line2 == "// \$G tmp\.go && \$L tmp\.\$A && \./\$A\.out || echo BUG: 64bit" } {
-           # 64bit.go is a special case.
+       if { $test_line == "// compile"
+            || $test_line == "// echo bug395 is broken  # takes 90+ seconds to break" } {
+           # This is a vanilla compile test.
+           set dg-do-what-default "assemble"
+           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
+       } elseif { $test_line == "// run"
+                  || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" } {
+           # This is a vanilla execution test.
+           go-torture-execute $test
+           file delete core [glob -nocomplain core.*]
+       } elseif { $test_line == "// build" } {
+           # This is a vanilla compile and link test.
+           set dg-do-what-default "link"
+           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
+       } elseif { $test_line == "// runoutput" \
+                      || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&"
+                          && $test_line2 == "// ./\$A.out >tmp.go && \$G tmp.go && \$L -o \$A.out1 tmp.\$A && ./\$A.out1") } {
+           # Run the test to get a .go program to run.
            set go_execute_args ""
            set hold_runtests $runtests
            set runtests "go-test.exp"
@@ -440,42 +466,17 @@ proc go-gc-tests { } {
                } else {
                    pass "$name execution"
                    file delete $base-out.x
-                   # Disable optimizations as this test takes a long time
-                   # to compile.
-                   set hold $TORTURE_OPTIONS
-                   set TORTURE_OPTIONS [ list { -O0 -g }]
+                   # Disable optimizations as some of these tests
+                   # take a long time to compile.
+                   set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }]
                    go-torture-execute "./$base-out.go"
-                   set TORTURE_OPTIONS $hold
                }
                file delete $base-out.go
            }
            file delete $output_file
            set runtests $hold_runtests
-       } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \
-                  || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" \
-                  || $test_line == "// \$G \$F.go && \$L \$F.\$A &&./\$A.out" \
-                  || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && \$A.out" \
-                  || [string match \
-                          "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out || echo BUG*" \
-                          $test_line]
-                  || [string match \
-                          "// \$G \$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \
-                          $test_line]
-                  || [string match \
-                          "// \$G \$D/\$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \
-                          $test_line]
-                  || [string match \
-                          "// \$G \$F.go && \$L \$F.\$A && GOMAXPROCS=* ./\$A.out" \
-                          $test_line]
-                  || [string match \
-                          "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >* || echo BUG*" \
-                          $test_line] } {
-           # This is a vanilla execution test.
-           go-torture-execute $test
-           file delete core [glob -nocomplain core.*]
-       } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \
-                      || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \
-                      || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } {
+       } elseif { $test_line == "// cmpout" \
+                  || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } {
            # This is an execution test for which we need to check the
            # program output.
            set hold_runtests $runtests
@@ -495,109 +496,38 @@ proc go-gc-tests { } {
                    regsub "\\.go$" $test ".out" expect
                    filecmp $expect $base.p "$name compare"
                }
-               #file delete $base.p
+               file delete $base.p
            } else {
                untested "$name execution"
                untested "$name compare"
            }
            set runtests $hold_runtests
-       } elseif { [string match \
-                       "// \$G \$D/\$F.go && \$L \$F.\$A || echo BUG*" \
-                       $test_line] \
-                  || [string match "// \$G \$F.go && \$L \$F.\$A  #*" \
-                          $test_line]
-                  || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A" } {
-           # This is a vanilla compile and link test.
-           set dg-do-what-default "link"
-           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
-       } elseif { [string match "// \$G \$D/\$F.go" $test_line] \
-                  || [string match "// \$G \$D/\$F.go || echo BUG*" \
-                          $test_line] \
-                  || [string match "// \$G \$D/\$F.go || echo \"Bug*" \
-                          $test_line] \
-                  || [string match "// \$G \$D/\$F.go || echo \"Issue*" \
-                          $test_line] \
-                  || [string match "// \$G \$F.go || echo BUG*" \
-                          $test_line] \
-                  || [string match "// ! \$G \$D/\$F.go && echo BUG*" \
-                          $test_line] \
-                  || $test_line == "// echo bug395 is broken  # takes 90+ seconds to break" } {
-           # This is a vanilla compile test.
-           set dg-do-what-default "assemble"
-           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
-       } elseif { [string match "// \$G \$D/\$F.go && echo BUG*" \
-                       $test_line] \
-                  || $test_line == "// ! \$G \$D/\$F.go >/dev/null" \
-                  || $test_line == "// ! \$G \$D/\$F.go" \
-                  || $test_line == "// ! \$G \$F.go" \
-                  || [string match "// ! \$G \$D/\$F.go || echo BUG*" \
-                       $test_line] } {
-           # This is a compile test which should fail.
-           set dg-do-what-default "assemble"
-           setup_xfail "*-*-*"
-           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
-       } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out" \
-                       $test_line] \
-                  || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \
-                       $test_line] \
-                  || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && (! ./\$A.out || echo BUG: *" \
-                       $test_line] \
-                  || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&"
-                      && $test_line2 == "//    ((! sh -c ./\$A.out) >/dev/null 2>&1 || echo BUG: should fail)") } {
+       } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \
+                   $test_line] } {
            go-execute-xfail $test
-       } elseif { [string match "// errchk \$G \$F.go" $test_line] \
-                   || [string match "// errchk \$G -e \$F.go" $test_line] \
-                   || [string match "// errchk \$G \$D/\$F.go" $test_line] \
-                   || [string match "//errchk \$G \$D/\$F.go" $test_line] \
-                   || [string match "// errchk \$G -e \$D/\$F.go" \
-                           $test_line] \
-                   || [string match "// ! errchk \$G \$D/\$F.go" $test_line] \
-                   || [string match "// ! errchk \$G -e \$D/\$F.go" \
-                           $test_line] \
-                   || [string match "// errchk \$G \$F.go || true" \
-                           $test_line] \
-                   || [string match "// errchk \$G \$D/\$F.go || true" \
-                           $test_line] \
-                   || [string match "// errchk \$G -e \$D/\$F.go || true" \
-                           $test_line] \
-                   || [string match "// errchk \$G \$D/\$F.go || echo BUG*" \
-                           $test_line] } {
+       } elseif { $test_line == "// errorcheck" } {
            errchk $test ""
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \
-                       $test_line] \
-                      || [string match \
-                              "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \
-                              $test_line] } {
-           if { [string match \
-                     "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \
-                     $test_line] } {
-               set name1 "bug0.go"
-               set name2 "bug1.go"
-           } elseif { [string match \
-                           "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \
-                           $test_line] } {
-               set name1 "one.go"
-               set name2 "two.go"
-           }
+       } elseif { $test_line == "// compiledir" } {
            set hold_runtests $runtests
            set runtests "go-test.exp"
            set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/$name1" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/$name2" file2
-           dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
-           file delete "[file rootname [file tail $file1]].o"
+           set dir "[file rootname $test].dir"
+           set del {}
+           foreach f [lsort [glob "$dir/*.go"]] {
+               dg-test -keep-output $f "-O" "-w $DEFAULT_GOCFLAGS"
+               lappend del "[file rootname [file tail $f]].o"
+           }
+           foreach f $del {
+               file delete $f
+           }
            set runtests $hold_runtests
+       } elseif { "$test_line" == ""
+                  || [string match "// true*" $test_line]
+                  || [string match "// skip*" $test_line] } {
+           # Not a real test, just ignore.
        } elseif { [string match \
                        "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \
                        $test_line] \
-                      || [string match \
-                              "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \
-                              $test_line] \
-                      || [string match \
-                              "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \
-                              $test_line] \
                       || [string match \
                               "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \
                               $test_line] } {
@@ -606,16 +536,6 @@ proc go-gc-tests { } {
                      $test_line] } {
                set name1 "bug0.go"
                set name2 "bug1.go"
-           } elseif { [string match \
-                           "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \
-                           $test_line] } {
-               set name1 "p1.go"
-               set name2 "p2.go"
-           } elseif { [string match \
-                           "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \
-                           $test_line] } {
-               set name1 "b.go"
-               set name2 "a.go"
            } elseif { [string match \
                            "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \
                            $test_line] } {
@@ -642,35 +562,6 @@ proc go-gc-tests { } {
            errchk $test ""
            file delete "[file rootname [file tail $file1]].o"
            set runtests $hold_runtests
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/bug0.go && (! \$G \$D/\$F.dir/bug1.go || echo BUG*" \
-                       $test_line] } {
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/bug0.go" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/bug1.go" file2
-           setup_xfail "*-*-*"
-           dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
-           file delete "[file rootname [file tail $file1]].o"
-           set runtests $hold_runtests
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && (! \$G \$D/\$F.dir/bug2.go || echo BUG*" \
-                       $test_line] } {
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/bug0.go" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/bug1.go" file2
-           dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/bug2.go" file3
-           setup_xfail "*-*-*"
-           dg-test $file3 "-O" "-w $DEFAULT_GOCFLAGS"
-           file delete "[file rootname [file tail $file1]].o"
-           file delete "[file rootname [file tail $file2]].o"
-           set runtests $hold_runtests
        } elseif { [string match \
                        "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && errchk \$G \$D/\$F.dir/bug2.go" \
                        $test_line] } {
@@ -691,7 +582,10 @@ proc go-gc-tests { } {
                        $test_line] \
                       || [string match \
                               "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \
-                              $test_line] } {
+                              $test_line] \
+                      || $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \
+                      || $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \
+                      || $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } {
            if { [string match \
                        "// \$G \$D/bug160.dir/x.go && \$G \$D/bug160.dir/y.go && \$L y.\$A && ./\$A.out" \
                      $test_line] } {
@@ -702,14 +596,29 @@ proc go-gc-tests { } {
                            $test_line] } {
                set name1 "p.go"
                set name2 "main.go"
+           } elseif { $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" } {
+               set name1 "p1.go"
+               set name2 "main.go"
+           } elseif { $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
+               set name1 "lib.go"
+               set name2 ""
+           } elseif { $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } {
+               set name1 "method4a.go"
+               set name2 ""
            }
            set hold_runtests $runtests
            set runtests "go-test.exp"
            set dg-do-what-default "assemble"
            regsub "\\.go$" $test ".dir/$name1" file1
+           if { $name1 == "method4a.go" } {
+               set file1 "[file dirname $test]/method4a.go"
+           }
            dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
            set ofile1 "[file rootname [file tail $file1]].o"
            regsub "\\.go$" $test ".dir/$name2" file2
+           if { $name2 == "" } {
+               set file2 $test
+           }
            dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
            set ofile2 "[file rootname [file tail $file2]].o"
            set dg-do-what-default "link"
@@ -723,6 +632,29 @@ proc go-gc-tests { } {
            $status $name
            file delete $ofile1 $ofile2 $output_file
            set runtests $hold_runtests
+       } elseif { $test_line == "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
+           set hold_runtests $runtests
+           set runtests "go-test.exp"
+           set dg-do-what-default "assemble"
+           regsub "\\.go$" $test ".dir/one.go" file1
+           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
+           set ofile1 "[file rootname [file tail $file1]].o"
+           regsub "\\.go$" $test ".dir/two.go" file2
+           dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
+           set ofile2 "[file rootname [file tail $file2]].o"
+           dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
+           set ofile3 "[file rootname [file tail $test]].o"
+           set dg-do-what-default "link"
+           set output_file "./[file rootname [file tail $test]].exe"
+           set comp_output [go_target_compile "$ofile1 $ofile2 $ofile3" \
+                                $output_file "executable" "$options"]
+           set comp_output [go-dg-prune $target_triplet $comp_output]
+           verbose -log $comp_output
+           set result [go_load "$output_file" "" ""]
+           set status [lindex $result 0]
+           $status $name
+           file delete $ofile1 $ofile2 $ofile3 $output_file
+           set runtests $hold_runtests
        } elseif { [string match \
                        "// \$G \$D/bug191.dir/a.go && \$G \$D/bug191.dir/b.go && \$G \$D/\$F.go && \$L \$F.\$A" \
                        $test_line] } {
@@ -816,38 +748,6 @@ proc go-gc-tests { } {
            }
            file delete $ofile1 $ofile2 $output_file
            set runtests $hold_runtests
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/chanbug.go && \$G -I. \$D/\$F.dir/chanbug2.go" \
-                       $test_line] } {
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/chanbug.go" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/chanbug2.go" file2
-           dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
-           file delete "[file rootname [file tail $file1]].o"
-           set runtests $hold_runtests
-       } elseif { [string match \
-                       "// (! \$G \$D/\$F.go) | grep 'initialization loop' *" \
-                       $test_line] } {
-           set dg-do-what-default "assemble"
-           setup_xfail "*-*-*"
-           go-dg-runtest $test "-w $DEFAULT_GOCFLAGS"
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/x.go && errchk \$G \$D/\$F.dir/y.go" \
-                       $test_line] } {
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/x.go" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           regsub "\\.go$" $test ".dir/y.go" file2
-           errchk $file2 ""
-           file delete "[file rootname [file tail $file1]].o"
-           set runtests $hold_runtests
-       } elseif { "$test_line" == "" || [string match "// true*" $test_line] } {
-           # Not a real test, just ignore.
        } elseif { $test_line == "// \$G \$D/\$F.dir/bug0.go &&" \
                       && $test_line2 == "// \$G \$D/\$F.dir/bug1.go &&" \
                       && $test_line3 == "// \$G \$D/\$F.dir/bug2.go &&" \
@@ -921,7 +821,7 @@ proc go-gc-tests { } {
            }
            file delete $ofile1 $ofile2 $output_file
            set runtests $hold_runtests
-       } elseif { $test_line == "// \$G \$D/\$F.go \$D/cmplxdivide1.go && \$L \$D/\$F.\$A && ./\$A.out" } {
+       } elseif { $test_line == "// run cmplxdivide1.go" } {
            regsub "/\[^/\]*$" $test "/cmplxdivide1.go" test2
            set output_file "./[file rootname [file tail $test]].o"
            set comp_output [go_target_compile "$test $test2" \
@@ -954,10 +854,8 @@ proc go-gc-tests { } {
                    file delete tmp.x
                    # Disable optimizations as this test takes a long time
                    # to compile.
-                   set hold $TORTURE_OPTIONS
-                   set TORTURE_OPTIONS [ list { -O0 -g }]
+                   set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }]
                    go-torture-execute "./tmp.go"
-                   set TORTURE_OPTIONS $hold
                }
                if { [catch "exec $output_file -pass 1 >tmp.go"] != 0 } {
                    fail "$name execution 1"
@@ -994,59 +892,6 @@ proc go-gc-tests { } {
            }
            file delete $output_file
            set runtests $hold_runtests
-       } elseif { [string match \
-                       "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ! ./\$A.out || echo BUG*" \
-                       $test_line] } {
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "assemble"
-           regsub "\\.go$" $test ".dir/p.go" file1
-           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
-           set ofile1 "[file rootname [file tail $file1]].o"
-           regsub "\\.go$" $test ".dir/main.go" file2
-           dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
-           set ofile2 "[file rootname [file tail $file2]].o"
-           set output_file "./[file rootname [file tail $test]].exe"
-           set comp_output [go_target_compile "$ofile1 $ofile2" \
-                                $output_file "executable" "$options"]
-           set comp_output [go-dg-prune $target_triplet $comp_output]
-           if [string match "" $comp_output] {
-               setup_xfail "*-*-*"
-               set result [go_load "$output_file" "" ""]
-               set status [lindex $result 0]
-               $status $name
-           } else {
-               verbose -log $comp_output
-               fail $name
-           }
-           file delete $ofile1 $ofile2 $output_file
-           set runtests $hold_runtests
-       } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&"
-                  && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out || echo BUG: select5" } {
-           set go_execute_args ""
-           set hold_runtests $runtests
-           set runtests "go-test.exp"
-           set dg-do-what-default "link"
-           dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
-           set output_file "./[file rootname [file tail $test]].exe"
-           set base "[file rootname [file tail $test]]"
-           if [isnative] {
-               if { [catch "exec $output_file > $base-out.go"] != 0 } {
-                   fail "$name execution"
-               } else {
-                   pass "$name execution"
-                   file delete $base-out.x
-                   # Disable optimizations as this test takes a long time
-                   # to compile.
-                   set hold $TORTURE_OPTIONS
-                   set TORTURE_OPTIONS [ list { -O0 -g }]
-                   go-torture-execute "./$base-out.go"
-                   set TORTURE_OPTIONS $hold
-               }
-               file delete $base-out.go
-           }
-           file delete $output_file
-           set runtests $hold_runtests
        } elseif { $test_line == "// errchk \$G -e \$D/\$F.dir/\[ab\].go" } {
            regsub "\\.go$" $test ".dir/a.go" file1
            regsub "\\.go$" $test ".dir/b.go" file2
@@ -1057,7 +902,7 @@ proc go-gc-tests { } {
            go-torture-execute $test
        } elseif { $test_line == "// \$G -N -o slow.\$A \$D/bug369.dir/pkg.go &&" \
                       && $test_line2 == "// \$G -o fast.\$A \$D/bug369.dir/pkg.go &&" \
-                      && $test_line3 == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
+                      && $test_line3 == "// run" } {
            set hold_runtests $runtests
            set runtests "go-test.exp"
            set dg-do-what-default "assemble"
@@ -1094,30 +939,19 @@ proc go-gc-tests { } {
            dg-test $test "-O" "-w $DEFAULT_GOCFLAGS"
            file delete "[file rootname [file tail $file1]].o"
            set runtests $hold_runtests
-       } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&"
-                  && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out" } {
-           set go_execute_args ""
+       } elseif { [string match "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go || echo BUG*" \
+                       $test_line ] } {
            set hold_runtests $runtests
            set runtests "go-test.exp"
-           set dg-do-what-default "link"
-           dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
-           set output_file "./[file rootname [file tail $test]].exe"
-           set base "[file rootname [file tail $test]]"
-           if [isnative] {
-               if { [catch "exec $output_file >$base-out.go"] != 0 } {
-                   fail "$name execution"
-               } else {
-                   pass "$name execution"
-                   file delete $base-out.x
-                   go-torture-execute "./$base-out.go"
-               }
-               file delete $base-out.go
-           }
-           file delete $output_file
+           set dg-do-what-default "assemble"
+           regsub "\\.go$" $test ".dir/one.go" file1
+           dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
+           set ofile1 "[file rootname [file tail $file1]].o"
+           regsub "\\.go$" $test ".dir/two.go" file2
+           dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
+           file delete $ofile1
            set runtests $hold_runtests
-       } elseif { $test_line == "// # generated by cmplxdivide.c" } {
-           # Ignore.
-       } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && gopack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \
+       } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && pack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \
                   || $test_line == "// \$G \$D/empty.go && errchk \$G \$D/\$F.go" } {
            # These tests import the same package under two different
            # names, which gccgo does not support.
@@ -1127,14 +961,22 @@ proc go-gc-tests { } {
            # as an initializer will be generated for any code which
            # has global variables which need to be registered as GC
            # roots.
-       } elseif { $test_line == "// errchk -0 \$G -m -l \$D/\$F.go" } {
+       } elseif { $test_line == "// errorcheck -0 -m"
+                  || $test_line == "// errorcheck -0 -m -l" } { 
            # This tests debug output of the gc compiler, which is
            # meaningless for gccgo.
-       } elseif { $test_line == "// \[ \$O == 6 \] || errchk \$G -e \$D/\$F.go" \
-                      || $test_line == "// \[ \$O != 6 \]  || errchk \$G -e \$D/\$F.go" } {
+       } elseif { $test_line == "// \[ \$A == 6 \] || errchk \$G -e \$D/\$F.go" \
+                      || $test_line == "// \[ \$A != 6 \]  || errchk \$G -e \$D/\$F.go" } {
            # This tests specific handling of the gc compiler on types
            # that are too large.  It is target specific in a way I
            # haven't bothered to check for here.
+       } elseif { $test_line == "// \$G \$D/\$F.go && \$L -X main.tbd hello \$F.\$A && ./\$A.out" } {
+           # This tests the gc ld -X option, which gccgo does not
+           # support.
+       } elseif { $test_line == "// \$G \$D/pkg.go && pack grc pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && errchk \$G -I. -u \$D/main.go"
+                  || $test_line == "// \$G \$D/pkg.go && pack grcS pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && \$G -I. -u \$D/main.go" } {
+           # This tests the gc -u option, which gccgo does not
+           # support.
        } else {
            clone_output "$name: unrecognized test line: $test_line"
            unsupported $name
@@ -1142,6 +984,7 @@ proc go-gc-tests { } {
 
        set go_compile_args ""
        set go_execute_args ""
+        set TORTURE_OPTIONS [list { -O2 -g }]
     }
 
     set dg-do-what-default ${saved-dg-do-what-default}
index 03143a60d83fef499ccc34dd798cc7aecdb9e870..6745dde41ab7d8560f32e1ee526c1d6efd63f611 100644 (file)
@@ -1,9 +1,12 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Solve the 2,3,5 problem (print all numbers with 2, 3, or 5 as factor) using channels.
+// Test the solution, silently.
+
 package main
 
 type T chan uint64
index 9e91a97fd5781b1fced3388844f50c1e0e7c16c1..7ad28ad4bc0e13bda3f0082aec42928352b6f38b 100644 (file)
@@ -1,6 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go &&
-// $G tmp.go && $L tmp.$A && ./$A.out || echo BUG: 64bit
-// rm -f tmp.go
+// runoutput
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 639a9cabbb4fa5d61ac3b42b23af7bbf13e5acea..ec93a2d101ff0ed42efc8248fa4917ff5c0dd30a 100644 (file)
@@ -1,13 +1,14 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
-
 // Test that error messages say what the source file says
 // (uint8 vs byte, int32 vs. rune).
+// Does not compile.
+
+package main
 
 import (
        "fmt"
index e8ef8a23f961b4488124e26dc594e196360ca66b..4219af8cd58ac7ecd7f532bbf165660022f693e8 100644 (file)
@@ -1,14 +1,14 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
-
 // Test that dynamic interface checks treat byte=uint8
 // and rune=int or rune=int32.
 
+package main
+
 func main() {
        var x interface{}
 
index e178f46990d62b613133b17b0f7b56571c9a1228..3f6251ee507668f6ce9828149417e628066472e3 100644 (file)
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Semi-exhaustive test for append()
+// Semi-exhaustive test for the append predeclared function.
 
 package main
 
@@ -27,6 +27,7 @@ func main() {
        }
        verifyStruct()
        verifyInterface()
+       verifyType()
 }
 
 
@@ -230,3 +231,17 @@ func verifyInterface() {
        verify("interface l", append(s), s)
        verify("interface m", append(s, e...), r)
 }
+
+type T1 []int
+type T2 []int
+
+func verifyType() {
+       // The second argument to append has type []E where E is the
+       // element type of the first argument.  Test that the compiler
+       // accepts two slice types that meet that requirement but are
+       // not assignment compatible.  The return type of append is
+       // the type of the first argument.
+       t1 := T1{1}
+       t2 := T2{2}
+       verify("T1", append(t1, t2...), T1{1, 2})
+}
index ba9a377a6f8e228bffb47fa7a7b25cbe81bf16f0..9cfddc338b0c4bd84b4014bd09ffa2bc1b3b91a3 100644 (file)
@@ -1,9 +1,14 @@
 // $G $F.go && $L $F.$A && ./$A.out arg1 arg2
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test os.Args.
+
 package main
 
 import "os"
index 2192f9ede0884fce55a3426702aa911b2d7aa285..da0192f838d84c79199450be392c67eb50dac578 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify simple assignment errors are caught by the compiler.
+// Does not compile.
+
 package main
 
 import "sync"
index 71e5b406439f02539b51d61f5ca59020d8ab3949..b9e0325ce8c9757a7f0aabdc16b864f32fadd1d2 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify assignment rules are enforced by the compiler.
+// Does not compile.
+
 package main
 
 type (
index 8002a2017bc568c754bcdca648e4a03865702479..98838453aa6f49a28d27428ba9285d21490c8138 100644 (file)
@@ -2,27 +2,22 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../src/Make.inc
-
 ALL=\
        parser\
        peano\
        tree\
        tree2\
 
-all: $(addsuffix .out, $(ALL))
-
-%.$O: %.go stats.go
-       $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go
+all: $(ALL)
 
-%.out: %.$O
-       $(LD) -o $@ $*.$O
+%: %.go
+       go build $*.go stats.go
 
-%.bench: %.out
-       time ./$*.out
+%.bench: %
+       time ./$*
 
 bench: $(addsuffix .bench, $(ALL))
 
 clean:
-       rm -f *.[$(OS)] $(addsuffix .out, $(ALL))
+       rm -f $(ALL)
 
index 9e15f6c0f4d41ee1dc0ee0f3aa3ea1ccb27767de..b91e0248f534058b77912be87ed857e263917824 100644 (file)
@@ -73,7 +73,7 @@ func parseDir(dirpath string) map[string]*ast.Package {
 }
 
 func main() {
-       st := &runtime.MemStats
+       st := new(runtime.MemStats)
        packages = append(packages, packages...)
        packages = append(packages, packages...)
        n := flag.Int("n", 4, "iterations")
@@ -83,14 +83,17 @@ func main() {
 
        var lastParsed []map[string]*ast.Package
        var t0 time.Time
+       var numGC uint32
+       var pauseTotalNs uint64
        pkgroot := runtime.GOROOT() + "/src/pkg/"
        for pass := 0; pass < 2; pass++ {
                // Once the heap is grown to full size, reset counters.
                // This hides the start-up pauses, which are much smaller
                // than the normal pauses and would otherwise make
                // the average look much better than it actually is.
-               st.NumGC = 0
-               st.PauseTotalNs = 0
+               runtime.ReadMemStats(st)
+               numGC = st.NumGC
+               pauseTotalNs = st.PauseTotalNs
                t0 = time.Now()
 
                for i := 0; i < *n; i++ {
@@ -107,6 +110,9 @@ func main() {
        }
        t1 := time.Now()
 
+       runtime.ReadMemStats(st)
+       st.NumGC -= numGC
+       st.PauseTotalNs -= pauseTotalNs
        fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
                st.Alloc, st.TotalAlloc,
                st.Sys,
@@ -142,9 +148,7 @@ var packages = []string{
        "container/list",
        "container/ring",
        "crypto/aes",
-       "crypto/blowfish",
        "crypto/hmac",
-       "crypto/md4",
        "crypto/md5",
        "crypto/rand",
        "crypto/rc4",
@@ -155,7 +159,6 @@ var packages = []string{
        "crypto/subtle",
        "crypto/tls",
        "crypto/x509",
-       "crypto/xtea",
        "debug/dwarf",
        "debug/macho",
        "debug/elf",
@@ -164,7 +167,6 @@ var packages = []string{
        "encoding/ascii85",
        "encoding/base64",
        "encoding/binary",
-       "encoding/git85",
        "encoding/hex",
        "encoding/pem",
        "os/exec",
@@ -193,8 +195,6 @@ var packages = []string{
        "mime",
        "net",
        "os",
-       "os/signal",
-       "patch",
        "path",
        "math/rand",
        "reflect",
@@ -214,11 +214,9 @@ var packages = []string{
        "testing",
        "testing/iotest",
        "testing/quick",
-       "testing/script",
        "time",
        "unicode",
        "unicode/utf8",
        "unicode/utf16",
-       "websocket",
        "encoding/xml",
 }
index f1ad6ed699c6fbbbc5b4e0fd2dea2331cd5be4e7..6c7e523145a14f47034f72fe202afbe039998d18 100644 (file)
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 985e7eaf5dc3fc23894d6da378189f528da4db93..6dc0aeb2331140d96701cdcefeba6886c89f7a84 100644 (file)
@@ -12,17 +12,23 @@ import (
 )
 
 func gcstats(name string, n int, t time.Duration) {
-       st := &runtime.MemStats
-       fmt.Printf("garbage.%sMem Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs)
-       fmt.Printf("garbage.%s %d %d ns/op\n", name, n, t.Nanoseconds()/int64(n))
-       fmt.Printf("garbage.%sLastPause 1 %d ns/op\n", name, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))])
-       fmt.Printf("garbage.%sPause %d %d ns/op\n", name, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC))
+       st := new(runtime.MemStats)
+       runtime.ReadMemStats(st)
+       nprocs := runtime.GOMAXPROCS(-1)
+       cpus := ""
+       if nprocs != 1 {
+               cpus = fmt.Sprintf("-%d", nprocs)
+       }
+       fmt.Printf("garbage.%sMem%s Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, cpus, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs)
+       fmt.Printf("garbage.%s%s %d %d ns/op\n", name, cpus, n, t.Nanoseconds()/int64(n))
+       fmt.Printf("garbage.%sLastPause%s 1 %d ns/op\n", name, cpus, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))])
+       fmt.Printf("garbage.%sPause%s %d %d ns/op\n", name, cpus, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC))
        nn := int(st.NumGC)
        if nn >= len(st.PauseNs) {
                nn = len(st.PauseNs)
        }
        t1, t2, t3, t4, t5 := tukey5(st.PauseNs[0:nn])
-       fmt.Printf("garbage.%sPause5: %d %d %d %d %d\n", name, t1, t2, t3, t4, t5)
+       fmt.Printf("garbage.%sPause5%s: %d %d %d %d %d\n", name, cpus, t1, t2, t3, t4, t5)
 
        //      fmt.Printf("garbage.%sScan: %v\n", name, st.ScanDist)
 }
index 6d78f72c5b850becf59467755f3fdfb1e83507fe..a171c696bbc5d7484a449416d29acfeba028a884 100644 (file)
@@ -11,6 +11,7 @@ import (
        "os"
        "runtime"
        "runtime/pprof"
+       "time"
        "unsafe"
 )
 
@@ -30,6 +31,7 @@ var (
        heap        *Object
        calls       [20]int
        numobjects  int64
+       memstats    runtime.MemStats
 )
 
 func buildHeap() {
@@ -55,10 +57,10 @@ func buildTree(objsize, size float64, depth int) (*Object, float64) {
 
 func gc() {
        runtime.GC()
-       runtime.UpdateMemStats()
-       pause := runtime.MemStats.PauseTotalNs
-       inuse := runtime.MemStats.Alloc
-       free := runtime.MemStats.TotalAlloc - inuse
+       runtime.ReadMemStats(&memstats)
+       pause := memstats.PauseTotalNs
+       inuse := memstats.Alloc
+       free := memstats.TotalAlloc - inuse
        fmt.Printf("gc pause: %8.3f ms; collect: %8.0f MB; heapsize: %8.0f MB\n",
                float64(pause-lastPauseNs)/1e6,
                float64(free-lastFree)/1048576,
@@ -71,9 +73,9 @@ func main() {
        flag.Parse()
        buildHeap()
        runtime.GOMAXPROCS(*cpus)
-       runtime.UpdateMemStats()
-       lastPauseNs = runtime.MemStats.PauseTotalNs
-       lastFree = runtime.MemStats.TotalAlloc - runtime.MemStats.Alloc
+       runtime.ReadMemStats(&memstats)
+       lastPauseNs = memstats.PauseTotalNs
+       lastFree = memstats.TotalAlloc - memstats.Alloc
        if *cpuprofile != "" {
                f, err := os.Create(*cpuprofile)
                if err != nil {
@@ -82,7 +84,12 @@ func main() {
                pprof.StartCPUProfile(f)
                defer pprof.StopCPUProfile()
        }
-       for i := 0; i < 10; i++ {
+       const N = 10
+       var t0 time.Time
+       for i := 0; i < N; i++ {
+               t0 = time.Now()
                gc()
        }
+       // Standard gotest benchmark output, collected by build dashboard.
+       gcstats("BenchmarkTree2", N, time.Now().Sub(t0))
 }
diff --git a/gcc/testsuite/go.test/test/bench/go1/Makefile b/gcc/testsuite/go.test/test/bench/go1/Makefile
deleted file mode 100644 (file)
index 9484743..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-include $(GOROOT)/src/Make.inc
-
-TARG=go1
-GOFILES=\
-       dummy.go\
-
-include $(GOROOT)/src/Make.pkg
diff --git a/gcc/testsuite/go.test/test/bench/go1/_testmain.go b/gcc/testsuite/go.test/test/bench/go1/_testmain.go
deleted file mode 100644 (file)
index bedc373..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package main
-
-import target "go1"
-import "testing"
-import "regexp"
-
-var tests = []testing.InternalTest{
-}
-
-var benchmarks = []testing.InternalBenchmark{
-       {"go1.BenchmarkBinaryTree17", target.BenchmarkBinaryTree17},
-       {"go1.BenchmarkFannkuch11", target.BenchmarkFannkuch11},
-       {"go1.BenchmarkGobDecode", target.BenchmarkGobDecode},
-       {"go1.BenchmarkGobEncode", target.BenchmarkGobEncode},
-       {"go1.BenchmarkGzip", target.BenchmarkGzip},
-       {"go1.BenchmarkGunzip", target.BenchmarkGunzip},
-       {"go1.BenchmarkJSONEncode", target.BenchmarkJSONEncode},
-       {"go1.BenchmarkJSONDecode", target.BenchmarkJSONDecode},
-       {"go1.BenchmarkRevcomp25M", target.BenchmarkRevcomp25M},
-       {"go1.BenchmarkTemplate", target.BenchmarkTemplate},
-}
-var examples = []testing.InternalExample{}
-
-var matchPat string
-var matchRe *regexp.Regexp
-
-func matchString(pat, str string) (result bool, err error) {
-       if matchRe == nil || matchPat != pat {
-               matchPat = pat
-               matchRe, err = regexp.Compile(matchPat)
-               if err != nil {
-                       return
-               }
-       }
-       return matchRe.MatchString(str), nil
-}
-
-func main() {
-       testing.Main(matchString, tests, benchmarks, examples)
-}
diff --git a/gcc/testsuite/go.test/test/bench/go1/dummy.go b/gcc/testsuite/go.test/test/bench/go1/dummy.go
deleted file mode 100644 (file)
index 4956bc7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-package go1
-
-// Nothing to see here: everything is in the _test files.
index dcb2d1055d9763253aeae8e3d01504b12959b66c..bff056fa90c9602a45024d4a82ae9dec3110325e 100644 (file)
@@ -4,9 +4,24 @@
 
 package go1
 
+import "runtime"
+
 // Not a benchmark; input for revcomp.
 
-var fasta25m = fasta(25e6)
+var fastabytes = makefasta()
+
+func makefasta() []byte {
+       var n int = 25e6
+       if runtime.GOARCH == "arm" {
+               // TODO(dfc) remove this limitation after precise gc.
+               // A value of 25e6 consumes 465mb of heap on 32bit 
+               // platforms, which is too much for most ARM systems. 
+               // A value of 25e5 produces a memory layout that 
+               // confuses the gc on 32bit platforms. So 25e4 it is.
+               n = 25e4
+       }
+       return fasta(n)
+}
 
 func fasta(n int) []byte {
        out := make(fastaBuffer, 0, 11*n)
index 00eeed57a569197eb0ffa38ca8d06547d2bfc5ff..b172b805ad284efa25b96e643742798420e1193a 100644 (file)
@@ -21,9 +21,7 @@ var (
        gobdata  *JSONResponse
 )
 
-func gobinit() {
-       // gobinit is called after json's init,
-       // because it uses jsondata.
+func init() {
        gobdata = gobResponse(&jsondata)
 
        var buf bytes.Buffer
index c9eeb175f535dd9b885b870ea872c11eb33e8fc3..fe4c480eb8470f9875dc5121dbcc454fdf426d06 100644 (file)
@@ -21,20 +21,14 @@ var (
 
 func init() {
        var buf bytes.Buffer
-       c, err := gz.NewWriter(&buf)
-       if err != nil {
-               panic(err)
-       }
+       c := gz.NewWriter(&buf)
        c.Write(jsongunz)
        c.Close()
        jsongz = buf.Bytes()
 }
 
 func gzip() {
-       c, err := gz.NewWriter(ioutil.Discard)
-       if err != nil {
-               panic(err)
-       }
+       c := gz.NewWriter(ioutil.Discard)
        if _, err := c.Write(jsongunz); err != nil {
                panic(err)
        }
index 5a3012167b1f9c827b091f09bfba9099929fe8e1..614e24a810cff229797ad7d45cde290d0b182008 100644 (file)
@@ -17,11 +17,11 @@ import (
 )
 
 var (
-       jsonbytes []byte
-       jsondata  JSONResponse
+       jsonbytes = makeJsonBytes()
+       jsondata  = makeJsonData()
 )
 
-func init() {
+func makeJsonBytes() []byte {
        var r io.Reader
        r = strings.NewReader(jsonbz2_base64)
        r = base64.NewDecoder(base64.StdEncoding, r)
@@ -30,12 +30,15 @@ func init() {
        if err != nil {
                panic(err)
        }
-       jsonbytes = b
+       return b
+}
 
-       if err := json.Unmarshal(jsonbytes, &jsondata); err != nil {
+func makeJsonData() JSONResponse {
+       var v JSONResponse
+       if err := json.Unmarshal(jsonbytes, &v); err != nil {
                panic(err)
        }
-       gobinit()
+       return v
 }
 
 type JSONResponse struct {
diff --git a/gcc/testsuite/go.test/test/bench/go1/mandel_test.go b/gcc/testsuite/go.test/test/bench/go1/mandel_test.go
new file mode 100644 (file)
index 0000000..888c5e4
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This benchmark, taken from the shootuot, tests floating point performance.
+
+package go1
+
+import "testing"
+
+func mandelbrot(n int) int {
+       const Iter = 50
+       const Zero float64 = 0
+       const Limit = 2.0
+       ok := 0
+       for y := 0; y < n; y++ {
+               for x := 0; x < n; x++ {
+                       Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero
+                       Cr := (2*float64(x)/float64(n) - 1.5)
+                       Ci := (2*float64(y)/float64(n) - 1.0)
+
+                       for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ {
+                               Zi = 2*Zr*Zi + Ci
+                               Zr = Tr - Ti + Cr
+                               Tr = Zr * Zr
+                               Ti = Zi * Zi
+                       }
+
+                       if Tr+Ti <= Limit*Limit {
+                               ok++
+                       }
+               }
+       }
+       return ok
+}
+
+func BenchmarkMandelbrot200(b *testing.B) {
+       for i := 0; i < b.N; i++ {
+               mandelbrot(200)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/bench/go1/parser_test.go b/gcc/testsuite/go.test/test/bench/go1/parser_test.go
new file mode 100644 (file)
index 0000000..26580b8
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package go1
+
+// go parser benchmark based on go/parser/performance_test.go
+
+import (
+       "compress/bzip2"
+       "encoding/base64"
+       "go/parser"
+       "go/token"
+       "io"
+       "io/ioutil"
+       "strings"
+       "testing"
+)
+
+var (
+       parserbytes = makeParserBytes()
+)
+
+func makeParserBytes() []byte {
+       var r io.Reader
+       r = strings.NewReader(parserbz2_base64)
+       r = base64.NewDecoder(base64.StdEncoding, r)
+       r = bzip2.NewReader(r)
+       b, err := ioutil.ReadAll(r)
+       if err != nil {
+               panic(err)
+       }
+       return b
+}
+
+func BenchmarkParse(b *testing.B) {
+       b.SetBytes(int64(len(parserbytes)))
+       for i := 0; i < b.N; i++ {
+               if _, err := parser.ParseFile(token.NewFileSet(), "", parserbytes, parser.ParseComments); err != nil {
+                       b.Fatalf("benchmark failed due to parse error: %s", err)
+               }
+       }
+}
diff --git a/gcc/testsuite/go.test/test/bench/go1/parserdata_test.go b/gcc/testsuite/go.test/test/bench/go1/parserdata_test.go
new file mode 100644 (file)
index 0000000..113e5e3
--- /dev/null
@@ -0,0 +1,245 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Input for parser benchmark.
+// This was generated by starting with a the contents of
+// src/pkg/go/parser/parser.go at rev 9b455eb64690, then 
+// compressing with bzip2 -9, then encoding to base64.
+// We compile the data into the binary so that the benchmark is
+// a stand-alone binary that can be copied easily from machine to
+// machine. parser_test.go decodes this during init.
+
+package go1
+
+var parserbz2_base64 = "QlpoOTFBWSZTWd3QmOEAIYdfgHwwf//6P7/v/+/////+YEhcAAAB7hwvVWWaZT1X0dt999296z5B" +
+       "3mcQqlBVVVB7hnASWJoFGq9jlHvZHRbdfIB0Hz6fW+jrz4dueD73be6c33tG7la1O9d154ntzzk7" +
+       "jnU+O50zayubCulvgBm7rou5jleOe730dzX2sUbWj1u215X2PBXY17GB3Y3NznVW7ubOuu5a5wHc" +
+       "d9h69Xtatru8+D21uj7bM3lBKdRzPul3bt3GUtvN7z1PfCU0QIAmppkxQYg0Ap5NQZTxR6myJp6m" +
+       "T1D1NMgYSmgQggmiajIZKep5R6mh6jyh6RoA0BoGmg9RoCTSREEEAnqnpqbKp+alNk0ajR+qeiNB" +
+       "k9TanpMhtQDQBJ6pSkSTyPVPU/VP1PShkepoaGTTDSBoaAAyANDQMIkRE0lPTaZBTyYlRp/ok1Pa" +
+       "Rkm09Gk1PaptQAaDR6gPUESRAmQQ0Cnqm9NNBNMlPyj0iPQyQaBp6gAaaB8HrtSFgsiaNsTLSbZS" +
+       "paVaq+DW1qDTQ1FEYixSRiwlmJFRJrBmbIYoNEYoylREClbZLFikJKNRBFApgUQ1GShKjaSyRCCG" +
+       "UixqTabS2lLZiEgaKDZLMoxFY1o2LULILGDEJsWwMhbMzWlpbZm0bCaSS0NlmDGZIiRWIoxorEiG" +
+       "IxTJIyIGU22xsKzSqlMUUmjYE0bTGWaalWxLIlMQqECLEliKYskmLSSjKTKRYGRZmUZpARUKYttm" +
+       "ajIMrKGY0UUglEiWbM0tJsbGyzIk2myi0ZVYlsNRhGlFhJVKmwxloaVklNFBtDIZTQkyhowI0Qxp" +
+       "JTJsyVRUijUs1e9rpIS0kNLGYkko0WswwxrCAwJFBiLERYpFI14/l8d//VUo/f2Ofl/4/PMmROiP" +
+       "+X86qHV/m2eKhwgQcW/w+YWCErVRZu5/WnEVaZnt7Tfo5OP8TQ/6bme17VqPoaBMhDbuEqkuzjiW" +
+       "z4vygpH+2bkcU5nBikvEzgwxXZ804V1e1KpfovBAJKnhrcaHdoN4aEJHqHLUlmyGcSUjUdCvTYRP" +
+       "65aIz4POFpBLH+m+1Lbs7kPa+GjGbi6lF6kRnzeuKKJqJcsR2+EnuemMS9kr4tXWry3r+bgQMkhI" +
+       "ZkgILVvncoXREIltDqJkTlIBmQtrNEYdUFfdE6C6Uevosypd0519H9t17FtHW8FHImhH595l8V5y" +
+       "Dy7pYjFXqJ5ud+fYaJuGUNoK/3zpKZs3XTCeRxe50nakx0WoD9OZ5fgiko2ifKT2JRWE470vIn9q" +
+       "YqZeDApYKszMZ8Mp+S+W5s96YNXPi2dlO/D+1qHRSrLkH4VE7L5oPiWGXTwos+dnwniXQoVKJu+K" +
+       "Y9bmXzt/02qIskOq0b5TG05twenXqbgV7hVAkTElgmqsqORvcte/dakNMsd39HphWvVaeJ3rcihv" +
+       "cJ044ShoPW1kUxBbyYXSVcHhwcPSlRcSVjjMnnOumoi8tmS0XNbV8t7YwYi/pxq8j4IDzF6Gjjac" +
+       "8IstxcUEu4RJ7FipOLfio4rt9s7lfyvvwluT97uTcrpUBmf+k4nmsClh3fSIXpUhCQj0vMkt3PMf" +
+       "iudzHKBAPMXLy7ghISaEuIIZU7ueq2srC6YYkS+GIpVA78WOscuCQLNvB3uP5O/z7mxPA5zkIjIv" +
+       "KdUOFSCIx8N/Dub3Ur4WwQSti9vd16B9/Bzk1g28aiXYmRHTrN0J4cW8xmekkkaIMQXypKnBPZeW" +
+       "OTnpXqdzrz3NXv88RyB3SuMMy9e+YJ0LfvtfRletL4X4fU0YyG2EurWAFBlGvZ9Lzc161b0vZR3B" +
+       "lL54b52XxrzvXeyu0qCh3+Nv1LgzQhtksL1Oay/Q6uVSRCofJ3ZjFUiG7BtUBQ3ZQrIHZJxdYAou" +
+       "EFtGQkRJCQq1JlE0w7e/NTTmJ5ifsE62XbIaTAca2fb4+p0d8L19KX8vFwTin/n8OvB6c+3w6PlS" +
+       "2goNsUIjAKysBZEGKrGSj9cuNPj5nrOYVHPsxLdGaeVHWXgKPR3anI5fKwnR8SM4fFetyzwPhxw0" +
+       "0lGM5Y02qqy7YY3+xFTHU9QtR7daZLEhpvsY3iDlipq2XAQehwfn9cm34kA9P19rUJ+RB7funX6O" +
+       "rB5/xJ4dxpknnVZFXSwLq0tDC4Oze4TN2dOHZ+HL8OJ6n/L8WuPeXeMpMQqItn4ZQfO+L6Ptnu6u" +
+       "udDLKkBnS6yOVFVGKAsixPT+D24mcn109jn27PhPK6x803RI7pvAz3Q/nYYY74mSvWccNSVVSvyz" +
+       "c5IPV1UejZKjmnB3wuXPfG8LTTGrMkIz6mh9EbgSSBOQqmfzXu/57PRZlKcl6buNSiCdgf939gq+" +
+       "zhn356ZdFGoGUfVHCdBp4HXcfZpWfVbdNxh1rxI/RvAK/e4fAR+AkS75mGZTvK5T2ob4g+HlN+LU" +
+       "ednbpvXKTzu+BgxnhWG7i9otZECZps3pIIspDTLQ0P+o0Ryw/UOpt+F7zIKwg3cxA7UQX8rxDUxI" +
+       "Ub/+uw6Qh0xwieVzEaeQKh8s5uI1o+buyWpo8kZVwjBN8JdsHV4lj5tdUIiOuIqskenyFpkcNGgK" +
+       "cV1ohgEbXdcF1bm2LHZwKinccZZqRh4EXGbbqNuTSUTM06DGbwI3IfZcrrVlRlyGvUPnKeM2tG+p" +
+       "U5Nk1fWcKXovwi7Bpm85156nFylux70tJGHWaxNqGt02UGzMM04bJc6GHl57m9PfjBeQ+vlgtDBA" +
+       "KJkoKJEjXjnqvAmY6RkaCUoeo1mVlVA+uUmbbBqU8dYZIxiwRH3Pxc3bOD9uB5Jlka6An6c9B9km" +
+       "OnDL+FHQTYNwgH8mavZz0iOu+Ut8/J5ZwyoIamzhyxBs8262E1X8Xfhle9iE4rVPPFLG0iTioWAU" +
+       "d3xVBGn0oRJqbxtUaxhpdln5NtolGMj59U8pg0/RSY4z7US2Ms+4/ppi54Z8T9x34FrNnEaNTupy" +
+       "0wwbD4jnv7F8vm1WllYykpcbxM8YVxcrK1o0GGUBvVUGqDpjwLUr17oxmaKusyyrqV4yu76rlNga" +
+       "TtCAVGwYMvm+SLMenn6P375gmvYRlpqskpNDxFJcfbkZ8bux2QkkYKLPJlJSlbCOPNDfSULNSdHM" +
+       "12MvGjz5tYTNEbhq9fk6J0QCf04np5cuTvdC7SzdPmMDWTDxiD5exXpVi41UM6eV+926tnWjqo1q" +
+       "KZvLp3rjuvrmxbB648TaJlIjEgjUx2qKW6HRaInEGHsXUxFRTPPAsGXwgtoi1905O44+FkV9ctb8" +
+       "7pZtlllncqNGbJqP2LVNqa9WBOlqMdkm1w8mO+Ln3BLUvtWWl/CjfABpSq7mjGtMdPHs3a9OeOVw" +
+       "FHvW2fQeG243Jl69jvgx4jbSeVZ39VcNZNO5EiPRfOTlBHsZXX27TyO0b+abrFZ3Bwdx+c+uRVo/" +
+       "TEFzLJ4uXS1FoXdJblwzfjW0rcGlZ5Jqs3Gb4iESyfmdVpU6i2DtBPBtsn+nlb95Y0pWMDBM3ZBZ" +
+       "pyIEncddO3bafpssEObXLaLNvraGuJMzgiNF3+t2uZC633wwUji1sLoiU6X4kuZkEjKHnqmi1zXF" +
+       "+dM6MTtO9N5yDve47yIt/CkoVoTbWfc9E1Gs8e19PLxPS0i18ldi6xjw2bsWfjR9Dp21w5ImY6xr" +
+       "3J+BF35JgmZMT8PbEXlDThrTfEMkkrCcD1u+XbyIkkjGCc6Vc2Vr5X53XPuwfOuM31yem0tXg9uZ" +
+       "1kj2P4Hx03wa13qdX0xDFNlPCYxkY+xVhq2lCzma5tkZ/FD3755LyZbdshsWTGsbInzJ39+zd/Ly" +
+       "PMkJ079dteGN01Roys7oKtfDIa/N26YWY4Poq35WHTCM1DF7S5me2r5ahhiLl0ch545YQ+r57a4+" +
+       "Ls9VjY5Pswwk2x9S45uMQ770ssfjbRB1U2hF/DV8nak751LqONvJs28E0JmDcmEwIr4sB1uClx2b" +
+       "PpWuRnAWq7oEmSBKbowbbW2lGqi1nh35psMxUZ4d+FxK4uHVZNA7vU5qm0rUs1IoT9jPLkrzJ83e" +
+       "t1ZM+BwItwHrFPb5jtL228eV0ZUpLZphfFKj2DCkzbKiv1ODiobghZh44PzyoxgKV5SnP3VUGTRN" +
+       "h9Nr5MyMQvBNTHpiwN1N4241qJaQRhUVtKiMhjJjCNoYkMErArCTYOiM3SF88PVh9B9XSdDzTkqF" +
+       "hbUSnyoH1EwYMUaOhcqJmWVqsWHxhPCckWK3GaoqMmowMyzTBWal1P5eL2sVtZ+drjsx40brxVOg" +
+       "xhzdgFm5kg3UcZubj4zvW6QQgvvcd3x612pOT21AWT5bhwppdXYsSL7GRd0DB39io1hcZp98dpdP" +
+       "I7tjczPaDZBPL3EuO1nUrIw7csHF06ZNzmmUd+3TFNPvpr63hVjYTlSF4RbMRaymDlUJwWzYoxO+" +
+       "Ig6OY5Pjo2li+/s0+z4u+7OhBI5khOnopHj9a8efW8cp+r7kZeu8s3bbvYS+DWbWy1roJ0p1AeY2" +
+       "X+fziwq7PTod5KluzFOwS5vjjtukunB1xtG3rkji+868nZBbnTAgkLNN9Ezlg98Zlxha5827EPn0" +
+       "5OW6tutYMa9O+U5TiKz0ggzo3G2J1u6vrY40j3UfBNuDg2ONsRwUmNyZMREtEUZK8Ifne0GcxmXx" +
+       "L3F7fRIQk3RU2t4jbit2VdddKuMkXMTSERChLhN68Hj0bbJ7JYxZ8evJ8+Y5Lg119jsTYSQ6dxXs" +
+       "VKvg4DSyNLKMC2MsbYLARKFWKlCw5wzKlkQYWgttGacw160+Qze+GHCZbC2hGlGVjaX3h5YYzj3f" +
+       "DFYvzyl4YkBZrrrZtfQbVtkyqYQ+rtBBDGBnuPOcHrLOPXfllLstfKRrywI0ctF5F0qltBsNN9Rh" +
+       "msY8es8xjHtcrxnobZe4k3Nuc51d2e2RHRpNSdoNbT25KkUrQtDy69Wxwnnyc1tdraRFtHagZVH9" +
+       "q2swXNQyLCahLQC4szGKaGZKqLSiD3FjPm/7PL5ZHq/XmHmEJ77utU9tZ2zp/ODPCfhI7MvpP+fy" +
+       "16rtvaad6gz2zk1d2YaqMavtFjzK6opMh34RTf/flWMJ0d7tOtpgM0vJ8dPn/rfB5LrZc+fPfnI5" +
+       "rc/tsb5rm3jyV0qOxk6ObY8ZOaTIvk1eLm6lLtZNvtx1laKDXauwgE+92StvSXJZab2zM2l3uYmi" +
+       "IVzSVvVOIE4TEEKad3HGSKygKpCaSo7ct+/dUzPu1tE3+lX/Z7WAD7kwJdnl+r5V6jq7Plwv+rjb" +
+       "GTGL+z9mNjB3cVT+p/DcR60xRs/IsnzfdPSZMlJLJOVkTvp0jO+LfL4X27EcdvPDw3v6OjWSz+TJ" +
+       "Z5l8HIoiquZXPPLqmEUOm39RGa3IwsOfguiZmZqIF2DsDpJJiTapSFYKFGDTr79fD/h/Z/kw1/A/" +
+       "zxQAZAP48GZxmZj/BHm7jPl4tco2zu/RSCM1VNCZI5cwWyltz3GeHlL+w1PK7o8fDTfJUfwq7AqK" +
+       "ElR/1UhrVBdYNUW0LBlGoIo+JbBiaGwNIKCvd/VrVuIOVY+HGZJzZzhRE6ckuA8ticpZOPpOuuXa" +
+       "KImu3UyMxO1amcSxC8mbshm5/lIYjo5kHcND4/kn8sbsRwh++dFinScFgHcTjpweH3aAkjJ7NZJh" +
+       "ddL2dOl6oL1jLNaYM1MgGs52V9cDhBLMwwtZ5YpSzsDNuTpQts24pU5iwhxqgIHKpU1yJCBXnBEJ" +
+       "mSqlV5u7exQh/p1mcnW7JmCri2y1MbKmcokR2TAXipUQkC6CwwQ12Gjnm44X1tVZUp3wlIdJOO5m" +
+       "wrczzu+aFaUilZUS7dnOxbWfWcQeSZ0hL7XHvhkbDzwo37Y5ckj7LmXmHin4QLlw9Ec5/JGyztRG" +
+       "X77Pgow2DsQ6pFw8CK6PUTSTZrWK6ms1J4xnhI0q8I+Ssvmmx/P/r7qE2bRAJB9mf25A5z30NtnL" +
+       "6Pmqft54xt9X3KrN/NSEF1a4R938Ou1vHaOqTRyvO2h+ZZqd1LGaryhzy460Fwfoi7DtiepNdA+V" +
+       "zXPjwfHd+wQOyGMkj0raTGF7VnkvOqpmpZThtUdNn0VJPsKqbdOUAo16juWVKpvxIwUefdTGVI2W" +
+       "xt5rY2t2viki9JK9xd3SJIkOhySAxWJLCGZb4LrTCT3qPu7MoTJE10zkYWgeyawo1blLhbkKGHiZ" +
+       "SLONHph0Zmnz1cYA3RqHbyrB/NqTf4rxWClAjux9sybomMloiRMm9QlnP6Jj5HvtjsYF7il7l0jX" +
+       "MtL9sUMBEpx91hbl+/jW3jqZXfdEZMIOccK6re+rHGqfbGxjYnnDOe8T4OziLqEn8cDo8U3uZNI9" +
+       "+rZY/1+m9aZrGv2EaunZM0m5cU7X1POp5guRbRg2tot/g+/jYyTAipiYd30IhHmjxz8Zc2rQjdcb" +
+       "5CZdXH3fH4T9H42O/j68ZVXgty63afB3lwUIheY9TdWksCKNItEw8L7kwgGaLvc85h6mRaQPm7YI" +
+       "mYnovikrbjd2eGmWNRN588bS0s7T3WjL59IZlW4eJhSFGPW6EDovZLjfDVL74o92s5lyAyQ4INyq" +
+       "gVzWv/j4aw+H6buyxIjRdfRDyZb+NHWrsD23UhRwlyzY42awYWc6lfzag5F55eStTf9rRhuzVROE" +
+       "jAmYZ2bWlICbSehLazA+NNsC7SnKNbXXUMrObZXU0bFu+phdvVja6/DNCQkzS4XqDWlrDytvLVIO" +
+       "fd2Xj0O24X1z453ylFk/j9ve4lz+B8utfOXokeilpTm1L/zvXc5+pNcY/uLmvZPpsezuc4Z+g7I8" +
+       "lVPy/Et9eH+Y3vZIZe+aB/CTMODCDJOMeDdsmKt29WEjDc9AfZ4u1pPukz03zhZ+vzRdmsXjjreU" +
+       "wgzctKJSRVDe5xLLIZmbgWLsFfHqm+F1I9+nyKo9edkYW3R9Ipo983Z02KIfdeHBkMHHn8DW4nz1" +
+       "+5mgdApk5IURBIgEE7boPGAFYAPquEaBic/Rwmnq20EA1FiEVQjBjJBIBfYUfkDwGbkAZUUtZlor" +
+       "CGHFFIkqUrRhxgMJB68bJedguTa7L1cmjNiwpEjFYmlAFEANGhRu+FBdJgUlb+itYpLhS9e+sqou" +
+       "8GwAGRQBD6gRE4/rD9x71IXGomMpBwzAxWCKQqUBQqNKgqXLiV3bppW8JdCriy8WRjlL/y1ldMRN" +
+       "K2pRQFbRHHIpqmjKgqoiL/dcyukplgqt/fhMTEmmVy2jHGg399Na2lx0mApifu28Z7LB3WyX7mAd" +
+       "D99Hq/Cj0hGInwCg7T8PY/TDUMet3DA3yc4aFiKkE/pSz+ovbPD+L8fxI+cfp22n9HmdfqF67pXR" +
+       "+uPpkTj7JuUM554R0uKFZo0uwL/244GOE/tg+zWdJ3fbGmaQg1dnHTLH4+KPnFDj9Vq1ZNL/eozL" +
+       "Oipce/ukJE/6vGGCvqFnbZvqQ34x9B/Cr02eF0o6TvQP8Djg+slju2sLO0IOiOv32aRo+4034LLE" +
+       "svPHM1XAdlzu7umNN0T+MWQPqHjxOSv6tjrUsed7MxDZ6lscn38Yw1ZDHN27SuxtezttN+ryiaRO" +
+       "XO4cZxK4nG9Sxll+s7P2/WoC06HgAniO1M0rO00euOEpcOtyWHtwG/d+iPxcl+LSkORcLIsRkQRY" +
+       "xZkpLTK1Uf7q5MMuiLCRIiIxg39+YMUrdMoqnzK8S9SZNNjS6vRlVG0vLrmmBkmElFkgUhqSZUoy" +
+       "UmokxRtubunYNSN3r7eVeSuxCvS8sVJUbTZpialZgpN5eSOUARUHSKXmk/EfaD1QAkB/R97g+n6D" +
+       "26vxDEMzIsfuDQBwA+SQf6mQD7t/2mqYNm7/n+41MP0TCXIP/o8z8QRjGRgqxFWaMY9g2K3/ibbn" +
+       "CVQUGLt/a2uMYK9wdkaT/RV/f+lsNgbDUGDIrtjJIGxuLmjHdRBiSlIeBRA55x/gJCZKPkGhb5gI" +
+       "JJWoXgE/xQxRGsG8zgwNRkv6s1qmrMuJy7kvcz9XJcvrH/OQ/BrAHAYpIjVX6fsgUoh9SE5Nnd3g" +
+       "zZ5U311/Jt21rX2reXWLDTZ/Plt2iTpC7o2wIXi1ZXpMuC6o8jl5NNK1ufiCI4QYZ8zRkXIHc+o2" +
+       "dz09LIeRrw6SiggEnXNekIZCX/GNh80mkAv64zdnUUYI0HBAe+mYJ+Nr1mrcgsto/JjUU7aG0HJw" +
+       "+mYzx3Gbozde2ufknoISciz5pzjP/aWwB0x5a9CZA/D50hrXtw0a0Z74AjpLgzVltLPpLeL6iG0q" +
+       "eT0iGQ45tex4C64YGHHmL7H5CevzIRfV6WbHr9aOqNxCD9C+CUGRTi4P7HgYpJAYcQYpUDlYDyTZ" +
+       "uEAOmsMCvAloH931YhIqh4pM4neZHlDC7ge0QXGq3/NLHebo/hoKeLx0j4W6vYfxgmqONk1Z7due" +
+       "evpJXmdZdgqUfrP4SJAw0cwobQOPhxgmZKfQ6vLuWksVK01CgzfuOkOo9dB+BxE22TtpuR0dZtWx" +
+       "5D1mSnijyQwYG81v3lFp1zqdJyCT3oUR+eWUtlMov3JgIyU0IgUjij0OEElhAMjJ+KcAgKEwiian" +
+       "dEBke53FPGUpTUCivh9BPQ6TeB4ItgkHv95D5ja/YbE5Kcso/Ah83Gd1SfgrmWZa+wPapwe4uj0T" +
+       "jpLP0z5aD7gqh2N4eknQHYyEYxifBLfE73Xh6/iQvh0EgZswbko0hjTQy+okSCPz/dRWAhP5wpqw" +
+       "140Z3KDUno9Mj1DVf4gJcEhAuAxueaRvE3g3ECbMUAsVZTVzNPYDHEzgiCIDpOcyoJLlCUYWcet4" +
+       "7ePfQZgnwEPNsoYMlyTqz+j5vpktwW0r+fzEMVLJS375MNcESaVLotl3VcK3PHTjsVVFJ3ImDNmM" +
+       "xZAMde2fScG8uc8ZcMpgfnzNJbcHJ2tm5zhDJDGicfN9dMfMjVUO1RR+3bf0eOIquh8+LnG2HusW" +
+       "sWYE+LoxjDBuDur0G2LibFPEDPZ4d2LsHxCzY+kya2SyDctcxxMbhDQmjhzXanEHsHH8Xxb+M/5d" +
+       "lqVPIKkHerSdSSUu9nMGRBMD0tkxGAww5uHB3dbnIY8H4jKEJt549/JdtanPlOc7z8dWrmousQIS" +
+       "QPL3dohW47oSBtCNlmbWOTkS4SZCy3G4kR8IhnaNmh5eqaUO9Tu3ljXXoe56jpfcnek/iH+H1vTx" +
+       "ToHonOg8Gwcx7QnNg24NQkJjgF94VHeqSTLUDqap8BMXW7Rgihk0fA15wQ+fmff999UT+MVilpVv" +
+       "9/P9iHQYfglcQJx1eTrPcf1s/YP0/8f1/u/caT99S5oXWNyhVBcMwDsM/jFSrOPBDwI70ki97A8P" +
+       "h7POfVftueN7/4bc3zV3EfGmj4EVKYLiCEiDYLHGYX9qm0SEAiRIEDuA8Z+YiYA/PUEkFF+MAKiR" +
+       "P2QpOQQdhjIkDIH1yFmsx7DTsealkpikVJonTCoxIp16sK8zzCRJJCfB+vkaptsMEMjbzVE6/9CC" +
+       "XslEEkDiZnPqb7xvvLWb6EBuGSpbCWJbOzPPIekhGTrDqCgCRGXg7wE/WCI+xZbbCVCIkySVhDU6" +
+       "iSHwoqKSnM9om4Z+VKwjShuINg52K8xiMgTwcy+gB5aaaOlIdh6ltZRzk3GM2E1j3QVv0JgtFBEi" +
+       "B9KFkiEEIztjqiVuhtcVgDgDMCQEiQclOBoAb8j0kNzmZqMgqIQiZyBxTqm6JIyIan6NinYhxYSG" +
+       "JyxBA7ymhR8re9Z0wbHbWDFwvUz+H2n2RjBgBMwyhQIayPV9Z14rzyRErRFjaGPLy67W6iyXl3Bi" +
+       "baZCCO67rXs83l5nOutKxBdZDJhhgR1o0apYxhmB4jBgRjEkIT4M9v1zp/I+fbCK8HnO575lkn/x" +
+       "DEhI1lUimGCeYmY5MEkeC/y8HN0fCoDIwZ9/3pzHcanVKpKQPfBNYgf8IpQ06r+VWJIT5W9+InZH" +
+       "GBcbENwEEToXgsIRM0+tLJYkbNix6sWTPLym4icYJ6NsCHrhCHEKRg49maIIwxhSFlsVLRgmJqBb" +
+       "AumFgMpAs0VWMksRvTYghmJ9oesSkwRgrCKDMOdW2onug6Y0rN142vIQBbkKICtRkQq6UsiWaIXf" +
+       "c4N2bAwue2bqKYCGpIiOjrJ9ILIqidEw1MsBF6lIgwsIUJQClSjJAxAJoD8OKwGYB+kzQbYCMTnC" +
+       "nptKOOJa5ZHsK0mYAYNjHHrhFUh+gdf22ft4lhwoht/4iB7pvf74yUstSpWW2BpaTEzMUNDT3+Xx" +
+       "tPZn5va3v7uWsyKsGANWqXAuyIX15bBzAkZcp8ThuDWjZkp7muszHKImsbggb0fmTRp3aoY0BZww" +
+       "qBtlHwvDMYcNnFUOcLBBiqRETh5a8C65MWUeQ3hMEGJA4axRgXCw3LeXMtTZrYS7gOPxqwk/9yho" +
+       "kEN2xaGzpqw0Sx7DP2Rx5OAjGC2nhkCp8eZ7Pcl6KjB7Y1OtCDUXvxr/fIo5Y61MRMo4QBdOORqc" +
+       "H7TSFEUZGRhWkgiiS2Vg2yEsAtkkoqEBBMU6tPGHlxJyOznTetzfbDkQQst0/e/824wA3uKb+eks" +
+       "8KhidRlsSMJBJEDAGfzk7/5Zwkpr3THH5M4PBEx5n17Ub0qggdJM6LfZGplTeD7d7M4RbsaW+zIh" +
+       "bbHrVtBWQYhgTBtzG8s+zmYYfbLM0FtOXg3zdMTnLhLwVII2G07inYX08zDn46f98SfttMDc7tdq" +
+       "tR1vJxHXPFvm56Di3fbb7CB5oO2a2Qkju78J+mXaTrL884tikdO2h9ScaToWOhUMzwO0W+zHSZ3r" +
+       "gy5mzHTPHYxsYRs8BGEQ+z4iyuKoWDUuxuuUwlwHdjD1w7IqRDSnYXEtsIFvacd43TY41gWmzczS" +
+       "imfZnvZw6hxrbbgziJaIZmveTeQXOoZsrON81oli52q8qR91ydprp136HHBswDP06BnoTlbpY3Bp" +
+       "hxKurWoC0sheZ0mG1NnXPK+WlJUMluUhjBkEb5UN5eLeEtxZkYYDTjx3XXn15raUWGBjKdQ2iYzq" +
+       "u80wb8DmFyWsdxFmhLGIyYgd3WU0Pd8HW9zvOpFDiJdh5QzUuMvN1MXW8Xc3O0TnOCSjDNYZY0OO" +
+       "1l7JZqnMMugzQwuoDOzTRBiDjHcGRGNUQQ2DOnKqECwRXKd7FCkOgWFiBxOkpCHZANAzRcxiCQYb" +
+       "TJBF6CLIoRQDtP4fLn9Peg4WBtZDpZ5UAwYLAEQURCfyfn6S47noxNAXMzYSQFhCCyECABAmB0Kz" +
+       "sw98wXf6rwgt4pBiQBukIhpoDiPT1PZtXMNxjvUQ4/qymZQ5rMw2BooMJn8SQkzvzpPgv1xtKu2M" +
+       "bMMfIRhYQNysAjqwTTY7i2ZqmOtw3gIc0oq6OqHWU39P0my8MNYbESokIP1kAOhFL2GQCw5GcPsj" +
+       "5BJdoBvGEeRzM8J2Jyx6nk5l6oJCrEGKvhCHMTXB1hYG1fP3a1n2ZA7vGrcbs+3KApFTBlZS2mMh" +
+       "JDECQxtcC34jSXUwOnsNeEHhiI8GWOiMInnEM6+bYdZ4z4ezEWCLEioyDEjAFmk+g8b2NRvRdMbj" +
+       "ZSNjM2KKmb6Ha6hS2zWlBqPh9L2eW2vVXy+veMsGVCKUsUCSoPWmmGMsjWUJLl8YlplnIPSBobnz" +
+       "ppHclkdYC2eWr5gqG0KcDtgoe2Bm1EVjFJ0rBCCqWhOGR00mSNBFDeJuA8I+jSGykN9il6Shmj1k" +
+       "D88BYgyLCe6lM1XjJDIY5DwVNmny26pmRqq5hxN0770E37hPulwMJkrjLS3TImIOLamTjAFEyWKm" +
+       "xQFKMhxOvYsr5MAgQ3/OJ4QOYm5WQP0hXg5AA5xQYME7fFCoBIJEOPM32CAfqQ2oO5cPfF8JERhB" +
+       "SU0J+SCWAXFy9RupRaY/bh9QdwQP3sZJHx6EPIQ+J8mOUvp8vfAfZP4sJgRGLbKMUgxAKRkKrCEi" +
+       "viWV+jrJIglYLIRqj0ko6QxcWWHtEoXyCSQbiZMgAicn6GG+0YcTCSFz0sVIOk4Sfnequ1CyymVQ" +
+       "LQ3mt2q9FRkJa3zVEkFgJjEzOjuygElBVCB2m2ZUnPzGrmfRqfDs8KSCiCMVjGD5EPW8dBEnA/dZ" +
+       "26RHQB3mI9AGQ0dG8Yez3OW9Uo2lBBthKkbYWuYUzxyEODR/OB+Mw09HWNPsDiBdsvpDYtitRVJQ" +
+       "bURSAxT1TiElh9RIO5SqWwOMh79GtpJXuRhkfidxAn0IIP0sULRYwRhbbbZVw8w3Dx69lZ8oQtn+" +
+       "wP+h0JOY/eeT4y/Y+mynVjc5IYJQb0t3QkHIPqgQ4JxJmb5W/6+t16TV6Q+by3Xlmv0stEbJZYrP" +
+       "3Vpoa9J+LBhGBGAPEoVOegvTxtQgwZRI2goEUkkG2VKwlJ0nh0HWKmRzfwpOI/YkTF/JwVzgiceK" +
+       "QIjIE8TnxOv173TUwNt4te2B1fU15wGEE6oPpez8o+JryMT3HvDXaF3ii9ywJEDh29LbRHw35sTZ" +
+       "HTbm0Dz3w6O+XOshot1XKs5Lyq9XgmgGRMLOl2h0wOL4dK8nS97r4YhKE+/uuOPkGz7ENQzrDqaK" +
+       "eCCxggisgKqJQkgGoosJGYdV6vjqW6etE4h8zj2jpuIA8yMkgoSDUix+cZAYrLAfWAwz41REqpH0" +
+       "nyD7fFGk2pLUWmZq0jVTaV87gpTimFoMk6CG0MKU9N2JZqGZMCzUFNQKXCFie2Bk6NFkN2iahqd0" +
+       "TUL0PoBd0Z290I/cUoEZ4MYRRbKLTp6ZNhloaSFsqo0paokUEGQjIQIiRYC/pNEC6IqiF8Dkeyqn" +
+       "JJo/j+AEzeusxpCBHZbt3Z3nEOiGpTDhSLd02YNlpvN3JN2biuIUTWVJkqlpZm2SadzIymtOoIwm" +
+       "9Cm4MSGFJl3fXvWwqG8TZUw4NAZGMJrJOfufKAya+i0Gw7zE2PDQVPZippYfkBJIblusI7LkQF4w" +
+       "TieqM1Q391XtVi1ECRGwuacU3RoM+hiBIFBRIZW/vXKsjEOMVmhRmGZaE7y9THsnwzG4vjKAkhGc" +
+       "wJ1qQdFgniU0EqNFctIja5vRKLqjOiKgxZIk7lAoBg22zgmZRQssDPaAyL90EObLBA6eghCMQhdt" +
+       "CL5/ses39Q/Kjqia4HvV7wOFvEaShymnHiMeJQ0SYBGE8aFnxalICkMPOw0qOUl3Nwgckkj8w0L4" +
+       "9fVrVNZNOPnwdJycD9FNJ9886azUp5tqGY+EAYeKTfvgnWyMDoYgZGLDNSmJnCqaAMIBkGdDc8rR" +
+       "RIpCpUktoRdFzBodMKjG1K865pNFr0q+DTbT9cKuI6noLmhbcIUQFHS5v377BVJTsRM38/k7bjVQ" +
+       "/QsGFAWOwy4omnhwaQ4dir9UBWLBQtxIJqOc0kd+1gLNFJRamnepDQhCb0D22mGERkybwyhxbkvG" +
+       "DfXrYw0hu4GOIYTDa3IR130b1DVq4FlBjTdyZZILa5cMBJorNMsfJKzYbIZibbkDp9eD+qcSCJ+Z" +
+       "Aw6J6JiTwaKiMsCRrPJo/VKomqUUaNX77+KQwCQBk8d+WuyGzDeB+XezzxcuJGLIhkMpMD6P173X" +
+       "LtobHIhvI8zl/jzAYzfP15Vtfno0bRSr3OiMZIyCc76lEhkyY6kJdFFExO7MSLFNET9zDMoTSfEm" +
+       "FECcF1Y5N4ToR0aUA3GSzFkiICKKM2wagnNB58ypLSPqzEaq0TxVGQloCZoMHKnM4RsYCB3sjADF" +
+       "0ulOqQx3OhD3kXkllMGDo+iI0e2gNQihIWnefq7k8HyQBTwO6HqOTDBbhLDMeBmE3d2ry1uaxUlV" +
+       "9WZLWNc18Mua2SNpqTx2umteedVqW9zIWW4rAboajE0SBhAcQLS6xZdoLE5myiDDRCnAer5IeqVC" +
+       "p4fZ8tnsnIL0sMgb0WgFSV2D9yOEDOg9ScQ8SeBT9Fu13qH0Ia/TilDH0r7/kCRPayBFqjiF41Pn" +
+       "B+IRYJBzdlB68ANn839DLohhGQB64qMgHpYhQyLpQVEYEQUCwmtEiprwfikV8whevoRXFAgbsEuM" +
+       "IAGJosjS1IzJmtC2QVIJ85D3MhplhRsD2JLlKgZlCBGRTx7OIFoaJDWV1p6ZY2MA3mTkVuTCLvkY" +
+       "B9GQuA5JGEEkAIzNyD7XtQedjp3G16IAZoIFHukAm/wpuNsrbW9+RESIe+yorMlloVIl62QMxK0l" +
+       "JIsGBZaSASHuIqUkoOtNsqdiQ01oDA3qvbA9AFEWBFXviyRgWqSxkWs2irRtSWyo4XBSwbCYjsF0" +
+       "JyEDqA876sc4VAoO4NNd5wAlkHoPthseqcSMzdXvnnuMNy9LCQ76CTonH2SJtAO7mFUwWlkEafWW" +
+       "UJgaipGBIwwcBTZozNJTWvxlhY6P1jTHN1r7qs+a63NG80pJo1FGpCgpWmW9G07U7LmClLJRMtIH" +
+       "+XRZByw0WARSKtIlpEEa++lAsGIXNYJSOdY0GZbMFERKblrWECLFCWULJbSgFSpXyNoOytD3YL90" +
+       "xYSQhlD1QLJLQI0He9BzCEnVUSqicw+8My4R9hISYkJGYIxj8ruAhMajQwXdcJGBSBFRYiEzLDQs" +
+       "CajBMxmCr9tr+pNttLXxe3r5N7djRszWjJLEZs1mapMmmTJTQTNpSqUZsNU0JRlqNljWTbV+p7df" +
+       "Lo0rUkVjdV+CKMDKORHjOxLhIwk9G21jFEYFD4XjWjw8wvyPogFPIeTDwiBloHASYHMk8xALgXwl" +
+       "ATRqLTEQYWQsVkWQUKaMBwo7AQKQfAF3fSVyBBLobqUc9N30Yhd9lPGGxI9LQNomLwZp5ZZsMZkl" +
+       "oF2Byvel2w26lwkZCYQKHFs8KDgeFO2+29nFIKMOG7yWYijLbKDKNtLaksQtZVRtZBGNkVAxCiCA" +
+       "Y0LYLJWyyolpYoiIlGrAkS1LLY5k3YQxlKvO3TdNkNSU2Rdd21cyEIcUog9BsnPOQYJDHgyjFjMY" +
+       "rbgvBfJuwtEhGMMokttuSiYYRmQzSrobTNZGFRBRJ0D9I/mJERaCCLCgGiqRrIBlFPnSl5lPE51v" +
+       "mPyjjESFnwAxWlkO96k1MjkQjxldSypErtlBcLC2xJa5YIMOc9hTxTkPSHujC48AnAicrbndNoPO" +
+       "N74pxoN1p5k0VDQyShtPkmhEPSBIBwWmSBAhFI4ntAwUbinCB4hQIFQWEEWCWrvE3qfzQrTTT7si" +
+       "6zQ8MvTyensgBuMEix6adydCOBCBUjFYG+R5YCfYgcfe3KBA528A6ViECYJgPJNB3nSTyDyPKUoB" +
+       "/mQIKxFDYbNYIYrQNbnFO2rWmvkt5vFGebcxXGlIkCiBwVLS2QolREpXmBd2Q8XDpAVtaSkE0BTO" +
+       "nujaCkO9awitnCKKcMnFFHh6fqiPxztdZntuRCeDzyIgwh826nhMzIM2TOwEXW01STLWw5saZe6L" +
+       "ZJoHfoIya3HY79edGjjYfToLT9W+yIpw8X2hhlKhzNjppSbn3t5mBXnyGl+qT7uQbI5+TV6rtb5z" +
+       "y+41+l5LWFxPpRlQGUYQndmJEQkgvWI4R/1s40rG2dyJDQtbruUVR5sPluFVcb5o5DQrT35OfHg6" +
+       "nXsdDhJ4Nkg6D223DHsUoizm1yj4XOdaoIMlVhMBJZJmCIHqgC0gfgz7LGB9HflZG54HCcBh4375" +
+       "6X1dGN+X5axnNu8vqiV7DyNFDXakMyESZcSBwet+6o/TaDQ2yz52GvPcN8lqBxN23CHsR/XQBTJC" +
+       "lBxVhYJyjcQgQvEU1rk+6HSk9vKX+aSBPeAzRGEsBBisD2+XwrWjbRJaEliHqYvlo00yzvSnv9dM" +
+       "IE4khSVKE0W3I2lkgwSAHIhNIEKQQELu+sjBqOm7Ur2wecZHEVHbQYRG+frxWHNZz8VZk4Em5sHZ" +
+       "45CsKUcCifEbXdlIxssZqYYyRUVA+UgcJuAeJwptCkVnJypDkksFFCXJaUuMU2A9AwjZg0nU3GQF" +
+       "qrx3zaKJS3bl733s0xg0apuNuDStMwxlcQVMQQKVQSCZvRLTcU76R4xLMmc45p69aBkD9poNHIAd" +
+       "IFnQkWRDo32AsplDEwLMsMJsGweqY8JPrmunefNpeK8/dLFIqiYhNYz0QzOmhJGEB4LqASPQy9S8" +
+       "obyytQSt66RgQTZZrWZKxiBqQEicBaQPIO6uPfxPFVgzwxzWUbAkltjaNVbTLUj8W+oEtzaWw8tn" +
+       "JhMw+KeonmDEPs9ppd82wYnDsFIVXJTYejCLMRdxe17QzSmWWQ5F4rbErEQhMxuQb6n4lrW+BF4V" +
+       "MbVfZ4moMOjGHVTmNx+DkrbHWs9JZwe2dbvDNDJnT1xJDMtVDIDNVn28eMDhnCKVCs4SsDGI3JRC" +
+       "4FRQycOmGmzVtDCswMNYHQutmo1uWyqAiLp4YmEIKcdLMpQRYzDRcy/Gryi4zHhmO2DrMlwtiFxs" +
+       "y2URYJEW2gl9WQpkJcLLPWevecJ17XXby7blWRRB4c6cgYhEYsM8wsNyABYwJtUgZTpNybGcdonJ" +
+       "jJYb3nicBcbBxDZzEMgiSIY4IkvGEhqJZLjBsFwzJlyJGR+DaLlt2SkuN17TCLhcW8YTBMwUziQJ" +
+       "n52sYOp21W0RM8UC+fKzk0bnoqBHWMxnAW7wCKc/x7rcjpmWhpRANpXlDKoBjEXS35bNSwzddkdA" +
+       "OajcSPD5WSQxnM63z99hzqciJVGxghWs2lipUVyOSjj0zMZ8aVDnmx9pb2tWoKtfFa3u2xrTKS1N" +
+       "7OFeumgtBKKaR+2UJzieUMYBjAIR0WTWmbctjckr7N3VPOru7XMVNk3dt2WIqK02ZudmLFCQkCqp" +
+       "qCyBjGVEdTfF1r7+h+B4O7cou29BYbMh0BFODClliYY5AfJs4+D71Yp7UjPhZjgi333MsPyptUte" +
+       "pFqLJSVa3K525vVziUCCba1HiWF6EI0alvjIt9W7XktfUWvmlum4Kk1aPtoT6dBkB9UaFZ5QZbHG" +
+       "W9Hx/keXtc/nnahU1Y7RoJIXYWFhEDWKe07iby+65oodgnCkf5NWkMTu19eoiz4tB2FkEbAkZFkC" +
+       "QJE2Av9uxj+i4HbYr0Tvi1I5100j8WCciL7h7fGgQTpfTgkJBFPsDsIMZBj5Wy+oD9j+QeOzkqpU" +
+       "q/oD+P02H4E8UHwsrFH7aSsGVsBMw62mEXoSkQ84lgDk6QPTQSKJ6IDuMet75Q5MuoXGTnYascmB" +
+       "kZYOrLA4yQwFTEheZ+Y+BIKiIshoD3MOAx7LfBLUJvRj7KCQhCEoyU2M7LULDIge6lGgjgY1GgVP" +
+       "1KiERIjIAqighIyEC+Xs59Werg1dzsxTVbdmPUHCsMCzELDJzLSojrMVCiDFw8Wmp7p8Vfz5LJrI" +
+       "SQcTIJk0em8ShhFjDJtzeGIl0lZ35N7yVChV+qBCJAjIDCMsy22FjGaitTTZRNUXvy4bk3m7YZ2P" +
+       "WRoBNMYUgOEQMeLhWFF1FeiKoHKwXDHI4GF4EzoogSYlFYVPFwyzgyUiM/HtTQzSwY3/935P/pVS" +
+       "I5ztPxjuSv4UbQOH7cbKdMD1cq9uVWjVUZovZM7cZLxSrw2eWrDGsDgVWAPhYSdXl3xfH0oaTwfb" +
+       "21zqsFhC8NIHdIQSGZveMwM7oSy4ZzP7nD3WnjXGmq73mP93ldP8PvgOpMwbfV1RvR+V/DOnF9rK" +
+       "v9hdyRThQkN3QmOE"
index 9256164d76f3ccbcfa43887c73d4daa425dc062d..6b6c1e5772b99759469af7b006aa1f41d15de7e2 100644 (file)
@@ -77,9 +77,9 @@ func revcomp(data []byte) {
        }
 }
 
-func BenchmarkRevcomp25M(b *testing.B) {
-       b.SetBytes(int64(len(fasta25m)))
+func BenchmarkRevcomp(b *testing.B) {
+       b.SetBytes(int64(len(fastabytes)))
        for i := 0; i < b.N; i++ {
-               revcomp(fasta25m)
+               revcomp(fastabytes)
        }
 }
diff --git a/gcc/testsuite/go.test/test/bench/shootout/Makefile b/gcc/testsuite/go.test/test/bench/shootout/Makefile
deleted file mode 100644 (file)
index e1c9b7b..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../src/Make.inc
-
-all:
-       @echo "make clean or timing"
-
-timing:
-       ./timing.sh
-
-clean:
-       rm -f [568].out *.[568]
index 1b4070406f3eb4375fb4fb23c835f85fb85b4a58..9c35ac52a96026c8cf96cb5f229825016448e2a7 100644 (file)
@@ -36,7 +36,6 @@ POSSIBILITY OF SUCH DAMAGE.
        icc -O3 -ip -unroll -static binary-trees.c -lm
 */
 
-#include <malloc.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
index 3bace391c4d7c69a47d480183695d1553f7b6a72..9c30620209e24e54059a9e0207c5bdf2f7f9829d 100644 (file)
@@ -221,7 +221,7 @@ main ()
 
    free(s);
 
-   g_ptr_array_foreach(roots, free, NULL);
+   g_ptr_array_foreach(roots, (GFunc)free, NULL);
    g_ptr_array_free(roots, TRUE);
 
    return 0;
index 1f9fbfd3d4418345a603b53f0ab2f529755f13ee..df60343c240d453c41eab40dba0302863645adfe 100644 (file)
@@ -50,21 +50,21 @@ func main() {
        out := bufio.NewWriter(os.Stdout)
        defer out.Flush()
 
-       w := *n
-       h := *n
+       w := float64(*n)
+       h := float64(*n)
        bit_num := 0
        byte_acc := byte(0)
        const Iter = 50
        const Zero float64 = 0
        const Limit = 2.0
 
-       fmt.Fprintf(out, "P4\n%d %d\n", w, h)
+       fmt.Fprintf(out, "P4\n%d %d\n", *n, *n)
 
-       for y := 0; y < h; y++ {
-               for x := 0; x < w; x++ {
+       for y := 0.0; y < h; y++ {
+               for x := 0.0; x < w; x++ {
                        Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero
-                       Cr := (2*float64(x)/float64(w) - 1.5)
-                       Ci := (2*float64(y)/float64(h) - 1.0)
+                       Cr := (2*x/w - 1.5)
+                       Ci := (2*y/h - 1.0)
 
                        for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ {
                                Zi = 2*Zr*Zi + Ci
@@ -85,7 +85,7 @@ func main() {
                                byte_acc = 0
                                bit_num = 0
                        } else if x == w-1 {
-                               byte_acc <<= uint(8 - w%8)
+                               byte_acc <<= uint(8 - uint(*n)%8)
                                out.WriteByte(byte_acc)
                                byte_acc = 0
                                bit_num = 0
index 2c4fb77515af0c3ef3efa18b4320b543c4759284..a518134ba65e6e8459a4c59607514d99a2e22a7e 100644 (file)
@@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
 * contributed by Premysl Hruby
 */
 
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
@@ -57,7 +58,7 @@ static struct stack stacks[THREADS];
 
 static void* thread(void *num)
 {
-   int l = (int)num;
+   int l = (int)(uintptr_t)num;
    int r = (l+1) % THREADS;
    int token;
 
@@ -94,7 +95,7 @@ int main(int argc, char **argv)
       pthread_mutex_lock(mutex + i);
 
       pthread_attr_setstack(&stack_attr, &stacks[i], sizeof(struct stack));
-      pthread_create(&cthread, &stack_attr, thread, (void*)i);
+      pthread_create(&cthread, &stack_attr, thread, (void*)(uintptr_t)i);
    }
 
    pthread_mutex_unlock(mutex + 0);
index 2541a766b7f63d61b545274f6a5451a487f9b396..ee1f889b4a5f152cc5ad30b197fbbda80c6c505b 100644 (file)
@@ -900,3 +900,264 @@ threadring 50000000
 
 chameneos 6000000
        gc chameneosredux       7.41u 0.00s 7.42r # -3%
+
+# A complete run at the Go 1 release.
+# Significant changes:
+# - gccgo is now enabled for all tests (goroutines are cheap enough)
+# - threadring and chameneos are 14% faster, probably due to runtime changes
+# - regex-dna 36% faster
+# - fannkuch-parallel (only) slowed down 40%
+# - gccgo on binary-tree-freelist is still optimized to nothing
+# Other changes are modest.
+
+fasta -n 25000000
+       gcc -O2 fasta.c 1.45u 0.02s 1.48r
+       gccgo -O2 fasta.go      1.46u 0.00s 1.47r
+       gc fasta        1.99u 0.01s 2.00r
+       gc_B fasta      1.99u 0.01s 2.01r
+
+reverse-complement < output-of-fasta-25000000
+       gcc -O2 reverse-complement.c    0.95u 0.48s 4.99r
+       gccgo -O2 reverse-complement.go 0.93u 0.16s 1.09r
+       gc reverse-complement   1.20u 0.19s 1.39r
+       gc_B reverse-complement 1.04u 0.16s 1.20r
+
+nbody -n 50000000
+       gcc -O2 -lm nbody.c     13.02u 0.00s 13.05r
+       gccgo -O2 nbody.go      14.46u 0.00s 14.49r
+       gc nbody        21.79u 0.00s 21.84r
+       gc_B nbody      21.74u 0.00s 21.79r
+
+binary-tree 15 # too slow to use 20
+       gcc -O2 binary-tree.c -lm       0.60u 0.01s 0.61r
+       gccgo -O2 binary-tree.go        1.30u 0.01s 1.32r
+       gccgo -O2 binary-tree-freelist.go       0.00u 0.00s 0.00r
+       gc binary-tree  1.84u 0.01s 1.86r
+       gc binary-tree-freelist 0.33u 0.00s 0.33r
+
+fannkuch 12
+       gcc -O2 fannkuch.c      45.24u 0.00s 45.34r
+       gccgo -O2 fannkuch.go   59.76u 0.01s 59.90r
+       gccgo -O2 fannkuch-parallel.go  218.20u 0.01s 61.60r
+       gc fannkuch     103.92u 0.00s 104.16r
+       gc fannkuch-parallel    221.61u 0.00s 60.49r
+       gc_B fannkuch   53.17u 0.00s 53.30r
+
+regex-dna 100000
+       gcc -O2 regex-dna.c -lpcre      0.47u 0.00s 0.48r
+       gccgo -O2 regex-dna.go  6.52u 0.00s 6.54r
+       gccgo -O2 regex-dna-parallel.go 14.40u 0.73s 4.35r
+       gc regex-dna    2.63u 0.02s 2.66r # -36%
+       gc regex-dna-parallel   2.87u 0.01s 1.11r
+       gc_B regex-dna  2.65u 0.00s 2.66r
+
+spectral-norm 5500
+       gcc -O2 spectral-norm.c -lm     15.78u 0.00s 15.82r
+       gccgo -O2 spectral-norm.go      15.79u 0.00s 15.83r
+       gc spectral-norm        19.76u 0.00s 19.80r
+       gc_B spectral-norm      19.73u 0.01s 19.78r
+
+k-nucleotide 1000000
+       gcc -O2  k-nucleotide.c 5.59u 0.03s 5.63r
+       gccgo -O2 k-nucleotide.go       4.09u 0.03s 4.13r
+       gccgo -O2 k-nucleotide-parallel.go      4.50u 0.06s 1.63r
+       gc k-nucleotide 9.23u 0.02s 9.27r
+       gc k-nucleotide-parallel        9.87u 0.03s 3.55r
+       gc_B k-nucleotide       9.20u 0.00s 9.22r
+
+mandelbrot 16000
+       gcc -O2 mandelbrot.c    36.09u 0.00s 36.18r
+       gccgo -O2 mandelbrot.go 41.69u 0.01s 41.80r
+       gc mandelbrot   60.91u 0.02s 61.07r
+       gc_B mandelbrot 60.90u 0.00s 61.04r
+
+meteor 2098
+       gcc -O2 meteor-contest.c        0.09u 0.00s 0.09r
+       gccgo -O2 meteor-contest.go     0.09u 0.00s 0.09r
+       gc meteor-contest       0.14u 0.00s 0.15r
+       gc_B meteor-contest     0.14u 0.00s 0.14r
+
+pidigits 10000
+       gcc -O2 pidigits.c -lgmp        2.27u 0.00s 2.27r
+       gccgo -O2 pidigits.go   8.65u 0.00s 8.67r
+       gc pidigits     3.70u 0.04s 3.75r
+       gc_B pidigits   3.72u 0.02s 3.75r
+
+threadring 50000000
+       gcc -O2 threadring.c    40.91u 369.85s 323.31r
+       gccgo -O2 threadring.go 26.97u 30.82s 57.93r
+       gc threadring   12.81u 0.01s 12.85r # -13%
+
+chameneos 6000000
+       gcc -O2 chameneosredux.c -lpthread      9.44u 72.90s 12.65r
+       gccgo -O2 chameneosredux.go     7.73u 7.53s 15.30r
+       gc chameneosredux       6.51u 0.00s 6.53r # - 14%
+
+# After http://codereview.appspot.com/6248049, moving panicindex
+# calls out of line (putting the likely code into a single path and shortening
+# loops). Significant changes since the last run (note: some are slower for
+# unrelated and as yet undiagnosed reasons):
+
+nbody -n 50000000
+       gc nbody        19.10u 0.01s 19.19r # -12%
+       gc_B nbody      19.19u 0.00s 19.23r # -12%
+
+binary-tree 15 # too slow to use 20
+       gc binary-tree  1.49u 0.01s 1.51r # -19%
+       
+fannkuch 12
+       gc fannkuch     60.79u 0.00s 60.92r # -41%
+       gc fannkuch-parallel    183.51u 0.01s 51.75r # -14%
+       gc_B fannkuch   51.68u 0.00s 51.79r # -3%
+
+k-nucleotide 1000000
+       gc k-nucleotide 9.74u 0.04s 9.80r # +6%
+       gc k-nucleotide-parallel        9.89u 0.05s 3.59r # +1%
+       gc_B k-nucleotide       9.39u 0.02s 9.43r # +2%
+
+mandelbrot (much slower, due to unrelated http://codereview.appspot.com/6209077)
+       gc mandelbrot   100.98u 0.00s 101.20r # +65%
+       gc_B mandelbrot 100.90u 0.01s 101.17r # +65%
+
+meteor 2098
+       gc meteor-contest       0.13u 0.00s 0.13r # -13%
+       gc_B meteor-contest     0.13u 0.00s 0.13r # -7%
+
+# May 30, 2012.
+# After http://codereview.appspot.com/6261051, restoring old code generated
+# for floating-point constants. Mandelbrot is back to its previous numbers.
+
+mandelbrot 16000
+       gcc -O2 mandelbrot.c    36.07u 0.00s 36.16r
+       gccgo -O2 mandelbrot.go 41.72u 0.01s 41.90r
+       gc mandelbrot   60.62u 0.00s 60.76r
+       gc_B mandelbrot 60.68u 0.00s 60.82r
+
+# May 30, 2012.
+# After http://codereview.appspot.com/6248068, better FP code
+# by avoiding MOVSD between registers.
+# Plus some other timing changes that have crept in from other speedups,
+# from garbage collection to Printf.
+
+fasta -n 25000000
+       gc fasta        1.76u 0.00s 1.76r # -12%
+       gc_B fasta      1.71u 0.00s 1.72r # -12%
+
+nbody -n 50000000
+       gc nbody        17.56u 0.00s 17.60r # -8%
+       gc_B nbody      17.30u 0.00s 17.34r # -10%
+
+fannkuch 12
+       gc fannkuch-parallel    155.92u 0.01s 44.05r # -15%
+
+k-nucleotide 1000000
+       gc k-nucleotide 9.22u 0.01s 9.26r # -5%
+       gc k-nucleotide-parallel        9.23u 0.03s 3.26r # -9%
+       gc_B k-nucleotide       9.22u 0.03s 9.28r # -2%
+
+mandelbrot 16000
+       gc mandelbrot   44.80u 0.00s 44.90r # -27%
+       gc_B mandelbrot 44.81u 0.00s 44.92r # -26%
+
+pidigits 10000
+       gc pidigits     3.51u 0.00s 3.52r # -6%
+       gc_B pidigits   3.51u 0.00s 3.52r # -6%
+
+# Aug 28, 2012
+# After some assembler work in package big.
+pidigits 10000
+       gc pidigits     2.85u 0.02s 2.88r # -22%
+       gc_B pidigits   2.88u 0.01s 2.90r # -21%
+
+# Sep 26, 2012
+# 64-bit ints, plus significantly better floating-point code.
+# Interesting details:
+#      Generally something in the 0-10% slower range, some (binary tree) more
+#      Floating-point noticeably faster:
+#              nbody -25%
+#              mandelbrot -37% relative to Go 1.
+#      Other:
+#              regex-dna +47%
+fasta -n 25000000
+       gcc -O2 fasta.c 1.43u 0.03s 1.46r
+       gccgo -O2 fasta.go      1.47u 0.00s 1.47r
+       gc fasta        1.78u 0.01s 1.80r
+       gc_B fasta      1.76u 0.00s 1.76r
+
+reverse-complement < output-of-fasta-25000000
+       gcc -O2 reverse-complement.c    1.14u 0.39s 11.19r
+       gccgo -O2 reverse-complement.go 0.91u 0.17s 1.09r
+       gc reverse-complement   1.12u 0.18s 1.31r
+       gc_B reverse-complement 1.12u 0.15s 1.28r
+
+nbody -n 50000000
+       gcc -O2 nbody.c -lm     13.02u 0.00s 13.05r
+       gccgo -O2 nbody.go      13.90u 0.00s 13.93r
+       gc nbody        17.05u 0.00s 17.09r
+       gc_B nbody      16.30u 0.00s 16.34r
+
+binary-tree 15 # too slow to use 20
+       gcc -O2 binary-tree.c -lm       0.61u 0.00s 0.61r
+       gccgo -O2 binary-tree.go        1.24u 0.04s 1.29r
+       gccgo -O2 binary-tree-freelist.go       0.21u 0.01s 0.22r
+       gc binary-tree  1.93u 0.02s 1.96r
+       gc binary-tree-freelist 0.32u 0.00s 0.33r
+
+fannkuch 12
+       gcc -O2 fannkuch.c      45.19u 0.00s 45.29r
+       gccgo -O2 fannkuch.go   60.32u 0.00s 60.45r
+       gccgo -O2 fannkuch-parallel.go  185.59u 0.00s 59.49r
+       gc fannkuch     72.14u 0.00s 72.30r
+       gc fannkuch-parallel    172.54u 0.00s 43.59r
+       gc_B fannkuch   53.55u 0.00s 53.67r
+
+regex-dna 100000
+       gcc -O2 regex-dna.c -lpcre      0.47u 0.00s 0.47r
+       gccgo -O2 regex-dna.go  6.49u 0.05s 6.56r
+       gccgo -O2 regex-dna-parallel.go 14.60u 0.67s 4.42r
+       gc regex-dna    3.91u 0.00s 3.92r
+       gc regex-dna-parallel   4.01u 0.03s 1.56r
+       gc_B regex-dna  3.91u 0.00s 3.92r
+
+spectral-norm 5500
+       gcc -O2 spectral-norm.c -lm     15.85u 0.00s 15.89r
+       gccgo -O2 spectral-norm.go      15.86u 0.00s 15.89r
+       gc spectral-norm        19.72u 0.00s 19.76r
+       gc_B spectral-norm      19.68u 0.01s 19.74r
+
+k-nucleotide 1000000
+       gcc -O2 k-nucleotide.c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0   4.90u 0.01s 4.93r
+       gccgo -O2 k-nucleotide.go       4.78u 0.01s 4.80r
+       gccgo -O2 k-nucleotide-parallel.go      6.49u 0.02s 2.18r
+       gc k-nucleotide 9.05u 0.02s 9.09r
+       gc k-nucleotide-parallel        9.27u 0.01s 3.29r
+       gc_B k-nucleotide       8.95u 0.03s 9.00r
+
+mandelbrot 16000
+       gcc -O2 mandelbrot.c    36.11u 0.00s 36.19r
+       gccgo -O2 mandelbrot.go 43.67u 0.00s 43.77r
+       gc mandelbrot   38.57u 0.00s 38.66r
+       gc_B mandelbrot 38.59u 0.00s 38.68r
+
+meteor 2098
+       gcc -O2 meteor-contest.c        0.09u 0.00s 0.09r
+       gccgo -O2 meteor-contest.go     0.09u 0.00s 0.09r
+       gc meteor-contest       0.13u 0.00s 0.14r
+       gc_B meteor-contest     0.12u 0.00s 0.13r
+
+pidigits 10000
+       gcc -O2 pidigits.c -lgmp        2.26u 0.00s 2.27r
+       gccgo -O2 pidigits.go   9.05u 0.00s 9.07r
+       gc pidigits     2.88u 0.02s 2.90r
+       gc_B pidigits   2.89u 0.00s 2.90r
+
+threadring 50000000
+       gcc -O2 threadring.c -lpthread  37.30u 327.81s 289.28r
+       gccgo -O2 threadring.go 42.83u 26.15s 69.14r
+       gc threadring   13.00u 0.00s 13.03r
+
+chameneos 6000000
+       gcc -O2 chameneosredux.c -lpthread      8.80u 71.67s 12.19r
+       gccgo -O2 chameneosredux.go     11.28u 6.68s 18.00r
+       gc chameneosredux       6.94u 0.00s 6.96r
+
index 3e190e15c83c3cd937c7fd1d9932a32dfb34ff82..d269b875680973d18990512964603762d1310c03 100755 (executable)
@@ -5,7 +5,11 @@
 
 set -e
 
-eval $(gomake --no-print-directory -f ../../../src/Make.inc go-env)
+eval $(go tool dist env)
+O=$GOCHAR
+GC="go tool ${O}g"
+LD="go tool ${O}l"
+
 PATH=.:$PATH
 
 havegccgo=false
@@ -93,7 +97,7 @@ revcomp() {
 
 nbody() {
        runonly echo 'nbody -n 50000000'
-       run 'gcc -O2 -lm nbody.c' a.out 50000000
+       run 'gcc -O2 nbody.c -lm' a.out 50000000
        run 'gccgo -O2 nbody.go' a.out -n 50000000
        run 'gc nbody' $O.out -n 50000000
        run 'gc_B nbody' $O.out -n 50000000
@@ -103,7 +107,7 @@ binarytree() {
        runonly echo 'binary-tree 15 # too slow to use 20'
        run 'gcc -O2 binary-tree.c -lm' a.out 15
        run 'gccgo -O2 binary-tree.go' a.out -n 15
-       run 'gccgo -O2 binary-tree-freelist.go' $O.out -n 15
+       run 'gccgo -O2 binary-tree-freelist.go' a.out -n 15
        run 'gc binary-tree' $O.out -n 15
        run 'gc binary-tree-freelist' $O.out -n 15
 }
@@ -143,7 +147,9 @@ knucleotide() {
        runonly gcc -O2 fasta.c
        runonly a.out 1000000 > x  # should be using 25000000
        runonly echo 'k-nucleotide 1000000'
-       run 'gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0' a.out <x
+       if [ $mode = run ]; then
+               run "gcc -O2 k-nucleotide.c $(pkg-config glib-2.0 --cflags --libs)" a.out <x
+       fi
        run 'gccgo -O2 k-nucleotide.go' a.out <x
        run 'gccgo -O2 k-nucleotide-parallel.go' a.out <x
        run 'gc k-nucleotide' $O.out <x
index 902ba8410773065afba3d6bd96850d20e9fba6d1..55a15c30abed450ccd38c32f998e239060988bb4 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the internal "algorithms" for objects larger than a word: hashing, equality etc.
+
 package main
 
 type T struct {
index 843a151741f239dd7a8f1cad8607e0710903897c..c5e4f91e11951964d5889363edcf002e7a3cdc46 100644 (file)
@@ -1,9 +1,13 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Internally a map holds elements in up to 255 bytes of key+value.
+// When key or value or both are too large, it uses pointers to key+value
+// instead.  Test all the combinations.
+
 package main
 
 func seq(x, y int) [1000]byte {
@@ -31,4 +35,105 @@ func main() {
        cmp(m[1], seq(11, 13))
        cmp(m[2], seq(2, 9))
        cmp(m[3], seq(3, 17))
+       
+
+       {
+               type T [1]byte
+               type V [1]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [100]byte
+               type V [1]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [1]byte
+               type V [100]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [1000]byte
+               type V [1]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [1]byte
+               type V [1000]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [1000]byte
+               type V [1000]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [200]byte
+               type V [1]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [1]byte
+               type V [200]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
+       {
+               type T [200]byte
+               type V [200]byte
+               m := make(map[T]V)
+               m[T{}] = V{1}
+               m[T{1}] = V{2}
+               if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
+                       println(x, y)
+                       panic("bad map")
+               }
+       }
 }
index d6c9e79c607f74e20d5de50495e108549b86bec5..ee618b148585675d8c52ae1652c2af63f73d767c 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test behavior of the blank identifier (_).
+
 package main
 
 import _ "fmt"
@@ -111,7 +113,7 @@ type I interface {
 
 type TI struct{}
 
-func (TI) M(x int, y int) {
+func (TI) M(x int, y int) {
        if x != y {
                println("invalid M call:", x, y)
                panic("bad M")
index bcc78466dc2094112fb52e33e6d3acf2babee679..c6e038a0d923c7553eda6a89c19077d79e744274 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that incorrect uses of the blank identifer are caught.
+// Does not compile.
+
 package _      // ERROR "invalid package name _"
 
 func main() {
diff --git a/gcc/testsuite/go.test/test/bom.go b/gcc/testsuite/go.test/test/bom.go
new file mode 100644 (file)
index 0000000..37f73bc
--- /dev/null
@@ -0,0 +1,26 @@
+// runoutput
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test source file beginning with a byte order mark.
+
+package main
+
+import (
+       "fmt"
+       "strings"
+)
+
+func main() {
+       prog = strings.Replace(prog, "BOM", "\uFEFF", -1)
+       fmt.Print(prog)
+}
+
+var prog = `BOM
+package main
+
+func main() {
+}
+`
diff --git a/gcc/testsuite/go.test/test/bombad.go b/gcc/testsuite/go.test/test/bombad.go
new file mode 100644 (file)
index 0000000..b894d9b
--- /dev/null
@@ -0,0 +1,18 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Here for reference, but hard to test automatically
+// because the BOM muddles the
+// processing done by ../run.
+
+package main
+
+func main() {
+       // There's a bom here.       // ERROR "BOM"
+       // And here. // ERROR "BOM"
+       /* And here.*/       // ERROR "BOM"
+       println("hi there") // and here      // ERROR "BOM"
+}
diff --git a/gcc/testsuite/go.test/test/bounds.go b/gcc/testsuite/go.test/test/bounds.go
new file mode 100644 (file)
index 0000000..50f7ad7
--- /dev/null
@@ -0,0 +1,270 @@
+// errorcheck -0 -m -l
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test, using compiler diagnostic flags, that bounds check elimination
+// is eliminating the correct checks.
+
+package foo
+
+var (
+       s []int
+
+       a1 [1]int
+       a1k [1000]int
+       a100k [100000]int
+
+       p1 *[1]int
+       p1k *[1000]int
+       p100k *[100000]int
+
+       i int
+       ui uint
+       i8 int8
+       ui8 uint8
+       i16 int16
+       ui16 uint16
+       i32 int32
+       ui32 uint32
+       i64 int64
+       ui64 uint64
+)
+
+func main() {
+       // Most things need checks.
+       use(s[i])
+       use(a1[i])
+       use(a1k[i])
+       use(a100k[i])
+       use(p1[i])
+       use(p1k[i])
+       use(p100k[i])
+
+       use(s[ui])
+       use(a1[ui])
+       use(a1k[ui])
+       use(a100k[ui])
+       use(p1[ui])
+       use(p1k[ui])
+       use(p100k[ui])
+
+       use(s[i8])
+       use(a1[i8])
+       use(a1k[i8])
+       use(a100k[i8])
+       use(p1[i8])
+       use(p1k[i8])
+       use(p100k[i8])
+
+       // Unsigned 8-bit numbers don't need checks for len >= 2⁸.
+       use(s[ui8])
+       use(a1[ui8])
+       use(a1k[ui8])  // ERROR "index bounds check elided"
+       use(a100k[ui8])  // ERROR "index bounds check elided"
+       use(p1[ui8])
+       use(p1k[ui8])  // ERROR "index bounds check elided"
+       use(p100k[ui8])  // ERROR "index bounds check elided"
+
+       use(s[i16])
+       use(a1[i16])
+       use(a1k[i16])
+       use(a100k[i16])
+       use(p1[i16])
+       use(p1k[i16])
+       use(p100k[i16])
+
+       // Unsigned 16-bit numbers don't need checks for len >= 2¹⁶.
+       use(s[ui16])
+       use(a1[ui16])
+       use(a1k[ui16])
+       use(a100k[ui16])  // ERROR "index bounds check elided"
+       use(p1[ui16])
+       use(p1k[ui16])
+       use(p100k[ui16])  // ERROR "index bounds check elided"
+
+       use(s[i32])
+       use(a1[i32])
+       use(a1k[i32])
+       use(a100k[i32])
+       use(p1[i32])
+       use(p1k[i32])
+       use(p100k[i32])
+
+       use(s[ui32])
+       use(a1[ui32])
+       use(a1k[ui32])
+       use(a100k[ui32])
+       use(p1[ui32])
+       use(p1k[ui32])
+       use(p100k[ui32])
+
+       use(s[i64])
+       use(a1[i64])
+       use(a1k[i64])
+       use(a100k[i64])
+       use(p1[i64])
+       use(p1k[i64])
+       use(p100k[i64])
+
+       use(s[ui64])
+       use(a1[ui64])
+       use(a1k[ui64])
+       use(a100k[ui64])
+       use(p1[ui64])
+       use(p1k[ui64])
+       use(p100k[ui64])
+
+       // Mod truncates the maximum value to one less than the argument,
+       // but signed mod can be negative, so only unsigned mod counts.
+       use(s[i%999])
+       use(a1[i%999])
+       use(a1k[i%999])
+       use(a100k[i%999])
+       use(p1[i%999])
+       use(p1k[i%999])
+       use(p100k[i%999])
+
+       use(s[ui%999])
+       use(a1[ui%999])
+       use(a1k[ui%999])  // ERROR "index bounds check elided"
+       use(a100k[ui%999])  // ERROR "index bounds check elided"
+       use(p1[ui%999])
+       use(p1k[ui%999])  // ERROR "index bounds check elided"
+       use(p100k[ui%999])  // ERROR "index bounds check elided"
+
+       use(s[i%1000])
+       use(a1[i%1000])
+       use(a1k[i%1000])
+       use(a100k[i%1000])
+       use(p1[i%1000])
+       use(p1k[i%1000])
+       use(p100k[i%1000])
+
+       use(s[ui%1000])
+       use(a1[ui%1000])
+       use(a1k[ui%1000])  // ERROR "index bounds check elided"
+       use(a100k[ui%1000])  // ERROR "index bounds check elided"
+       use(p1[ui%1000])
+       use(p1k[ui%1000])  // ERROR "index bounds check elided"
+       use(p100k[ui%1000])  // ERROR "index bounds check elided"
+
+       use(s[i%1001])
+       use(a1[i%1001])
+       use(a1k[i%1001])
+       use(a100k[i%1001])
+       use(p1[i%1001])
+       use(p1k[i%1001])
+       use(p100k[i%1001])
+
+       use(s[ui%1001])
+       use(a1[ui%1001])
+       use(a1k[ui%1001])
+       use(a100k[ui%1001])  // ERROR "index bounds check elided"
+       use(p1[ui%1001])
+       use(p1k[ui%1001])
+       use(p100k[ui%1001])  // ERROR "index bounds check elided"
+
+       // Bitwise and truncates the maximum value to the mask value.
+       // The result (for a positive mask) cannot be negative, so elision
+       // applies to both signed and unsigned indexes.
+       use(s[i&999])
+       use(a1[i&999])
+       use(a1k[i&999])  // ERROR "index bounds check elided"
+       use(a100k[i&999])  // ERROR "index bounds check elided"
+       use(p1[i&999])
+       use(p1k[i&999])  // ERROR "index bounds check elided"
+       use(p100k[i&999])  // ERROR "index bounds check elided"
+
+       use(s[ui&999])
+       use(a1[ui&999])
+       use(a1k[ui&999])  // ERROR "index bounds check elided"
+       use(a100k[ui&999])  // ERROR "index bounds check elided"
+       use(p1[ui&999])
+       use(p1k[ui&999])  // ERROR "index bounds check elided"
+       use(p100k[ui&999])  // ERROR "index bounds check elided"
+
+       use(s[i&1000])
+       use(a1[i&1000])
+       use(a1k[i&1000])
+       use(a100k[i&1000])  // ERROR "index bounds check elided"
+       use(p1[i&1000])
+       use(p1k[i&1000])
+       use(p100k[i&1000])  // ERROR "index bounds check elided"
+
+       use(s[ui&1000])
+       use(a1[ui&1000])
+       use(a1k[ui&1000])
+       use(a100k[ui&1000])  // ERROR "index bounds check elided"
+       use(p1[ui&1000])
+       use(p1k[ui&1000])
+       use(p100k[ui&1000])  // ERROR "index bounds check elided"
+
+       // Right shift cuts the effective number of bits in the index,
+       // but only for unsigned (signed stays negative).
+       use(s[i32>>22])
+       use(a1[i32>>22])
+       use(a1k[i32>>22])
+       use(a100k[i32>>22])
+       use(p1[i32>>22])
+       use(p1k[i32>>22])
+       use(p100k[i32>>22])
+
+       use(s[ui32>>22])
+       use(a1[ui32>>22])
+       use(a1k[ui32>>22])
+       use(a100k[ui32>>22])  // ERROR "index bounds check elided"
+       use(p1[ui32>>22])
+       use(p1k[ui32>>22])
+       use(p100k[ui32>>22])  // ERROR "index bounds check elided"
+
+       use(s[i32>>23])
+       use(a1[i32>>23])
+       use(a1k[i32>>23])
+       use(a100k[i32>>23])
+       use(p1[i32>>23])
+       use(p1k[i32>>23])
+       use(p100k[i32>>23])
+
+       use(s[ui32>>23])
+       use(a1[ui32>>23])
+       use(a1k[ui32>>23])  // ERROR "index bounds check elided"
+       use(a100k[ui32>>23])  // ERROR "index bounds check elided"
+       use(p1[ui32>>23])
+       use(p1k[ui32>>23])  // ERROR "index bounds check elided"
+       use(p100k[ui32>>23])  // ERROR "index bounds check elided"
+
+       // Division cuts the range like right shift does.
+       use(s[i/1e6])
+       use(a1[i/1e6])
+       use(a1k[i/1e6])
+       use(a100k[i/1e6])
+       use(p1[i/1e6])
+       use(p1k[i/1e6])
+       use(p100k[i/1e6])
+
+       use(s[ui/1e6])
+       use(a1[ui/1e6])
+       use(a1k[ui/1e6])
+       use(p1[ui/1e6])
+       use(p1k[ui/1e6])
+
+       use(s[i/1e7])
+       use(a1[i/1e7])
+       use(a1k[i/1e7])
+       use(a100k[i/1e7])
+       use(p1[i/1e7])
+       use(p1k[i/1e7])
+       use(p100k[i/1e7])
+
+       use(s[ui/1e7])
+       use(a1[ui/1e7])
+       use(p1[ui/1e7])
+}
+
+var sum int 
+
+func use(x int) {
+       sum += x
+}
index adf74497cde7a9bb5fa2f6cecd7aba0f9da20e25..4632dcd0f7906a483044f428590337b90c66aca9 100644 (file)
@@ -1,6 +1,9 @@
 // echo bug395 is broken  # takes 90+ seconds to break
 // # $G $D/$F.go || echo bug395
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
diff --git a/gcc/testsuite/go.test/test/bugs/bug434.dir/one.go b/gcc/testsuite/go.test/test/bugs/bug434.dir/one.go
new file mode 100644 (file)
index 0000000..491ada1
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+// Issue 3552
+
+type T struct { int }
+
+func (t T) F() int { return t.int }
+
+type U struct { int int }
+
+func (u U) F() int { return u.int }
+
+type lint int
+
+type V struct { lint }
+
+func (v V) F() int { return int(v.lint) }
+
+type W struct { lint lint }
+
+func (w W) F() int { return int(w.lint) }
+
+
+
diff --git a/gcc/testsuite/go.test/test/bugs/bug434.dir/two.go b/gcc/testsuite/go.test/test/bugs/bug434.dir/two.go
new file mode 100644 (file)
index 0000000..1366d24
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+       var t one.T
+       var u one.U
+       var v one.V
+       var w one.W
+
+       _ = t.F()
+       _ = u.F()
+       _ = v.F()
+       _ = w.F()
+}
diff --git a/gcc/testsuite/go.test/test/bugs/bug434.go b/gcc/testsuite/go.test/test/bugs/bug434.go
new file mode 100644 (file)
index 0000000..5eec7a5
--- /dev/null
@@ -0,0 +1,10 @@
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go || echo BUG:bug434
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
index f8d50c90c0f5c7dc60f275622c527e1855286015..ac559302d9bfef215aa33b430ada0adc1c010b2c 100644 (file)
@@ -1,11 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// This test is designed to flush out the case where two cases of a select can
+// Test the situation in which two cases of a select can
 // both end up running. See http://codereview.appspot.com/180068.
+
 package main
 
 import (
index 0dddfcaa0bddf78862d24a581bbfee46d7597736..70d20b31f098ee0f5f629c10fbd7ac93b9e2afad 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify that unbuffered channels act as pure fifos.
+// Test that unbuffered channels act as pure fifos.
 
 package main
 
index 371a1738766a2e4f22695769107130737c509cf4..6ffae7df65f45406b423113de7d5817fc00b808a 100644 (file)
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// make a lot of goroutines, threaded together.
-// tear them down cleanly.
+// Torture test for goroutines.
+// Make a lot of goroutines, threaded together, and tear them down cleanly.
 
 package main
 
index 9addf12e99ac7af30fd8b15b7e1d5eba472cdc4a..7e3c0c74daec7568d6d1b6ee4f3ca2d785e5fcb7 100644 (file)
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify channel operations that test for blocking
-// Use several sizes and types of operands
+// Test channel operations that test for blocking.
+// Use several sizes and types of operands.
 
 package main
 
index a43df198214b21d5b8dfa16e764e1a8435f4767f..7e152c5eb5a2f51d896d4c94706780947dd92861 100644 (file)
@@ -1,9 +1,13 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test various correct and incorrect permutations of send-only,
+// receive-only, and bidirectional channels.
+// Does not compile.
+
 package main
 
 var (
index dc4ff53255d5f69b72478db8af50d05bd4cb7bc9..6bf2a911157d1a73ee2116994fd2571ec01c0dff 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
index bc329270dbce05cf097bb9a6c43c97fdeb14f131..33abd5c53fe7b2378274d4939d0aea2951241e28 100644 (file)
@@ -1,18 +1,21 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
+// Like powser1.go but uses channels of interfaces.
+// Has not been cleaned up as much as powser1.go, to keep
+// it distinct and therefore a different test.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
 // Original code in Newsqueak by Doug McIlroy.
 // See Squinting at Power Series by Doug McIlroy,
 //   http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf
-// Like powser1.go but uses channels of interfaces.
-// Has not been cleaned up as much as powser1.go, to keep
-// it distinct and therefore a different test.
 
 package main
 
index be4eb3f42d6fe1cfb6822e241fa9971865995ed7..38fa7e1e3f8708c0871402def9778e43f93928b5 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple select.
+
 package main
 
 var counter uint
index 2cbb86ec626c72390965b8e2db8405368608028b..40bc357b5d715e652be55692bc1d70f2d0939bd1 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that selects do not consume undue memory.
+
 package main
 
 import "runtime"
index d919de3e0d957eefbb15ca0850fed94cd1d3e6a7..847d8ed37ed25a4c06db3188f063b5fb808867e7 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Tests verifying the semantics of the select statement
+// Test the semantics of the select statement
 // for basic empty/non-empty cases.
 
 package main
@@ -197,13 +197,13 @@ func main() {
        })
        testBlock(never, func() {
                select {
-               case x := <-closedch:
+               case x := (<-closedch):
                        _ = x
                }
        })
        testBlock(never, func() {
                select {
-               case x, ok := <-closedch:
+               case x, ok := (<-closedch):
                        _, _ = x, ok
                }
        })
index 46618ac881235978c00ef1f6dd49030a81677efb..500364038566baba9a65f953a01dabde30171212 100644 (file)
@@ -1,4 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
+
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
+// Test that a select statement proceeds when a value is ready.
 
 package main
 
index cc2cc71000ef1171e8d6faba947d1714258006e1..f72cfe4b461c2eee647ff4370b06af87d899288c 100644 (file)
@@ -1,13 +1,14 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go &&
-// $G tmp.go && $L tmp.$A && ./$A.out || echo BUG: select5
-// rm -f tmp.go
+// runoutput
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
 // Generate test of channel operations and simple selects.
-// Only doing one real send or receive at a time, but phrased
+// The output of this program is compiled and run to do the
+// actual test.
+
+// Each test does only one real send or receive at a time, but phrased
 // in various ways that the compiler may or may not rewrite
 // into simpler expressions.
 
index 2ba6810ac3476194f7177286bb4181f6afeadda5..af470a0d0d187fcc5ac237118c7b8a98ab6b8ce6 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Issue 2075
+// Test for select: Issue 2075
 // A bug in select corrupts channel queues of failed cases
 // if there are multiple waiters on those channels and the
 // select is the last in the queue. If further waits are made
index 5fed6cbd426fa79d74a29fbd69150ab14fff1f30..20456a9d62ec755867e2172ac0c5c954903a70e0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ee6f765cf88324152ea7a3c50618bf460afaf40b..a92c4f63a7af85f96e2ed617282a7490f3daba0c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 55076c9253c6aaceb304d0e52b763f9e37664502..acc310f6c79ae6ce958b656663d7184aeff0dbe5 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: classical inefficient concurrent prime sieve.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve consists of a linear chain of divisibility filters,
 // equivalent to trial-dividing each n by all primes p ≤ n.
index 9a7ab15406c54001810b452e4e4a98975b2f7bd9..09e5c527b6cca9c3c59f05676c1732d3fb5a0132 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: prime sieve of Eratosthenes.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve is Eratosthenesque and only considers odd candidates.
 // See discussion at <http://blog.onideas.ws/eratosthenes.go>.
index 617c9dab3416e45af7dd8665277277f7e8209b3e..50aca857cbed5f049c6ea6176d691da8caaae7ce 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Making channels of a zero-sized type should not panic.
+// Test making channels of a zero-sized type.
 
 package main
 
index 3f3789fbcc08f93ef7dedeeb2ac235b3b7b6df30..b3e40233f5b29a9a9ff60bfd43e55ac74312facc 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the cap predeclared function applied to channels.
+
 package main
 
 func main() {
index 99be77a570e9fae8b52a24e2263b81110f7c10eb..836c3c1a2d0b0de309abe4b8a6ffa0aabc85668a 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A &&./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test character literal syntax.
+
 package main
 
 import "os"
index dc5385291d0c108e853698c41773588bdcc3e992..489744b6e9888c733d05fa84baa34bbce2f48a1e 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal character literals are detected.
+// Does not compile.
+
 package main
 
 const (
index c2bbec59d95be91f6cb04b5157dacc658ee272b9..043a92d3880e83fb8aef11cc358bf1e49d02a7ab 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 97da1dd23045d6d65393c40251e2fa0a73410782..c4a312464bcf4e130143941e67421b1a1615fa94 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the behavior of closures.
+
 package main
 
 import "runtime"
@@ -79,6 +81,7 @@ func h() {
 func newfunc() func(int) int { return func(x int) int { return x } }
 
 func main() {
+       runtime.GOMAXPROCS(1)
        var fail bool
 
        go f()
@@ -92,8 +95,9 @@ func main() {
        go h()
        check([]int{100, 200, 101, 201, 500, 101, 201, 500})
 
-       runtime.UpdateMemStats()
-        n0 := runtime.MemStats.Mallocs
+       memstats := new(runtime.MemStats)
+       runtime.ReadMemStats(memstats)
+       n0 := memstats.Mallocs
 
        x, y := newfunc(), newfunc()
        if x(1) != 1 || y(2) != 2 {
@@ -101,8 +105,8 @@ func main() {
                fail = true
        }
 
-       runtime.UpdateMemStats()
-        if n0 != runtime.MemStats.Mallocs {
+       runtime.ReadMemStats(memstats)
+       if n0 != memstats.Mallocs {
                println("newfunc allocated unexpectedly")
                fail = true
        }
@@ -110,7 +114,7 @@ func main() {
        ff(1)
 
        if fail {
-               panic("fail") 
+               panic("fail")
        }
 }
 
index d51a11aa2462e22200e8b6cbb6fdd45977a0c3ae..a56ca6eadddc2732dbf3245a51980c3f4e33e9a3 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test equality and inequality operations.
+
 package main
 
 import "unsafe"
@@ -281,6 +283,25 @@ func main() {
                isfalse(ix != z)
                isfalse(iz != x)
        }
+       
+       // structs with _ fields
+       {
+               var x = struct {
+                       x int
+                       _ []int
+                       y float64
+                       _ float64
+                       z int
+               }{
+                       x: 1, y: 2, z: 3,
+               }
+               var ix interface{} = x
+               
+               istrue(x == x)
+               istrue(x == ix)
+               istrue(ix == x)
+               istrue(ix == ix)
+       }
 
        // arrays
        {
index 0113a69ddb8d3439e88c3627b0bab5fabc4adfeb..7d99aae18b322ac4ca889e8d91492b3aefc08436 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that incorrect comparisons are detected.
+// Does not compile.
+
 package main
 
 func use(bool) {}
@@ -15,6 +18,10 @@ type T3 struct{ z []int }
 
 var t3 T3
 
+type T4 struct { _ []int; a float64 }
+
+var t4 T4
+
 func main() {
        // Arguments to comparison must be
        // assignable one to the other (or vice versa)
@@ -46,6 +53,7 @@ func main() {
 
        // Comparison of structs should have a good message
        use(t3 == t3) // ERROR "struct|expected"
+       use(t4 == t4) // ok; the []int is a blank field
 
        // Slices, functions, and maps too.
        var x []int
index d5a77d684a7d08b6d2057e05bb17a1ac7cca3d6f..248672e7dd5076dda87a359fad00338e39149f74 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that incorrect invocations of the complex predeclared function are detected.
+// Does not compile.
+
 package main
 
 var (
index b340f04d8873c5082711a811975cd155b73e1d26..12dc4f1c0c914c3293a5604083c5d4c56c67054f 100644 (file)
@@ -51,6 +51,7 @@ main(void)
        int i, j, k, l;
        double complex n, d, q;
        
+       printf("// skip\n");
        printf("// # generated by cmplxdivide.c\n");
        printf("\n");
        printf("package main\n");
index 461ee9796ed384631bd55c37b922601aa7830082..92a98356d0a518469064a9156257ff1bcc7c090c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go $D/cmplxdivide1.go && $L $D/$F.$A && ./$A.out
+// run cmplxdivide1.go
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6a1dee9fe784cda31c5417e092932c7f7d60d3de..e9031dd15143248b5857d4a891dde0800a1d6596 100644 (file)
@@ -1,3 +1,4 @@
+// skip
 // # generated by cmplxdivide.c
 
 package main
index 8dfc71dcb47ab5bc138585f039d66aa453461be4..649be6d4d39ce02c2c4a8954680825a7f2ac00ed 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test composite literals.
+
 package main
 
 type T struct {
index cd543930eef7ef1f264bfce9aea9bd9d83e68c81..521401d73936c9a78bcc7518bb76e91893cea847 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal composite literals are detected.
+// Does not compile.
+
 package main
 
 var m map[int][3]int
index 70f90f37945a3047084a095b6f3ccfabee714ef8..de688b39bb60c146ca3f70cc990963fed7ddd058 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: compos
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that returning &T{} from a function causes an allocation.
+
 package main
 
 type T struct {
index a55e13a40de1f2143190b7fc6da5430ce1802850..80fbfaf3ea0b2e3b46e6bced8329a1c8cd850e85 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple boolean and numeric constants.
+
 package main
 
 const (
index 67f36e4fdc94816f61947e8e0d2959546a778501..1580b76c68374f1582171ddc5246cf68be890953 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify overflow is detected when using numeric constants.
+// Does not compile.
+
 package main
 
 type I interface{}
@@ -13,11 +16,11 @@ const (
        Int8   int8  = 101
        Minus1 int8  = -1
        Uint8  uint8 = 102
-       Const  = 103
+       Const        = 103
 
        Float32    float32 = 104.5
        Float64    float64 = 105.5
-       ConstFloat = 106.5
+       ConstFloat         = 106.5
        Big        float64 = 1e300
 
        String = "abc"
@@ -35,32 +38,35 @@ var (
        a8 = Int8 * Const / 100      // ERROR "overflow"
        a9 = Int8 * (Const / 100)    // OK
 
-       b1   = Uint8 * Uint8                                 // ERROR "overflow"
-       b2   = Uint8 * -1                                    // ERROR "overflow"
-       b3   = Uint8 - Uint8                                 // OK
-       b4   = Uint8 - Uint8 - Uint8                         // ERROR "overflow"
-       b5   = uint8(^0)                                     // ERROR "overflow"
-       b6   = ^uint8(0)                                     // OK
-       b7   = uint8(Minus1)                                 // ERROR "overflow"
-       b8   = uint8(int8(-1))                               // ERROR "overflow"
-       b8a  = uint8(-1)                                     // ERROR "overflow"
-       b9   byte                    = (1 << 10) >> 8        // OK
-       b10  byte                    = (1 << 10)             // ERROR "overflow"
-       b11  byte                    = (byte(1) << 10) >> 8  // ERROR "overflow"
-       b12  byte                    = 1000                  // ERROR "overflow"
-       b13  byte                    = byte(1000)            // ERROR "overflow"
-       b14  byte                    = byte(100) * byte(100) // ERROR "overflow"
-       b15  byte                    = byte(100) * 100       // ERROR "overflow"
-       b16  byte                    = byte(0) * 1000        // ERROR "overflow"
-       b16a byte                    = 0 * 1000              // OK
-       b17  byte                    = byte(0) * byte(1000)  // ERROR "overflow"
-       b18  byte                    = Uint8 / 0             // ERROR "division by zero"
+       b1        = Uint8 * Uint8         // ERROR "overflow"
+       b2        = Uint8 * -1            // ERROR "overflow"
+       b3        = Uint8 - Uint8         // OK
+       b4        = Uint8 - Uint8 - Uint8 // ERROR "overflow"
+       b5        = uint8(^0)             // ERROR "overflow"
+       b5a       = int64(^0)             // OK
+       b6        = ^uint8(0)             // OK
+       b6a       = ^int64(0)             // OK
+       b7        = uint8(Minus1)         // ERROR "overflow"
+       b8        = uint8(int8(-1))       // ERROR "overflow"
+       b8a       = uint8(-1)             // ERROR "overflow"
+       b9   byte = (1 << 10) >> 8        // OK
+       b10  byte = (1 << 10)             // ERROR "overflow"
+       b11  byte = (byte(1) << 10) >> 8  // ERROR "overflow"
+       b12  byte = 1000                  // ERROR "overflow"
+       b13  byte = byte(1000)            // ERROR "overflow"
+       b14  byte = byte(100) * byte(100) // ERROR "overflow"
+       b15  byte = byte(100) * 100       // ERROR "overflow"
+       b16  byte = byte(0) * 1000        // ERROR "overflow"
+       b16a byte = 0 * 1000              // OK
+       b17  byte = byte(0) * byte(1000)  // ERROR "overflow"
+       b18  byte = Uint8 / 0             // ERROR "division by zero"
 
-       c1 float64     = Big
-       c2 float64     = Big * Big          // ERROR "overflow"
-       c3 float64     = float64(Big) * Big // ERROR "overflow"
-       c4 = Big * Big                      // ERROR "overflow"
-       c5 = Big / 0                        // ERROR "division by zero"
+       c1 float64 = Big
+       c2 float64 = Big * Big          // ERROR "overflow"
+       c3 float64 = float64(Big) * Big // ERROR "overflow"
+       c4         = Big * Big          // ERROR "overflow"
+       c5         = Big / 0            // ERROR "division by zero"
+       c6         = 1000 % 1e3         // ERROR "floating-point % operation|expected integer type"
 )
 
 func f(int)
index bea1b991254423bb37f171bc7d69de6a5f7d2be2..048d0cb9f397634791841763e9de764967342918 100644 (file)
@@ -1,12 +1,21 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that large integer constant expressions cause overflow.
+// Does not compile.
+
 package main
 
 const (
        A int = 1
        B byte; // ERROR "type without expr|expected .=."
 )
+
+const LargeA = 1000000000000000000
+const LargeB = LargeA * LargeA * LargeA
+const LargeC = LargeB * LargeB * LargeB // GC_ERROR "constant multiplication overflow"
+
+const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // GC_ERROR "constant shift overflow"
index 9bba6ced0b8bd109d02cfba5035302cc10475d3c..3f4e3d1ae6fa9adf095afe91e176daa3708fe86b 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test typed integer constants.
+
 package main
 
 import "fmt"
diff --git a/gcc/testsuite/go.test/test/const4.go b/gcc/testsuite/go.test/test/const4.go
new file mode 100644 (file)
index 0000000..677fcef
--- /dev/null
@@ -0,0 +1,77 @@
+// run
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test len constants and non-constants, http://golang.org/issue/3244.
+
+package main
+
+var b struct {
+       a[10]int
+}
+
+var m map[string][20]int
+
+var s [][30]int
+
+const (
+       n1 = len(b.a)
+       n2 = len(m[""])
+       n3 = len(s[10])
+)
+
+// Non-constants (see also const5.go).
+var (
+       n4 = len(f())
+       n5 = len(<-c)
+       n6 = cap(g())
+       n7 = cap(<-c1)
+)
+
+var calledF = false
+
+func f() *[40]int {
+       calledF = true
+       return nil
+}
+
+var c = func() chan *[50]int {
+       c := make(chan *[50]int, 2)
+       c <- nil
+       c <- new([50]int)
+       return c
+}()
+
+var calledG = false
+
+func g() *[60]int {
+       calledG = true
+       return nil
+}
+
+var c1 = func() chan *[70]int {
+       c := make(chan *[70]int, 2)
+       c <- nil
+       c <- new([70]int)
+       return c
+}()
+
+func main() {
+       if n1 != 10 || n2 != 20 || n3 != 30 || n4 != 40 || n5 != 50 || n6 != 60 || n7 != 70 {
+               println("BUG:", n1, n2, n3, n4, n5, n6, n7)
+       }
+       if !calledF {
+               println("BUG: did not call f")
+       }
+       if <-c == nil {
+               println("BUG: did not receive from c")
+       }
+       if !calledG {
+               println("BUG: did not call g")
+       }
+       if <-c1 == nil {
+               println("BUG: did not receive from c1")
+       }
+}
diff --git a/gcc/testsuite/go.test/test/const5.go b/gcc/testsuite/go.test/test/const5.go
new file mode 100644 (file)
index 0000000..d0eed13
--- /dev/null
@@ -0,0 +1,33 @@
+// errorcheck
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that len non-constants are not constants, http://golang.org/issue/3244.
+
+package p
+
+var b struct {
+       a[10]int
+}
+
+var m map[string][20]int
+
+var s [][30]int
+
+func f() *[40]int
+var c chan *[50]int
+
+const (
+       n1 = len(b.a)
+       n2 = len(m[""])
+       n3 = len(s[10])
+
+       n4 = len(f())  // ERROR "must be constant|is not constant"
+       n5 = len(<-c) // ERROR "must be constant|is not constant"
+
+       n6 = cap(f())  // ERROR "must be constant|is not constant"
+       n7 = cap(<-c) // ERROR "must be constant|is not constant"
+)
+
diff --git a/gcc/testsuite/go.test/test/convT2X.go b/gcc/testsuite/go.test/test/convT2X.go
new file mode 100644 (file)
index 0000000..7e27f06
--- /dev/null
@@ -0,0 +1,195 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test conversion from non-interface types to the empty interface.
+
+package main
+
+type J interface {
+       Method()
+}
+
+type (
+       U16  uint16
+       U32  uint32
+       U64  uint64
+       U128 [2]uint64
+       F32  float32
+       F64  float64
+       C128 complex128
+       S    string
+       B    []byte
+       M    map[int]int
+       C    chan int
+       Z    struct{}
+)
+
+func (U16) Method()  {}
+func (U32) Method()  {}
+func (U64) Method()  {}
+func (U128) Method() {}
+func (F32) Method()  {}
+func (F64) Method()  {}
+func (C128) Method() {}
+func (S) Method()    {}
+func (B) Method()    {}
+func (M) Method()    {}
+func (C) Method()    {}
+func (Z) Method()    {}
+
+var (
+       u16  = U16(1)
+       u32  = U32(2)
+       u64  = U64(3)
+       u128 = U128{4, 5}
+       f32  = F32(6)
+       f64  = F64(7)
+       c128 = C128(8 + 9i)
+       s    = S("10")
+       b    = B("11")
+       m    = M{12: 13}
+       c    = make(C, 14)
+       z    = Z{}
+       p    = &z
+       pp   = &p
+)
+
+var (
+       iu16  interface{} = u16
+       iu32  interface{} = u32
+       iu64  interface{} = u64
+       iu128 interface{} = u128
+       if32  interface{} = f32
+       if64  interface{} = f64
+       ic128 interface{} = c128
+       is    interface{} = s
+       ib    interface{} = b
+       im    interface{} = m
+       ic    interface{} = c
+       iz    interface{} = z
+       ip    interface{} = p
+       ipp   interface{} = pp
+
+       ju16  J = u16
+       ju32  J = u32
+       ju64  J = u64
+       ju128 J = u128
+       jf32  J = f32
+       jf64  J = f64
+       jc128 J = c128
+       js    J = s
+       jb    J = b
+       jm    J = m
+       jc    J = c
+       jz J = z
+       jp J = p // The method set for *T contains the methods for T.
+       // pp does not implement error.
+)
+
+func second(a ...interface{}) interface{} {
+       return a[1]
+}
+
+func main() {
+       // Test equality.
+       if u16 != iu16 {
+               panic("u16 != iu16")
+       }
+       if u16 != ju16 {
+               panic("u16 != ju16")
+       }
+       if u32 != iu32 {
+               panic("u32 != iu32")
+       }
+       if u32 != ju32 {
+               panic("u32 != ju32")
+       }
+       if u64 != iu64 {
+               panic("u64 != iu64")
+       }
+       if u64 != ju64 {
+               panic("u64 != ju64")
+       }
+       if u128 != iu128 {
+               panic("u128 != iu128")
+       }
+       if u128 != ju128 {
+               panic("u128 != ju128")
+       }
+       if f32 != if32 {
+               panic("f32 != if32")
+       }
+       if f32 != jf32 {
+               panic("f32 != jf32")
+       }
+       if f64 != if64 {
+               panic("f64 != if64")
+       }
+       if f64 != jf64 {
+               panic("f64 != jf64")
+       }
+       if c128 != ic128 {
+               panic("c128 != ic128")
+       }
+       if c128 != jc128 {
+               panic("c128 != jc128")
+       }
+       if s != is {
+               panic("s != is")
+       }
+       if s != js {
+               panic("s != js")
+       }
+       if c != ic {
+               panic("c != ic")
+       }
+       if c != jc {
+               panic("c != jc")
+       }
+       // There are no tests for b and m, as slices and maps are not comparable by ==.
+       if z != iz {
+               panic("z != iz")
+       }
+       if z != jz {
+               panic("z != jz")
+       }
+       if p != ip {
+               panic("p != ip")
+       }
+       if p != jp {
+               panic("p != jp")
+       }
+       if pp != ipp {
+               panic("pp != ipp")
+       }
+       // pp does not implement J.
+
+       // Test that non-interface types can be used as ...interface{} arguments.
+       if got := second(z, p, pp, u16, u32, u64, u128, f32, f64, c128, s, b, m, c); got != ip {
+               println("second: got", got, "want", ip)
+               panic("fail")
+       }
+
+       // Test that non-interface types can be sent on a chan interface{}.
+       const n = 100
+       uc := make(chan interface{})
+       go func() {
+               for i := 0; i < n; i++ {
+                       select {
+                       case uc <- nil:
+                       case uc <- u32:
+                       case uc <- u64:
+                       case uc <- u128:
+                       }
+               }
+       }()
+       for i := 0; i < n; i++ {
+               if got := <-uc; got != nil && got != u32 && got != u64 && got != u128 {
+                       println("recv: i", i, "got", got)
+                       panic("fail")
+               }
+       }
+}
index 0a75663d0647f58ace06f60a1fc76c252939da4e..7280edf333cdc841b3d762d68a5684b66f6a0c3d 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test types of constant expressions, using reflect.
+
 package main
 
 import "reflect"
index bbd0c5f2b06364cde6112645571aee732be79178..0f417a33804e3db4e787b2065e308583d5bf32ba 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal conversions involving strings are detected.
+// Does not compile.
+
 package main
 
 type Tbyte []byte
index be68c95b36207e4278ebbde3e3045efb1f127eb4..143aff04f6a472e7bb2728208ad30e4b1d93ac55 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify allowed and disallowed conversions.
+// Does not compile.
+
 package main
 
 // everything here is legal except the ERROR line
index 1e82d1f2f561ebc60ac903066a4fb87795df8381..8a6145d2a0bed8cc6623f5f79aa773df26a16f6c 100644 (file)
@@ -1,14 +1,15 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal assignments with both explicit and implicit conversions of literals are detected.
+// Does not compile.
+
 package main
 
-// explicit conversion of constants is work in progress.
-// the ERRORs in this block are debatable, but they're what
-// the language spec says for now.
+// explicit conversion of constants
 var x1 = string(1)
 var x2 string = string(1)
 var x3 = int(1.5)     // ERROR "convert|truncate"
index 1e6673cb641b9742a5f46f1a3f4bf559f3f7e606..c06bd74438373a92a900b3273dbd3a369a0f611a 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal uses of composite literals are detected.
+// Does not compile.
+
 package main
 
 var a = []int { "a" }; // ERROR "conver|incompatible|cannot"
index 0b5bddbed5c44a66fd6d06c73abc09adf44ea26b..65ffb6ff8f5d573c84830a160f6d4ebeaeab0e79 100644 (file)
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Semi-exhaustive test for copy()
+// Semi-exhaustive test for the copy predeclared function.
 
 package main
 
index 292b63bf4b33bc6d6ff42a519ec8bf2993fd1069..2d56889b039abe6927d20f824616414997c782eb 100644 (file)
@@ -1,6 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go &&
-// $G tmp.go && $L tmp.$A && ./$A.out
-// rm -f tmp.go
+// runoutput
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b95d6e883f9786446480339be4df0119922ccdd2..01768b89f3be7c9139754920cfe73da4c4284e39 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test variadic functions and calls (dot-dot-dot).
+
 package main
 
 func sum(args ...int) int {
@@ -58,6 +60,10 @@ type U struct {
        *T
 }
 
+type I interface {
+       Sum(...int) int
+}
+
 func main() {
        if x := sum(1, 2, 3); x != 6 {
                println("sum 6", x)
@@ -205,7 +211,14 @@ func main() {
                println("i(=u).Sum", x)
                panic("fail")
        }
-       /* TODO(rsc): Enable once nested method expressions work.
+       var s struct {
+               I
+       }
+       s.I = &u
+       if x := s.Sum(2, 3, 5, 8); x != 18 {
+               println("s{&u}.Sum", x)
+               panic("fail")
+       }
        if x := (*U).Sum(&U{}, 1, 3, 5, 2); x != 11 {
                println("(*U).Sum", x)
                panic("fail")
@@ -214,5 +227,4 @@ func main() {
                println("U.Sum", x)
                panic("fail")
        }
-       */
 }
index 6d84248e5e800e9b322e046a24007a87cb6cc8f9..07981af126acfe3544aeb9eaa782263d9094e95d 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal uses of ... are detected.
+// Does not compile.
+
 package main
 
 import "unsafe"
@@ -19,6 +22,16 @@ var (
        _ = sum([]int{1}) // ERROR "\[\]int literal.*as type int|incompatible"
 )
 
+func sum3(int, int, int) int { return 0 }
+func tuple() (int, int, int) { return 1, 2, 3 }
+
+var (
+       _ = sum(tuple())
+       _ = sum(tuple()...) // ERROR "multiple-value|[.][.][.]"
+       _ = sum3(tuple())
+       _ = sum3(tuple()...) // ERROR "multiple-value|[.][.][.]" "not enough"
+)
+
 type T []T
 
 func funny(args ...T) int { return 0 }
index a06af0c06578725dc697cddefdf4c715a67202a9..a141a39c7667a53b59ec275f944c3eae840a8b1d 100644 (file)
@@ -1,9 +1,11 @@
-// true
+// skip
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// This file is compiled and then imported by ddd3.go.
+
 package ddd
 
 func Sum(args ...int) int {
index 5d5ebdf0faea9741981d201bba8e5b7ef0b08186..d8de0a77e903abba31c6041427044df3eb56d49b 100644 (file)
@@ -1,9 +1,14 @@
 // $G $D/ddd2.go && $G $D/$F.go && $L $F.$A && ./$A.out
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that variadic functions work across package boundaries.
+
 package main
 
 import "./ddd2"
index 95b6346c3edfa9188d0889b0c091279793c55ce9..6f84245f1522de0e6602179f1e6eb9cf86dfb58c 100644 (file)
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Correct short declarations and redeclarations.
+// Test correct short declarations and redeclarations.
 
 package main
 
index 09f1dfb576fe2334c1d06c8af3c6f4358c3c18b9..ff53ab0d7c5a6627d7c3d3c87c8951156cccdc93 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Incorrect short declarations and redeclarations.
+// Test that incorrect short declarations and redeclarations are detected.
+// Does not compile.
 
 package main
 
@@ -37,6 +38,13 @@ func main() {
                i, f := f2() // ERROR "redeclared|no new"
                _, _, _ = i, f, s
        }
+       {
+               // multiline no new variables
+               i := f1
+               i := func() { // ERROR "redeclared|no new|incompatible"
+               }
+               _ = i
+       }
        {
                // single redeclaration
                i, f, s := f3()
index bef8fbe26a6cd7a187269933acdfd84050296a28..2f67d356091fc650201e0a4b2f300d6b74d9bd15 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test defer.
+
 package main
 
 import "fmt"
index 0e0c618216809f40df15c9948550b6eaed7bee55..72c98b19fc960246cce7426bf875f1656b9f9ad7 100644 (file)
@@ -1,14 +1,17 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that we can defer the predeclared functions print and println.
+
 package main
 
 func main() {
        defer println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255))
        defer println(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
-//     defer panic("dead")
+       // Disabled so the test doesn't crash but left here for reference.
+       // defer panic("dead")
        defer print("printing: ")
 }
index 5c0f45059a2bf8c02de9aef2741399611dae4ef7..c91a33e9db283829519ecf50315f04b9b8995582 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// divide corner cases
+// Test divide corner cases.
 
 package main
 
index 68434f0ab57ed37b2ee6e03300d51704ec724bc0..cc4ffb000fd4f9081b97ace402b0b42abbcbd404 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7f2ec4c00a6862922625ea45b27e238ef05d591c..175a09c7799734082fe0c69d704d40558f1eb952 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.go $D/z*.go && $L $F.$A && ./$A.out
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index fa10d6931d9286362fc6ae7fbf1e36f5e3a14883..92a79a4e0d802d184f1b066d0a142a455e805e2f 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that top-level parenthesized declarations can be empty.
+// Compiles but does not run.
+
 package P
 
 import ( )
index 3c8e4232838e017faaf17d2c6a0f613cb9907369..972374679ac83d387bb97dfe3f0a714e14ba3830 100644 (file)
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 81f9fd028ff73c3cd32d42be2186367f64b08ce8..06c779046b668fc75ca21bbbdb7519e22b1aa4e7 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test a source file does not need a final newline.
+// Compiles but does not run.
+
 // No newline at the end of this file.
 
 package main
\ No newline at end of file
index c39a3cfdb15987a11707c7fa912e896f9b6ca7f9..2105b89080bad9e03ae1d6c4e3d97f2873276ef7 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+// Test that a comment ending a source file does not need a final newline.
+// Compiles but does not run.
+
+package eof1
 
 // No newline at the end of this comment.
\ No newline at end of file
index d4d844704efc6137934672b1ab62dd1ec4e51750..e8ede52760aa4b6418b3585a0278ce1d27142f02 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,8 +6,8 @@
 
 package main
 
-// check for correct heap-moving of escaped variables.
-// it is hard to check for the allocations, but it is easy
+// Test for correct heap-moving of escaped variables.
+// It is hard to check for the allocations, but it is easy
 // to check that if you call the function twice at the
 // same stack level, the pointers returned should be
 // different.
@@ -18,15 +18,15 @@ var allptr = make([]*int, 0, 100)
 
 func noalias(p, q *int, s string) {
        n := len(allptr)
-       *p = -(n+1)
-       *q = -(n+2)
-       allptr = allptr[0:n+2]
+       *p = -(n + 1)
+       *q = -(n + 2)
+       allptr = allptr[0 : n+2]
        allptr[n] = p
        allptr[n+1] = q
        n += 2
        for i := 0; i < n; i++ {
                if allptr[i] != nil && *allptr[i] != -(i+1) {
-                       println("aliased pointers", -(i+1), *allptr[i], "after", s)
+                       println("aliased pointers", -(i + 1), *allptr[i], "after", s)
                        allptr[i] = nil
                        bad = true
                }
@@ -141,15 +141,27 @@ func for_escapes2(x int, y int) (*int, *int) {
        return p[0], p[1]
 }
 
+func for_escapes3(x int, y int) (*int, *int) {
+       var f [2]func() *int
+       n := 0
+       for i := x; n < 2; i = y {
+               p := new(int)
+               *p = i
+               f[n] = func() *int { return p }
+               n++
+       }
+       return f[0](), f[1]()
+}
+
 func out_escapes(i int) (x int, p *int) {
        x = i
-       p = &x  // ERROR "address of out parameter"
+       p = &x // ERROR "address of out parameter"
        return
 }
 
 func out_escapes_2(i int) (x int, p *int) {
        x = i
-       return x, &x    // ERROR "address of out parameter"
+       return x, &x // ERROR "address of out parameter"
 }
 
 func defer1(i int) (x int) {
@@ -187,6 +199,9 @@ func main() {
        p, q = for_escapes2(103, 104)
        chkalias(p, q, 103, "for_escapes2")
 
+       p, q = for_escapes3(105, 106)
+       chk(p, q, 105, "for_escapes3")
+
        _, p = out_escapes(15)
        _, q = out_escapes(16)
        chk(p, q, 15, "out_escapes")
index 73b2a7e58973eb73377e19da9d1596cd56336680..8db12d99131f77862e1dec65195eff60a8eca12e 100644 (file)
@@ -1,9 +1,12 @@
-// errchk -0 $G -m -l $D/$F.go
+// errorcheck -0 -m -l
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test, using compiler diagnostic flags, that the escape analysis is working.
+// Compiles but does not run.  Inlining is disabled.
+
 package foo
 
 import (
@@ -537,6 +540,19 @@ func foo74() {
        }
 }
 
+// issue 3975
+func foo74b() {
+       var array [3]func()
+       s := []int{3, 2, 1} // ERROR "\[\]int literal does not escape"
+       for i, v := range s {
+               vv := v // ERROR "moved to heap: vv"
+               // actually just escapes its scope
+               array[i] = func() { // ERROR "func literal escapes to heap"
+                       println(vv) // ERROR "&vv escapes to heap"
+               }
+       }
+}
+
 func myprint(y *int, x ...interface{}) *int { // ERROR "x does not escape" "leaking param: y"
        return y
 }
@@ -1048,7 +1064,7 @@ func foo122() {
 
        goto L1
 L1:
-       i = new(int) // ERROR "does not escape"
+       i = new(int) // ERROR "new.int. does not escape"
        _ = i
 }
 
@@ -1057,8 +1073,159 @@ func foo123() {
        var i *int
 
 L1:
-       i = new(int) // ERROR "escapes"
+       i = new(int) // ERROR "new.int. escapes to heap"
 
        goto L1
        _ = i
 }
+
+func foo124(x **int) { // ERROR "x does not escape"
+       var i int       // ERROR "moved to heap: i"
+       p := &i         // ERROR "&i escapes"
+       func() {        // ERROR "func literal does not escape"
+               *x = p  // ERROR "leaking closure reference p"
+       }()
+}
+
+func foo125(ch chan *int) {    // ERROR "does not escape"
+       var i int       // ERROR "moved to heap"
+       p := &i         // ERROR "&i escapes to heap"
+       func() {        // ERROR "func literal does not escape"
+               ch <- p // ERROR "leaking closure reference p"
+       }()
+}
+
+func foo126() {
+       var px *int  // loopdepth 0
+       for {
+               // loopdepth 1
+               var i int  // ERROR "moved to heap"
+               func() {  // ERROR "func literal does not escape"
+                       px = &i  // ERROR "&i escapes"
+               }()
+       }
+}
+
+var px *int
+
+func foo127() {
+       var i int  // ERROR "moved to heap: i"
+       p := &i  // ERROR "&i escapes to heap"
+       q := p
+       px = q
+}
+
+func foo128() {
+       var i int
+       p := &i // ERROR "&i does not escape"
+       q := p
+       _ = q
+}
+
+func foo129() {
+       var i int  // ERROR "moved to heap: i"
+       p := &i  // ERROR "&i escapes to heap"
+       func() {  // ERROR "func literal does not escape"
+               q := p  // ERROR "leaking closure reference p"
+               func() {  // ERROR "func literal does not escape"
+                       r := q  // ERROR "leaking closure reference q"
+                       px = r
+               }()
+       }()
+}
+
+func foo130() {
+       for {
+               var i int  // ERROR "moved to heap"
+               func() {  // ERROR "func literal does not escape"
+                       px = &i  // ERROR "&i escapes" "leaking closure reference i"
+               }()
+       }
+}
+
+func foo131() {
+       var i int  // ERROR "moved to heap"
+       func() {  // ERROR "func literal does not escape"
+               px = &i  // ERROR "&i escapes" "leaking closure reference i"
+       }()
+}
+
+func foo132() {
+       var i int  // ERROR "moved to heap"
+       go func() {  // ERROR "func literal escapes to heap"
+               px = &i  // ERROR "&i escapes" "leaking closure reference i"
+       }()
+}
+
+func foo133() {
+       var i int  // ERROR "moved to heap"
+       defer func() {  // ERROR "func literal does not escape"
+               px = &i  // ERROR "&i escapes" "leaking closure reference i"
+       }()
+}
+
+func foo134() {
+       var i int
+       p := &i  // ERROR "&i does not escape"
+       func() {  // ERROR "func literal does not escape"
+               q := p
+               func() {  // ERROR "func literal does not escape"
+                       r := q
+                       _ = r
+               }()
+       }()
+}
+
+func foo135() {
+       var i int  // ERROR "moved to heap: i"
+       p := &i  // ERROR "&i escapes to heap" "moved to heap: p"
+       go func() {  // ERROR "func literal escapes to heap"
+               q := p  // ERROR "&p escapes to heap"
+               func() {  // ERROR "func literal does not escape"
+                       r := q
+                       _ = r
+               }()
+       }()
+}
+
+func foo136() {
+       var i int  // ERROR "moved to heap: i"
+       p := &i  // ERROR "&i escapes to heap" "moved to heap: p"
+       go func() {  // ERROR "func literal escapes to heap"
+               q := p  // ERROR "&p escapes to heap" "leaking closure reference p"
+               func() {  // ERROR "func literal does not escape"
+                       r := q // ERROR "leaking closure reference q"
+                       px = r
+               }()
+       }()
+}
+
+func foo137() {
+       var i int  // ERROR "moved to heap: i"
+       p := &i  // ERROR "&i escapes to heap"
+       func() {  // ERROR "func literal does not escape"
+               q := p  // ERROR "leaking closure reference p" "moved to heap: q"
+               go func() { // ERROR "func literal escapes to heap"
+                       r := q  // ERROR "&q escapes to heap"
+                       _ = r
+               }()
+       }()
+}
+
+func foo138() *byte {
+       type T struct {
+               x [1]byte
+       }
+       t := new(T) // ERROR "new.T. escapes to heap"
+       return &t.x[0] // ERROR "&t.x.0. escapes to heap"
+}
+
+func foo139() *byte {
+       type T struct {
+               x struct {
+                       y byte
+               }
+       }
+       t := new(T) // ERROR "new.T. escapes to heap"
+       return &t.x.y // ERROR "&t.x.y escapes to heap"
+}
index fc2d6ebbe4bbb84c613b2c2e82cbb26d330ebbb0..4c1989151465d0f69eefb41aa20a590e72715ab4 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Test run-time behavior of escape analysis-related optimizations.
+// Test the run-time behavior of escape analysis-related optimizations.
 
 package main
 
diff --git a/gcc/testsuite/go.test/test/escape4.go b/gcc/testsuite/go.test/test/escape4.go
new file mode 100644 (file)
index 0000000..83bc8eb
--- /dev/null
@@ -0,0 +1,57 @@
+// errorcheck -0 -m
+
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test, using compiler diagnostic flags, that the escape analysis is working.
+// Compiles but does not run.  Inlining is enabled.
+
+package foo
+
+var p *int
+
+func alloc(x int) *int { // ERROR "can inline alloc" "moved to heap: x"
+       return &x // ERROR "&x escapes to heap"
+}
+
+var f func()
+
+func f1() {
+       p = alloc(2) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x"
+
+       // Escape analysis used to miss inlined code in closures.
+
+       func() { // ERROR "func literal does not escape"
+               p = alloc(3) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x"
+       }()
+
+       f = func() { // ERROR "func literal escapes to heap"
+               p = alloc(3) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x"
+       }
+       f()
+}
+
+func f2() {} // ERROR "can inline f2"
+
+// No inline for panic, recover.
+func f3() { panic(1) }
+func f4() { recover() }
+
+func f5() *byte {
+       type T struct {
+               x [1]byte
+       }
+       t := new(T) // ERROR "new.T. escapes to heap"
+       return &t.x[0] // ERROR "&t.x.0. escapes to heap"
+}
+
+func f6() *byte {
+       type T struct {
+               x struct {
+                       y byte
+               }
+       }
+       t := new(T) // ERROR "new.T. escapes to heap"
+       return &t.x.y // ERROR "&t.x.y escapes to heap"
+}
index ccb24e8e9bb9dc188be255bfbb074c37b4f572fd..9104a57aaf6e77404a80759c0cb0e386226900e3 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 230841974f39ba37e0b58ceaff64a4046ebaad8b..3493426d3774dbd0672535dc34ef66d39871dbd1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e45975be41adb679f2c203600f7632094b035e4b..7165d9d2099f73106f184616b93fc9c38ed34801 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 20f467a5f4ef5e63bc5eae64e7ae06903bb9169f..fb207e9bc8e64385564cf55a9ec12f6a203e45de 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3bd2fe815ed7bc6bccb4d4e333d5da956822d9ad..3798f8321a12306868139b03e95f4e800cdc6bd6 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 43b5dfb129492c26d93b5db526cfac4fc08dea0c..6761682b39957db29d290122a654a08aa41b1d67 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d65f6da4503b00e4ef966f7e960f5606cf183a05..3d9fcb9e01e0c343d5d1a5abf648b74084a5081d 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2baead11e36e838e4e52b83fa9612a5e435e5e9b..48f74a52d95963e0afd6cb6701a079ab150412e4 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ef8263bb24057f18c0db31d36b6c2f346fcb2315..0467b297a2cb5b959917d9caf840ad0776211d5d 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7d96988d43bd183cf2e7099ce17fb14c7378cbc9..f54b1d54a861cc1a08545c874f2465746309b332 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ce627472c473a3d4b7fef12006e9901b3e384655..519c3585f06ba7d5e82bda5278cac96424d7902d 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ffd5b55706591a11e8b68479edc56d9fd609eec2..38efb6d979225ae94393e06d4aa8030f1f4cf7e6 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4b106775c28bb84b4c8982d102f1a2bfc40348a9..045786bf7a891cdcc05650df9dbacb4ef2b4a604 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 38a6e51abcb3ae5733c294b20e913dcd06295e0f..a20f0310e7cce4b8207037ae324c90e278aa7bb4 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9178f626fc7eef8f27a90469a72cda2396d77672..d3a9f22ed0826e35c4d6d65bb11cff3ac3db0183 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4fbfd48fd97ef1e20224b22c59ab14ee28c475e9..18fac78f34ac828e40af93cee5b3475caaafd3c7 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index fdc986d9def30efc28654091ce1f9288f18e2977..2f5960d10446d6f7f5fa08bbe84a886b71f8e297 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 896bf5707c04342b6d34d702eac2f2ed5887cef4..cde3f8679bea9f1cfc7d029c0aa5b508b4aef260 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 201fa5f0390d80a047cdb7d91a09c07ae0caff46..bf936e875cd54fc613ad255b23852c480eb75202 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f94a5856936fe37ac2516faf12e5ba6ab1cb1f7b..65a8bfe9a1989a732ba8ee4f84fda84484f8d1ea 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b3d3d4a3c150450b270b6bf0cc5653d26d79fe82..9b211cd54f8c2b3ec3a9ad951102b5086900375a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c7b17b7c09256aebda95ff0b691084ca4ffcc7fe..2e235b7b46b08aebd0d8b0456fa05e06bade0c54 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index eacea37459feb48d1a1fa21b045a991df838f9af..bfd03cc9555cd1789da5cd03366df6e8d0a5a462 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index cf2daaecf06b42b9a8e058171f9098113640ffa8..874b47e7adc3f4ab88ef8127af72e5c04479e99f 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0488ad2cba8d3e46f9f5a5840ad4d1f2d947e572..2edf5a9106fb1fb73e5b71e7dad4cf611b0561db 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7efde9b4453c9abd446dc11a800e8d0bc2a603d2..ffd29e057a9bb377d97e198a4279e0e7e3458698 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index acb4741e9f747ed58984d02b347f78092bdb4462..529e5ce84ce83ff0e5ca90185a50d94dee134392 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bd2a633f298eb6ee31c23f954b71d93b87b87adc..ae41a1795370f4d8e6834547789daa0fb9b80c78 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug036.go b/gcc/testsuite/go.test/test/fixedbugs/bug036.go
deleted file mode 100644 (file)
index cc20516..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func main() {
-       s := float(0);
-       s := float(0);  // BUG redeclaration
-}
index ff7d28710a111d483db41a2604e5e743a35e6ffa..f17fb3fd74cc0a283621d44bc800d4951d1ff4d6 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug038.go b/gcc/testsuite/go.test/test/fixedbugs/bug038.go
deleted file mode 100644 (file)
index 7585376..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func main() {
-       var z [3]byte;
-       z := new([3]byte);  // BUG redeclaration
-}
index 7ac02ceeb29e39e0e5381ab4c23a675d954d9a95..d34f5e62e479c651835ada704e2882f696dcb122 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 912316cb6fffa53a1d3d281280e29602b57d80f4..007f47f9f56a3cd0efe840aaa608b996e30ee570 100644 (file)
@@ -1,5 +1,4 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,5 +6,6 @@
 
 package main
 
-func main (x, x int) {  // BUG redeclaration error
+func f (x,             // GCCGO_ERROR "previous"
+       x int) {        // ERROR "redeclared|redefinition" "duplicate"
 }
index 94888c40e2e381d42d79f34aa19d299cf8aa9c14..c66a2411a89201520dc989c04060171b89734e45 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8a9b797074d6f831d39f40b3b6b071ac70d626af..219e91d537b42788da0a72c640e7fc139493ba05 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5a776abce8d591cc9a2f794dcf0de75d99822f63..7619ae73c6680b87d7181042aeb978aade367fef 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b9fee7899c8a9d513b1c88f1a701bf2234ceb699..48ad751e2c67d25fb23cd528fafe70e2f5dc72e8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8fd67ccd51b03689813321ce3afa9b87469e8fc1..51990f2dfbcd2621a17214798be3a97e3ad638d3 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 585c44623723439e405f56c824dd1b8e88d3c93a..aba68b1dcbb428e89fce247ab982bf3e735ad461 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index dd1662306dcd21bd1137130ddfb6c6a373effdbe..c4ba2eff67587d10a498ee2a71b60c63594bfb3e 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d2c1b50617aa00fb01797f373a54c9af27e8b2d0..440a00ebebdf3f11bfda2373b99ee92f91dc5a52 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c981403edcff1f08aabee5386f21d77abcf11ad3..00625fd7c30432ec5f73b1e234bf2e10adc564a1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c8a2272c23644c5550deea8f250e3f9d2269c9fc..01590585c53d6b3d7a1b97783edbf15684c8b204 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8617396109d0b6d1f501d613bed77e968f5fa82c..c3073cc1eac367b33976bafef6d67141937d3ba1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 050a4a5c5d347e3a6819b62fc81802baf854edd9..13eac29204745b3ad1a7028fcc9cf1de5f1c2d9a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d5d0f1d620e725202c2b5684967ebe47e989cf92..19b8651a547b844ddeb114e834d1d94b1fc5fcd5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e2b4a241a6326123ebd3e66792a0e8a7e9033356..2b97dbf7c0e7607457f6248fb06d35eabb6e4428 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6a77367d6765abcf63a3ba3895eb06f88187bc29..6f64b9e0b16ddc1213cb8606c6a6c491dc683852 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 82778b8386f3418d22f6f023c7afea35da20c1de..8260729056bbe8130353af24dcba1cd631b120e0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index aedcf70fefe2190db04a8f12dd5788c73632e637..ae99b186d81379f8c9e6f64e556f0c0e5deabf85 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8ee5c84cb9d046bca187d34fe1b9ba617d2c42b1..1cc50036559d661000ab187dff72c3e48e207387 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 543e0b7260784055a4cd252e0fc10c726e232799..a3ae3f0962074352b1905bd458ab1ba9dac39164 100644 (file)
@@ -1,8 +1,8 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug063
 const c = 0 ^ 0
index 92d2154236fe890a7b103e10c39c798c4158139d..d8b3bea9a60874cbc3f4a9ea51e07de382031f89 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: compilation should succeed
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a5d1bedddb977a83c2648fffc4a6e5d6f57ab449..a1e3b08bbaed6c5a14e1cb20abcefd340126e161 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2fa5048f1bfe63904aecbf16070b9e2e30e09664..db3d7f86028bfe4829045b32e178b19f72c310fb 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug066
 
 type Scope struct {
        entries map[string] *Object;
index 328d191bb423d02728a99579cc3fce9e0b700951..aaeefb0ba16fa53310c7ffffccc36e534ace7dee 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a7cf4239c43ea0d2f57e7c53b85953e1623e3057..2cb10ab3a190a4ba602f513a86f20f2d3eaec530 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9038387ac8624de353e00e0cbf59cce144b10c9c..7b07b773d4bb118bcc054e92c2f6170b15008350 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 24ac7798889ad9d4af3fb3f17a2e7c4dc7af5fdd..3f3ffcf615151603ab88e360d2612d1d5a2f06d7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a5003ffb9762fe1ec3011b7744d56161f8cd471a..ec38f7a9799cdc052aac3039e52ecf919fd228f0 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: compiler crashes
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug071
 
 type rat struct  {
        den  int;
index efe5626db591de4c054a64b79440633be575ef4e..05ad93dac2ded82d078a8a2ac903e317b4556e99 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 99e7cd19ee41f4a368eda2bb14a964cce583b924..49b47ae464915450aeedda0a32ede85b96e831a4 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7b6d14e7e63429957d5eb69c004eccdacc0aa28f..fb789cb4c1b511ea681fd91eccc6a6102b3a8922 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7aed13089dfaabb2f7ef88487443a9e1d2a432cf..d0b7d14e71bd77943a540e3bdc1be38e36d521a4 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2ca518d76d8e16657344fdcccde860e0c554f7a6..60aaa976083352e4e5a0492aea99aff8c881aacc 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2cbf96d98fe8c70a71be8a123643bbd37a91a96c..80581a8a3b6ccec380c6401596364ef4e0134ccb 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ddd3faeba41333e8b16cd73701b7367c892d65b4..1041b858c84acb6558dfdd8e87cf37b3947c6cdc 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bae16cdb2e90cae4c7b3296ddba2b69c916b85a5..32b2c53b9e76e32067716dcb3bca3f487d9f2f3b 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 026ce8002f2f5669f3088f10bed268b8ede82244..c25d2883704945e5cfa988ed9dc0ddda639222ad 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8353ec200e4c633026abe1834f5cf520d254647c..e184ef1930156395e3ef69c9b11f6996680d6ae7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 984969d47f7071a0c9e348c5d79f7d313536d0a0..8bdecaadb514247450b52d8460a0bc3c3a141447 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/bug0.go && errchk $G $D/$F.dir/bug1.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index c1054e550cc1702880211e47908711f352a2cee2..700a674339dbe64318a3f228780b01015bfc3197 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 02be717534039bd903743737b56d0b4e7eab4f2c..93ae7e0a496788f54adfb76d19ddf0175d2c8990 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f96472fbb35728efd2e83ecacefee04ca239f3dd..fc69e0e3fc7a34cdc20b04993032d0de767bc97d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4af8d976f876f18942645cc72194fc4b1087f0e0..67e7210cdb38ba6b09d9979d1b8c5aa24299755d 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9715a703cb156905cccc18da8e9581f60a5cf2c3..3b99da84d4ba1d6a0ae65397970314f5d08475f9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go || echo BUG: fails incorrectly
+// compiledir
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index fd3dff3ec903d10554323165a33757ae219c1fe8..e88f17babb808ae6b057f844aaa809ac9f33f616 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8318ab9c0c0ac1f78e924bc98dc9924b2940fa35..320bd57f5c17fb9cf6ff0b17f598a02ac6c9af9a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c2ede7153cee3de0d5dd0a00c490566a3cf7d89f..dbb1287a151777ba14dd26b633ed9040288243c8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8f05c478f5c973813f8a21cb1cab48443990930e..8027d941ea485dd4c7aed4371e092a38fbec3860 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 52d92c7e3d4c668414ac3cf97a742ae5e8c6461a..acd94466f599f43abcc61ec0b66833c8108753a2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: fails incorrectly
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2953eb28d370be8084ce401cea88ee3c1c24defe..3ef11da3d3a24212de57cd972197482a7be0f1a4 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9be687a7bb4004aa22dde076b224d2d2a5bb240b..411ba74e0caedfa078acdf6e68eb53d7f22d8e90 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ec3c21543d336b2120932053b88fd510dce08256..a067e0f57aa08e4c64652e7ec3035c19f1d25061 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1dad4d502aa17e0dd172c0f009db1d863a38c15e..eb4ee4de03fef25f13e47ccc84b0727253e9deaf 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f76f0e873cf8d1f81ca0c175c14815a89e2cd5b7..03a5c454b0b17191129d1d7b256ac8cbb590fbed 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should not crash
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 92487deaac64b2b9300f6c4785f36bf9041261ad..82e496a8a6ae2d03eb67ff5ecfd3991ffa62e906 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1d97eb4a8d34b7a62a4d640693df1a84d7f1a501..f1c2324b783ea26bc0ae33605eddfd70313e4b11 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not crash
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b789be1c4579dafd3c20ba225c9ca66c3671f8c1..1cb710e36887f77754bb4cb3407c0a95c6996dd8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index dd4bb5834fe0993eda12443bc5680ed11885b3a0..f0c19a8aa752828ada2e4e9da2dd4e03907fb871 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1874b204491203dee8e0f8976a8165ad053312d8..3b99da84d4ba1d6a0ae65397970314f5d08475f9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go || echo BUG: failed to compile
+// compiledir
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0554bbc8b85e5bedcc9d5bedfdd9ce63e692e3fa..dcd8e9d1138f4481eb5399b7f476a70b6ed49da6 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 10e406de6ea1611949b83635e93d9ca6a764bec7..9f2a27ebd97431e0d3c9b42499ab896473f2875d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7666577230fc66589f73f31cdee8ade5557d0324..556dc34dde70769affa31744ba73ebcb611ba249 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug109
 
 func f(a float64) float64 {
        e := 1.0
index 4e43d1c01b8051a450e9cd90b2d836322042ab9a..5528ba3f16d39b40b72b858c7ef1d37eedfa897f 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: const bug
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e72b343ae3da482965d236b24d766bdd585e2705..d977bd54fb1248e9e4ed7fd140b08f01a20901ce 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3c932843c7de9c7aaab951676792e4ee052e576c..e2ed5c0d41e54538e6db3522e30eaffa6ec4af75 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4ca07dc65a72da31cbf1c206658834f1de489d70..a1e61cb36fd83228267a3d02ee338d7a7c5e1d73 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 974b7cf26e5841bf9966528174a8e70c5c93ca47..99e66a2ddc1154b0737664ba0c1cc74b5f676ec0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && (./$A.out || echo BUG: bug114 failed)
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 16b22d7079a38cc098c69c98d71262dff127c34f..7cc3dc40a604bc8e824061df132c424397148d04 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug115 should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 42ca8034323bac8b58825940c83cf6188f8935bc..5d8e52031509b969464199a70c38c8ac158f50c8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug116
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ad89ebf52a9b9108179bfce0ccf4de2bf2c3211f..038826cbce836eb0ba52994ef180b43835161c5e 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1271f5b0cb2b6d3074cfcca0e05206918ad02cf1..198b8ff2801d76f86549f082c4535de0bd403a3d 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug118
 
 func Send(c chan int) int {
        select {
index 750507891ccb07f311a354fb5552d46bb068f45d..6f2514c24ec750336cb785fe58961821c38c2232 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not fail
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bf401bf3048275994c2519f89b9f1929e57b3ff7..58355e53de951479be053f51811be84e68540a38 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug120
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 15c8451da93963d788ffc19dcc03915f0072caa8..5adf9827fa12de32f4858765cd763dbca2f06a9b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 72bf38a83317730cf5e2eecd20452fdd3c0f891e..fb4eb9f3adebed21309c3940a568e071c181a088 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bdac67417f1ee519e6aa1178f786e867b500db76..f38551a9142373606d52e9718e6e5b71837eaeee 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a8d56e1221e4e42f86f878cd460fb4c1ec370416..f5d9763412984e81c15af58821af9479cf460be5 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 25b48114d6ff0a189f1212747717b03a257ed797..f8ea99470c300e5f5ea1224c4c954e5e4617a47d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3fd647c004d7e8dc9180c348af6c570f74050ecf..e8cbea079feb912611468dbe35aaa65714dd761c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should compile
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d1e2d8b5631cf7ddbc838815f883b5ecc310959d..157ce78ff729b7573387f5e5e85668b4a06bd0f6 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG129
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 855c7072bc52f89709e39daf42b71650c93b1e38..16b029af34ff78fa1b44e6194f9ceaae26f5b2b1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e5d4ca07d774b8afb3ef9329d5bd0bc903fac8bf..0ebbd26069e16ba2f2e57abcd27cbcf874f66b98 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bab8996f197acf295404f3ceced1eb3a2c780a7d..e334566c79b9c157fab2d7b3f3e70e84a229d61d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2beeb074f57070eaac319f8960a844906c2aa7ac..a6baac26ca330062e65659a782a11dbd0e4c1bf2 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go && errchk $G $D/$F.dir/bug2.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 470135ed43b39914660405adaeff1ec485daa47f..34d234e2247955f3bef76a37678610aef657d3a1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7491b65d88fc3e6c199ae729e95f660887e6c47d..bea9bac083282a88fbb0bcb89f0de8174fc64e0d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9d43f431be83164beba1a0e464f545a8278113cd..48368177a2395a8f6c482f67e05a34963ebb84c7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2bdbef1c0f075d886911fe6f152f41f903aca1eb..095e5c93cc36ebc987e6690b044bf22a415d9594 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 441c57a4855dc56fd41d013247c69c3f002545e6..8caf1d7d9f05a8ada9779b09715ed94673a2f4ce 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1b125e5d1ee4bd265e7921b3a7a1e78c8a35d5ba..81ba6f1b561e64dfc370c9da63de4be9584b1fe0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e54458baf45b445a09bbb5d59999651076e35533..e28d889a93d1308f5f07ca6355d554a740219cf8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug142
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2f575fcfed1b6ad90caef6a9224c0aa166a89aa4..a43e406676aa3a20f02256b5e38c48091092b656 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bab9a44029d7938de754ce7f53a79e68e2984ac9..9f8ec7667ccecbaceafb69fc8c1ea800ee5d6d22 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c59bcebd6ef383bb2ce026b0b3275c438c89157a..602fe7426df2f7c3089b0bb0df20cc1ef12416d5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 16324c741a4d6a5df6bf59d0580cfaa972de4814..e29f910ba50055061b101d12cd4b7753c4420f66 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a16630b871601f81e14cbd429bba0c4a1b838972..e8b3d243949f2c09b0976edf1da5b4c433bfa5b1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug147
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 251020c96f79e94a505c6cf35a855fd098b506e7..b67870b12a61d0bd3bfe4fdb9932ca59ea7fb4ba 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a40403b7d74095ecbf2ea79294901cd784935f30..78b687e9718cf72fd716a43f7fdf2ae2e7d4299f 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index fc25444b6524138044145f9a1b2c3180aebbc422..b565ef73dd8b823aea9f48b0c3d56ee875f01ba8 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug150 
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug150
 
 type T int
 func (t T) M()
index 46546dfe1ea8d95a4819cf3dd996a1e3a2651bd9..d9f5e021c974f60362e9e3ae4a9b5e5912eff570 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug151
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug151
 
 type S string
 
index 7402525164fe74dc5c723c14e39e3f0e73c72fc7..a4baccda779e267a0492a7b9dc392847bb4173ed 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 30c3cac91faf028b686773d8890061dd2f502952..45b9b3d53038e18eeaea789582c4ad889637fd62 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4371cc5ce9e5def2c53603e5c110a177a458f7e0..a2cfd4accdbc128cea1c75098eceff4be7999620 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not panic
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 312c8e6a963bf4a8b296f44096310595ed3cb924..8872e978daae6d605b01541ca04a549e6c46bc98 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: bug155
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0b77a72d9166454693b90df9ce823ac66aa1f6ba..f26658729f82e455098ddacec3c6c6fee32ffba0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug156
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9bf68f7a475a629236d947b7ad02a786b698ad9c..1072d7df49808bfd1ea9150261c207be96b7cf37 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index cdf3195feb3bcaa8022a401e8b846e9d4a858fd6..496d7e0db00b2ca11b7cc0aecb7bd6018eaea41c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1aa64433a70bf0f1708509c3043fb98c1cf59e7d..92d5345635d7a4a8ee631883d5da286016680de9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug159
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8fd53ea079560269c0f431d72bbd93678eb7b858..c5e166a0cf90a11c2d1b595fb8fb20e512cf3e94 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A && ./$A.out
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index e5f25f746db34dd03298ee6979550cff843f9ec3..aab58ee895344ae7b0f27c0c53444aeb7e9754cd 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 919298e6f74b36178ef1b8bc5f6d09fa563af4d7..d69f6bef03a70d77327eec3692731fd49727f165 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 746f631aebe250be650c3efb3dd54c30fd20e636..888b495eec3f238df18036b4a9d6c216b3f19ff8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8ce67a46db574fa73c830f8164926a8f2c2b6054..f8d50af13fdf7cba799169c684bda747b2c49650 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 33eb3cb1a955c0d35115bc107afe2cae88b4fdca..3a50e6ff0c12730e398601eb470971b24496af00 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: bug167
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e25eb56b0b3259d8f0f98a4d8695da94531bd640..53301fa81ef4d689b1cf2c82f94fb7690b851c59 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug168
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c42727f389922228c2234fcff31c259275805a9f..f63c2f3e1af85f619d1c4c2458ebc26d800b5fdf 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e7f1c5120dc61a5eb226742dd896c7fccee848f4..11ff5ff3c7563802a084e353d7ca11100f1b4b33 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5357b2adc60d387f156d789c1c080a2eeae74c3c..49bbb3b892d8288320b0647926dff59537ee6c26 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1837a1158a66d1e8e6f3fc14bb5c8adb88ecedb0..4dbe7930f907f0ddf99c092d0850687266ba9d11 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 898b8400ba47f949c4d057ea00a510b370523ffc..6479bb2531b26880f6a4bb02d66bf8831e086707 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug173
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7ff865513268bc0d2cd00bce54a5e48db96fa136..448f630867cf5af19a3a672263010427af56596c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug174
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1ca14150765fc2e9816835669a1bd14d41033929..5fca4b22bc5539ba3f91f580d232aacab90292a5 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5820df30842ed49d96adf1ecb955c37418bd5fd1..82f8dba0ad0b5ec71d97df454ddd10907a22d171 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a120ad0abf2fd647acb4b5beb8313e75412ecba4..9f2c1ea52f05c79184a114203ee0a0b767331aa5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a7ff09daeed3ec8d2285b501f3acb83c121aa999..2bae5a1c5645d3d513e10b8f5822569a3a762cf0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3347613d8db0774609d271f7b8d0b4ce35dfa7c7..dea82fe0a06accd0d5afc429a040c6853fa903db 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 96823fb3a5f3b3afeb3c30aae288bad85fcfecb6..cfdcfab26711ae75c11c0e71c7f8d8ddd6b01441 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f87bc9d4ee9fd19a6868228a6e8ca0f08f4b0a9c..4827e9cf03d966410827258ec38ad0e33cc029a8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 81df2ca13c6e4aa654581a15a3a4ccf721c95762..e02dc59f8601f11c29e9eeedc4661b99ff5df4f0 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7fd6e4942f643cf8e6338e0dbf6f06efb91cf099..dc9f5356e03c1801334bc416812c78f041096dd7 100644 (file)
@@ -1,4 +1,4 @@
-//errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3cc9845356ea0ff19477f182dff8018c8358f303..c084ea5cf5ecae3644c431564d309bf4f393a149 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index acae174f4b0d36f1770900ba30ded727c6556e6c..890900600f43c57c015d67727e42897a6ccb08f7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index dde794a5d70f3864b073d56bb12c56d75d189179..5aefd7e5cfd709d7786605d47332302404980a8b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 66aa5f024b46fce57622ec4a26516fdb26fd92dc..5c3c2bb1e170d21dddb3a5514ea3b703458a3797 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e1cbce05dcba2b980223b9c3be5a9716da4c6c68..550614789456ee060ca951cf209d04c44e6c7a91 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ce338305cd41754bd74ff63b5a3c25e88524ee6b..9e412c66d86812d16e5b9bc143e71b5c41379e4b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index da0bfde0fc5b59f0b9897ea51fbdba2069ed5f01..bb2d81cbb9abd88dd8bc2a06fdeb277e5374f654 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 44fcccfc00acf70e29969a25a7511fd7e705ce3a..11a6e58e516f13c6241839cc075b01063f0585fd 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/bug191.dir/a.go && $G $D/bug191.dir/b.go && $G $D/$F.go && $L $F.$A
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 282ed30d3615ba6d0b194f756ad4ed1eaed0644d..679aaed1f2d05eb75c5240744276c6dd1b125899 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5ef02b1c1d77598adfbd42782dd0fbb8ed0ec4fc..64e06da897516c359a0493c725e5fd926eac046b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index dcd633ddefa892c732b0b870cf20c53b058bde89..2976529031140b62e0de2e5ee6913dcb509b8e81 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d8e112a3a6822dd82c61c95914ca6385ca7ee2fe..85367cb8882939edc758352b073620cb4b1d523d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ea8ab0dc193c71e82686a814d0c8fbd11e36b2bb..5255de1892e680fbb8f1065e33e1c660c5891843 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c205c5bcaacb3c0f725969d7243d04c64519e64f..4a9f103ea00b35d3e6d8deb12812cbaef2ad994a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ea71fad58e5b77abf869012f021aad555fd0b063..73bb64688aeba2fab56c63a361ff156c0d190fad 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 71226290f1f322a5cc7a6ebe30deb84325b93e73..f69f23b5913366f8f1638282351cb641656a99a7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 63b8633bd9fca5ccfa4bb7b551bf488cba9a1336..da628faf5d0921fb68847e7888ec0de0de95a3ad 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f7db62fc995260692549d3cf3732d52a2d228785..59248231aea7bb212267be8fe2804653e0bc9278 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2fc91b5208b24b283e16fc0ee6030b28fab5aa0d..49871e3e06151c4dce1f1202cf494108c90014b0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bf86ee912ba976fd470a3181d5dc357abae1be29..2fb084bd65820fa0a1ab0d33f4821d9797b38b97 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index adf0aafd6b2773874075ef75616e67e6e3b5dc2a..8810a5f921b443ac55a01f57c9d8b501a0759252 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e12be72f925b7aa93241998caa824cdda6ee3aa9..de17cb698416c1988dc53682f9c421086b85862b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7efc0b14afb7969b6b3e9936f580cab78bd5c11c..c2382acf13ff5119c7f03f55413785545c4043b7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out >/dev/null 2>&1 || echo BUG: bug206
+// cmpout
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug206.out b/gcc/testsuite/go.test/test/fixedbugs/bug206.out
new file mode 100644 (file)
index 0000000..aa47d0d
--- /dev/null
@@ -0,0 +1,2 @@
+0
+0
index 5810d669011e70ad684f634846f63c399fc3d04c..50923df1c23f2785b0ec7711b96992e07c3e3d00 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 13b0400848d8fdbdc9ad922beff74e40c5f811b9..09ec0afbedf566dc16f970593b7a7eff3001688a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index ae6f10f60387c02f7c1855b9a4e2e1a3324acba5..52faf1fb925fbd3a22e27de38b661db9e31a127a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 69aeeeeac55632ca55567667ffa0ebcd86626858..b150479276366f1ce9e0ed4132371f7360be7b8d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 51df9b8ae869ac5cd955c005a64a77ad16b74edf..4e58b91ec05997daf3f526b7ff06eb82b66adf0d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4d81dbb4de440df45052acade8ea6e4fcd739768..7f4786b52bf0c6bcf1b9d28d291d04d8b0cf3a18 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 502e69826a8453a8856179b0319a0d1108e106f9..5420058c46dc9ea920e9a6e8ce202cd3ab4c2289 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug214
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8f7fb2d3c2d9f76dd8b3048d13dc2a6d64341268..08ed662c65d553a8c446570e5ac4e7416eaa53a8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 76f85464af80b175156044cee3755b45a974790d..c83a522bf914b1b8026d47f54579497f5bcd7506 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug216
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 98334c4ce1f5a188d748f4590c50743a4d0e42e0..ec93c25d91707d5ff2434ab61c61f71f6cdbf127 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b2c9ede75023bb2553797cc58b4f90dcdcc084e6..0e008db17f228a2f4ef010f24c71d2dd2193cc63 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug218
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 966d3fcf31a8ccc5ec845044de2d23bc9e1a8329..290c691eabe63e6d8fc0943e17abcdcca5bfcd98 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug219
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug219
 
 func f(func()) int { return 0 }
 
index b64583114f484e8ad404d2667da2d2f058a2cae1..86fda203516b13e67e4bcfad292e914c3dea5a83 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9194927b57feecdf7fa5a837321aef067b2a160e..16920246e00d2056e7978efbb73f1db77848de09 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package chanbug
 var C chan<- (chan int)
 var D chan<- func()
index 73e16678e9fa37168f5c14f0f4f821bc14cbc90c..109581dc30380bbcf6d4e467351d0436a935fcbd 100644 (file)
@@ -1,2 +1,6 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package Bar
 import _ "chanbug"
index 5c23a533d19c76a29524b401dfe7d670fede5dc7..3b99da84d4ba1d6a0ae65397970314f5d08475f9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/chanbug.go && $G -I. $D/$F.dir/chanbug2.go
+// compiledir
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 80f9cae8199c78a3dc7e8018e106d61b1d7d9f41..29ae53cb713c45ab97aefb2bc029bf57a5c49589 100644 (file)
@@ -1,4 +1,4 @@
-// (! $G $D/$F.go) | grep 'initialization loop' >/dev/null || echo BUG: bug223
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -18,4 +18,4 @@ func f() {
        }
 }
 
-var m = map[string]F{"f": f}
+var m = map[string]F{"f": f} // ERROR "initialization loop|depends upon itself"
index 11ee57ecfa2c56f4ba3c723262be6e25054c5172..d2fd67cf32f3fbff347ff4e81987c74a95378fe8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8acf66c4e47299b0b6c3ee6c6f35d87bb6498901..1bda9ab4b6e7d416054261391a5e5c402207f3c2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index a60866044d1f6ff628f3e949bc851187024617da..ea8d02d10c6b6340c42e15091ce54eae4e646004 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index da335dbc05a942fcf3ee8cfdb503479262d0a207..3d23609dde406a1e29b04933db405fe8fc716dea 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a70a926da107cd1b148f05be7a8395bd65fd7f78..19776881d170f3263b73c1a43fb44d9665cdac75 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c7ad1a3660c7b57bf8e8ef8a01a314c2f3e1142b..210acc43075d344ca8480f276713b573b0564d22 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9500e582bbeb3841aa1b85f72d6c69717780c936..a9d409b7d5aa554533cde7c72af70c817643e756 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 99bd02ff6994461563a81290672ef99c881e2ad2..d18727e907138ae7e33120caae4fc9892e390131 100644 (file)
@@ -1,8 +1,8 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug232
 type I interface { X(...int) }
index 31bb673ebd654deab30011d43bb8e4d0a3a1bef0..63f8ee2e9e6d1bcdf4a3b44d4962dc59d02425ff 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug233
 import p "fmt"
 var _ = p.Print
 var fmt = 10
index 562109a058bbac650d95bda18fdf249c613eb33e..9f503f04a0bc50bfe610267ed522baeb90c6096b 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8cecd9d047d61c25f95a9ad4843ce533a6d78741..d12d9e7368a3e617f4ec36286c070e1f8264d9bb 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // used to crash the compiler
 
-package main
+package bug235
 
 type T struct {
        x [4]byte
index 895f82a23204bb1acd51dc859a00df0693a0cedc..6c245565f299fce30ccd2081bf4cad2dfc8ec7bd 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 55cc86acea14eb4bd69694cafeb55294476e398f..58996cadc0b661db0478754dc797df911dc5c6e8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4d5a905f054f3eb6c0a73cd284fccde9fe7df704..cc47189e1684ef55f7356a00d2c60156013a6b8e 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 32c3d7e1c1d87e76be29ec1f2230b80e0caf7b42..e4902527db39d20f18f4ff4525d85c165cbf8d36 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug239
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6cba9c8b1e52bec28a21b595311f16f94d4dd11a..478b5b2eafe0ec7ddc626c1cfd393b641570a636 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 172b3742e545df71664a9374a975c3f347e885f0..1f4440147b974971de72435638a82058ab6631a9 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index d80ae76a215ba32443b07c9f2e104f97af3f0fef..4791ae485f69e35ad6c6fba0270ee9b33e7116ec 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: tuple evaluation order
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e3ddf0e774537d803464608955537f0ec5d14f4d..4870c3614cbf74eb54c2d1f79a71829552bb0061 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 915c3fcd095add6c64a6df2379d9c8dcaa56d003..29bf0d58b9725ec787d9ed331f0b1ae83d0e3dfb 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6e5a8b344f778c7d8756f8534cdc92229f43a041..c607a6dc33ca5e3daa5cd4b49bf5feeb5d6176b0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug245
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 12041eb1d4174ddb27d02eda3a6765a2fdec846a..e506f8c0dc3a9dd2c9b0a44c9f642be7b45cd2e2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug246
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2f56b88d4739b9cd8c82999865398a48b6994c65..b6851e1bca041f91e06a59d06532ce1aad068c9c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug247
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7fc7401c5a9d6ee935ff5b90e100cd705c8c304f..78433f504d322f0d786a8dbd2a7a72ab08d91c70 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package p
 
 type T struct {
index 7fc7401c5a9d6ee935ff5b90e100cd705c8c304f..78433f504d322f0d786a8dbd2a7a72ab08d91c70 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package p
 
 type T struct {
index adce3667708f62c689dc4206d0a947ff2b493527..ba547d64a1074fd63facf0d7416a4284ffcfd40f 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package main
 
 import (
index e5a24495577300b9f1170004af929feb9ab681e1..4a56c5cc81c111174fa2f1927e3fec58b47ac11c 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package main
 
 import (
index 055bf1fd7e1404ada3cc968cd715cefebc528feb..98cda35c4918ed002607cfbc34903766d0e0e46f 100644 (file)
@@ -5,6 +5,9 @@
 // $L bug2.$A &&
 // ./$A.out || echo BUG: failed to compile
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index c85708fd8e8c7ee94aacb75d5acdab23932025ed..dc922455e3f7d57bdfcf4a095c9325fa99b71c1d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index cd28642bfc95d935217658c637f0a3ce7cf229b3..5140f3e29daf8c087dc75780076e8a3fd8c1ad90 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug250
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug250
 
 type I1 interface {
        m() I2
index fb7b98a016dd2b94a623153f3132cc9e68b7c798..43d9d526fd15b937f529cf654a0c6ead81788c43 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -16,6 +16,6 @@ type I2 interface {
 }
 
 
-var i1 I1 = i2 // GC_ERROR "missing m method|need type assertion"
+var i1 I1 = i2
 var i2 I2
 var i2a I2 = i1
index a2c1dab9d39027d3982c2b67cfe59ad51f05e1a3..6f007fb7714eb6faad3babd3fce2eeeaa54534e0 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index bb5b770f51a2211a187551ac94520d8060f90cd9..f6ab712ef212bbd1cc3dc06604682029b8b57f1a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug253
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c0c7f249ede82db2ce625a205371d8da8b74ee8a..9b1c81911b2a61aa51b2ff6f7f7c9d8754a9ee17 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug254
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 44427cfdb4ec6a5ce5954e7eeab0e08d7c575e1d..dbd41cc6ab39413b26cd8280317038e550054c1c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 37fa5f5c805b21a4593d8619ce34fb290bbf9c8c..0498a40d5483135a77ad9dbf11550d5a7c5c557b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1b32475003a80872c391510dfac2c1a75a8f069c..003f3ff94d40274850f3d3143330fba32566f93c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bugxxx
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8984df592db32b383bb03ad2b0bc248a23925f7e..d362e5a69739a8a771335c74514ea27bfa0f3ca6 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index d148fb3a0c04f79eed80cbc406ea47522eb14f5e..e4dcaeb2fea0f51e04e7fd595bf52dc9f9a0e4d7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 91dc89f77a5b85e2b91628f0879215124c46d23b..6211c4885ac616427aba093037d8f2a4fbd46b01 100644 (file)
@@ -1,4 +1,8 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug260 failed
+// run
+
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
 
 // Test that structures pack densely, according to the alignment of the largest field.
 
index 8c3fda1e7151005fb3e2bdb1af0c128b8b9472f7..f7879b04c1043ec5c71c49c58180b90c079ca8b7 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ebca7905f9ad3f4167c10d1826b0153546bc3e65..6cf248a1811f2189df0fa0c0885fb148f8dbe1a3 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index cab986ad59348fd6dfb2088cb16c839d3bbb71d2..f1cf9010d1c380ee03bef78dd1c98cf525d08378 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6d86c6fe5bdddccabb875675dd847b74ceb7c09c..fcf373cce9894fc813afcfa6c687b6a0f5740177 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 55f32ececc33a2bf65024c5e97fd8fd0538ab87c..7f06fced6041ae879db875ee296ce1cdeeff4fc2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 25c246f7df89841968118690f4ef8fb45e74cce0..d4da891d31e27a7aadff62f684e74696607ce893 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug266
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9646142f2a0227171914b5605a34dee03b99c022..cf8bf841f8b1da65e102fab82c413a54b868bb1b 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug267
 
 type T []int
 
index 4cc0408c37346876cdebe7c876802bd284ec2458..c13eb26ce4aa4402f7745d5dbebfeb08b9c3f20e 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ba93d93ed2a72cfa0a1af8ccdc729e0f3d24f929..88add7040ac0c164742484f2cd2845cae5dbda5d 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3b7c466748efd8a73784c9b0cb4e2448d3b76aac..c27f7ee446e9e61c80d6e22f0dc5817122ff60a2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index dd5aaa7b8af31ac57605aad1db6aeb3d88c82359..c5e73e945c916c859f38c8e389927a164adf7971 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -8,14 +8,14 @@
 
 package main
 
-import "unsafe"
-
 var bug = false
 
 var minus1 = -1
 var big int64 = 10 | 1<<32
 
-var g1 []int
+type block [1<<19]byte
+
+var g1 []block
 
 func shouldfail(f func(), desc string) {
        defer func() { recover() }()
@@ -28,55 +28,47 @@ func shouldfail(f func(), desc string) {
 }
 
 func badlen() {
-       g1 = make([]int, minus1)
+       g1 = make([]block, minus1)
 }
 
 func biglen() {
-       g1 = make([]int, big)
+       g1 = make([]block, big)
 }
 
 func badcap() {
-       g1 = make([]int, 10, minus1)
+       g1 = make([]block, 10, minus1)
 }
 
 func badcap1() {
-       g1 = make([]int, 10, 5)
+       g1 = make([]block, 10, 5)
 }
 
 func bigcap() {
-       g1 = make([]int, 10, big)
+       g1 = make([]block, 10, big)
 }
 
-var g3 map[int]int
+var g3 map[block]block
 func badmapcap() {
-       g3 = make(map[int]int, minus1)
+       g3 = make(map[block]block, minus1)
 }
 
 func bigmapcap() {
-       g3 = make(map[int]int, big)
+       g3 = make(map[block]block, big)
 }
 
-var g4 chan int
+type cblock [1<<16-1]byte
+
+var g4 chan cblock
 func badchancap() {
-       g4 = make(chan int, minus1)
+       g4 = make(chan cblock, minus1)
 }
 
 func bigchancap() {
-       g4 = make(chan int, big)
+       g4 = make(chan cblock, big)
 }
 
-const addrBits = unsafe.Sizeof((*byte)(nil))
-
-var g5 chan [1<<15]byte
 func overflowchan() {
-       if addrBits == 32 {
-               g5 = make(chan [1<<15]byte, 1<<20)
-       } else {
-               // cannot overflow on 64-bit, because
-               // int is 32 bits and max chan value size
-               // in the implementation is 64 kB.
-               panic(1)
-       }
+       g4 = make(chan cblock, 1<<30)
 }
 
 func main() {
index 198544c3f5425104923e6112ea0b30cdbf6ffb63..beb2d61acc84f67a0381c53d2ba67ad3f83c318d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2bbc807c599ba1cd21a5e8188d1c9e45860db688..f5f6b14f010eb7e4a1ff9599365b3cbb196d95d1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 844a6b2382c2b9561d5750ebb693af73e128d3b3..dc2308ea6b96456ab8d2329cea98005fb981e109 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG code should run
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 22b2908c985c786df7ec0561fdf27c97ac92a639..207556493e86d8e324927d2acca6ff74f4173303 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3699b9a141d47d72c6e0098cd5a4de70b64a11cf..68a3d811c7406b85bf7cddcb01bae3f8ebfc0aca 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index af8e056d97f7894b452d6800ab56f5320977a642..e5ec5943c0d1554b9a6e5ecb14da8b5ed4b56342 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 869d446268c9f2f235cc9b35512f677798607dc9..ba594a2c48212e072fb2daaa90d47f4a25e5001c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 821b0282550efc73bc666130a52b901566170958..24d6fdce8cedf738d0a017a89b2b31512cc13a29 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 463f21e941a0a70b5c6e8f7a318ac001c9724876..3b99da84d4ba1d6a0ae65397970314f5d08475f9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/p1.go && $G $D/$F.dir/p2.go
+// compiledir
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 45ee9082f0c277bc326124a397ca042ab145e99a..eefed0334b09f952df6b3030b8f635878f4bc7a0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // http://code.google.com/p/go/issues/detail?id=806
 // triggered out of registers on 8g
 
-package main
+package bug283
 
 type Point struct {
        x int
index bcf161e3de4e69cc8f8e31605f7c76bb4fa14c0a..68208085fa8c826e457c68fd81be268cf8ecc1f8 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7eed8fb7abc2c0824b8ffdb57c33a17a5442afc9..0a8a0f09e60deb9c2a1b79e6b32f774d5b76406e 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug285
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index eb678385610ebb713e0f48c52df9c687ea4ae08e..44f05153f48e4b4922f8f4926284144e1da0159f 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug286 failed
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a4a08eedc42f6633a05fd149445d1196aacbd2c3..2ed81c593df579d07718456f370536ee030ace2a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0105159d138d0aedb1d3c79f56a5923e4a8fc791..d2461e6a9f3c77ce1bdeafef9e650c9104fe7aca 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index f7180ff04c19fcf44d9744bf0f48f891f71812bc..3c6b68767a68640c17807eee33d615cc44f5ec20 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 80437c7f85614b41fc1faeca3537bb8347ba5586..c8ff0bc45d02e04e29694bbdb854c391d8234edd 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 09334c921121d3708ef6df370393f01ba4f06d7a..17a5483ef54f28f2e3d3b96269d558c95bdcc861 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 05852cd46ddd3cdecaa47eb3ef9ec0c5f9c07de7..07051dd3fbeb401dd55c65ae95421d3fbfff6850 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ca9b71a3acdeabc43d2a2389933b8081b1d78f6f..bf926f5a4dd14fba6df1f00ba88981a38e7aabc8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 18f45931c4bba3d165b73f8bb85b6dc503450f78..0f3e38098c592d8d113ef8f9cead105acda26d9b 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index fec2351f31b99e1ff597c92abd62113e8157f481..e2e5206ca1421501146ec3b61b09b51f21267aaa 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 46d8dbcfe4bf81f6ca4377e455df4d728b2c9791..a7c4e0c464eaa4b4d5245ec309134003dce3f0fa 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8767cdfea5459476f6075be3a57c5e660d9ddfd5..b5dfa8d878e196fc6391bc93caba01a160876f10 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c16c3f98af196a35d73ea52903e5356799af7446..bd362ace2d0e6fd51a0a0e0dd144a39bb83ea417 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1c7adb5f5b80327b6c6bf40372cabc5090d8633c..9646723bfda9f14571d475ad5d8a2a750b08d854 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 09ee3ab697f0fbaa35b4bb98c94fbde6ae85ebe1..1ef43a0ad0b532aa9443cc65343d9b6477ccb96f 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a58f4e13b14815131ae7a25ab260381af9d798d2..572668f19118ede6672ca6ee6838bb3da7843125 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug301.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index e9edb94ac8041c35eba1bb2918253b7ebbcb2fb6..dc7637fe52e5c820547697ea47bfc8d26cf903dc 100644 (file)
@@ -1,4 +1,7 @@
-// $G $D/bug302.dir/p.go && gopack grc pp.a p.$A && $G $D/bug302.dir/main.go
+// $G $D/bug302.dir/p.go && pack grc pp.a p.$A && $G $D/bug302.dir/main.go
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3bd790f136d6ad50097bc506c695454b0e88066b..94ca07e702fd6a9f20e3918749907a9f335a5e39 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index adcf08a35573fe616934f7345e8d185eb122e963..ad71b20f3852c38ecaaff768268a0b31f2cbb4bd 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 758fee2698acdb8934868f0a0e901775d1c2c60e..d0a4b24b877f4e19921d770f979661a68fa5982f 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a0a43507dcb88552bb4c63cf1bbc1f841b371d19..e8967c25ddcf6f0ffaa8a126eda29d5a65d0b890 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/p1.go && $G $D/$F.dir/p2.go
+// compiledir
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1b42c09ab1e3bcfcb5fe3874c0d960f966145e2d..64451252971b15b19db82fb1b48fbf8610ae703c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c2845f04213e733da9a628745d73df65b971c766..5bea5175b17c1c6d001d43d820d67219aed76ccf 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index d893916cd96ad5552402de20ff1675c63a368f84..948ca5c796dccd218986464ef4305cf3eb804b47 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // issue 1016
 
-package main
+package bug309
 
 func foo(t interface{}, c chan int) {
        switch v := t.(type) {
index ed937a674700d67b2b9494d821e89887bce047d3..edcd975963575eb71a5a126c7d84158db1783d56 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 70888dd410f7c412e559701ae6d637d0ba03eb15..c7c17e101189d4d39c919a282e8f2107c86f14e5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index eb2a0223b6caf0e6087f9873c825ca477c841af9..9009c5e8ffc401a4a794f06756cffaea846aec5d 100644 (file)
@@ -1,5 +1,8 @@
 // errchk $G -e $D/$F.dir/[ab].go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 95d81d7951e6187cd514ba5d602ff54003c9d9cd..6e26d14e1f5447be1f3b81c94e965b32db7ea1e2 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug314
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index c59ef29e6c031356d0ea0af2c356282890adaac6..7b8a9e5701296acda09d6ee1ab13be6a62628acb 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug315
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 2146408a1e285804126cb2301df57ee870b5ea80..e1374122d4673ec6f3d9a84149b62cb6faf78c80 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug316
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0cb26c29ba1154a67850b4c88283759183171783..3ff4dc4657eba9576b71bb34e6a9c1dcc0077a28 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug317
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9c46a04269cffee784f7d741c7a7083c455a6688..93de2d847108a9c49d3879cd15301044df07909c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index f60eee4fb2313256e1c29821480283748cdf394f..f8e959a3185cd7f6c144c5e26700dba099ce5f35 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 06d41f2ed87ee06e79eec86757fc30581ed0eec1..c2dd31b813170bd5c588d944c321668c567bf3db 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index d0595ff59b60b26e66e78fd6dd50da6641a2fe35..7d018271fc3afa958d98211128277f9a44714434 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug321
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ad0e62dc8c97c9046f1c877f0b8c9aece5b16ebc..401a8600a9e066c8b1a65fdd7f2a978acff3f4b2 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/lib.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: fails incorrectly
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 23e2be6603aaa14e7b0107d18a90d24825aefe68..9730ae5c8c60cbae4597b0e0915fe02d7410c4be 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3da75630acf28e68af7075b09e8f8c4639dfb0d0..ee090ae42f46232e80711a0a872c8bdc628d6889 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index b86740fff9342fedaa8e6be4af6f3f71de738131..6ccd0e3c820325096a7e1915d78301f1a1d37e0f 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7e123e3a39b6cdec7b88c701edeffaaad22eccfa..57f6471dc8ef2fd49ec87009eb1e7d2acbd1980f 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 4ba5f6072e8911abf48a5f47d25eb62894509bb1..0598d95d6820a6709bb26d429d706aefcda4bc3a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 825298371f969d03ab2e48e1ece03fb335f3afff..73ab46d4591ef232cc885c44aa5f5c135e3e3e11 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0b7074d62bae9f99accfbf10a65249cf075009f4..74fc78198b393372b1299de757f2367ba1952cf0 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 114492aff80ad182885bb951a4ff76fab813815a..ef6a0777fee6c27d157d21fcc6881466e0c1098c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 6c5acd1f4d9bb0a8be2fe53bfd443850f58dcef0..fac0e36289493ddce6370fb84bd9d9e242e0b405 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug331
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index be79286b819ca827bdf612ea70872bfdecf2f629..702779ba675d458b3f41d409d366d9e94e3a53ca 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 515c1f3fabd0aa6285b9f61d753838c64a2979b3..bb690f0e5b6e90790ab052c8bf36de1949f0e03e 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 870c9ae24fb43af7752e88daf8ca4c8754f32f1e..bd671696ba6896de85ab8b688d58271fc602117a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug334
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5a8112a9de33faf7a885a92856ed47024f6cbee2..256c110d703736c6763e855b108e5dd8a931a6d9 100644 (file)
@@ -4,6 +4,8 @@
 
 package a
 
-import "./b"
+type T interface{}
 
-var Bar = b.Foo
+func f() T { return nil }
+
+var Foo T = f()
index 7428c2a918a4ccb62d5ad4379d3a10b2ca315cbb..1474470d4ceba10846b69bbf0f173542676901cf 100644 (file)
@@ -4,8 +4,6 @@
 
 package b
 
-type T interface{}
+import "./a"
 
-func f() T { return nil }
-
-var Foo T = f()
+var Bar = a.Foo
index 915b746578ccbe3ba7d895a49c16f6c6baab4cd5..37c97d7b5e210592865cc3558e1b01c7942ad457 100644 (file)
@@ -1,5 +1,4 @@
-// $G $D/$F.dir/b.go && $G $D/$F.dir/a.go
-// rm -f a.$A b.$A
+// compiledir
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,4 +6,4 @@
 
 // Issue 1705.
 
-unused (see script at top of file)
+package ignored
index 8de36898f8c5b92c213d470fbfe281817d85d3df..fbf23207c2ee922bdfd389db196469d59ebcffc9 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ca9b4b45369504dc4a4b35a5c94ab4ee1ceabe80..38dc665fa68bb8f66dd9c9f92efa6018b63cebb1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c368a7fadc59c87a02f332ba30bd57125b75ac79..c2193fcc253a18dab721ceca52443a842248ddfc 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index eac7c5ee62363a97f5e463938e593659f6f61681..59921d41caba14ef4bb1655f5bf4a13b166ebd12 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 34cc013151f992ac2377042c43b2b6c3ef9341f7..d996ab64cd4fcfa73e944f7d9c4cd3170033437b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8ee52e1ef05409c76396f7f4da23b00eea2050df..db1af3eaa3839b7c1f03fc994df6c33468219cca 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug341
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 0852cdd34832ee1eeb28ae276c6c2fe32c2dd0e9..5f1efbdfe1e30838789c4f0a63c3ea31609b06ec 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index efc87e3d7a509ef6bc44e04f3d22dc7c6e4253b2..82201088b2887a35b4b6d5856085239984ed2079 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug343
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ce953f7f2f7e996ce399cab750861c8385680464..4a92624c7695e3d7ccfa9d65e11820c1b0859c15 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 874710ce88a57bf9ad822ce2daac64556dec409e..e3705f6c183586ae9af07d8e77e9ed8718629c5c 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/io.go && errchk $G -e $D/$F.dir/main.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 31284c31a1d8368a2ac45d3e6071c208efcbbc54..d9203aa43530b5bc1dffcabf2bdd6a19489533ef 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: issue2056
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5532cee83107c1cf944e9b6d46142f132b997d5b..08edf0f4ffb9a81e662f9fbef9d816fb92124c83 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1a539aa3e471ee3ed0fd1c5cf17e2e0a86898d3c..54a289a8de6823f39a53573b7e12c1feb82ffadd 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index e7612edb77e4f02b81d63ced2e48aebba91f4a6b..a3e6bd1619aefd655ed78bdbc09f20c16a687ffa 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index f8df3f58b96a88d2c55511cdb8bc220a5d00f391..5ce8996ffaacf569a0d04ebbc2fe3527f8ee79f2 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9625c6a501c0da50c099509b07b4297fda5b11be..4c5c7c32782595b9ce5267a9e507b72c8815de21 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 62fd006c423e5797000bde0e3609bd7dff18839c..1ae2d6139b74413754cfcd6f80bb42f198db19bc 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug352
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index b59d97f33842d822b285c0469e491a18436a177e..2a532c49115c7166075809dca55c8be6ea19ae72 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a95256e272e248637cf875e3332483e7cd2cc2ae..1245d91f5fde5cdfa6f952786fe543867434bc22 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug354
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // issue 2086
 // was calling makeclosure twice on the closure
 
-package main
+package bug354
 
 type Inner struct {
        F func() error
index a9cf0161b0d8fae6d4ffc9f7a75cf8c3b03b4a28..fcf859b7fccfb4d54c85ff39dec3e767794e5835 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index d21f0cfac61f95339b38470814462a6e27ef121e..273c5b8efc9024400a51a6ef51e44e4587b435ec 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug344
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 448d9826370618bdba84dc517c25a0bf57b4cb0c..2ac64a80b643e3858979b6328c24137932cbe360 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 82fbf7f8150f376cef4ebe923a2f64ddcbc738f5..6a008484f4f2bbac29c8b80caaca955182ba9469 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index d2a64bcef4744c479a24101b19e1c433e5d9138b..3e3b7c18187bfeb808db36c11faf93eac596173a 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug360
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index f38572c0d0f6050ccc17b6ad21436ce3844a5951..b888ccb44872629812dabe495550d36bb275ab24 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9347ec28b62d4460c85aa4b0dca9cb9c5d43024c..615c66865cbe15c93c63e0a0f5dffc7f55ff6d3a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a93312107e336515efde1fdbf20042d86edaef9e..64120d1643ca2b0baa161f177c6cd0c741809f4c 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index bc8c2c5e62c7d9a07b2d472f9064575b95a23494..795323bb3d2fbfe7379dc78cc0a98a152dcbd3a6 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8c000f50a931838dffe9d09017521679d26a56d7..33a1a5a7ebfc3337f0ca02972b4bb72584407bf1 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 21e9a5002c9c00266a1d2aec530f0558b78fb82c..c278e4dd95ff78799c91ca1032886dfb9ff6d9b0 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package main
 
 import (
index c8772d2d051543b217f55130aa0d74ec115905c4..2028f740ccdbe959c0501bf45cef7cb27a0e4935 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package p
 
 type T struct{ x int }
index 25d11a15318d1be22c91aa2b57fc60f25d2b2f9e..bf8edcd1b85e1bf13291479a4845865408df4919 100644 (file)
@@ -1,5 +1,8 @@
 // $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: should not fail
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 8d94f531c9bd8aa6e3cbb85ee135d67272ad0877..c38cc7fad79c63a68a90e028fbf4992cf01c8b36 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8eb23eecf16ecd6bc2d50d7d2f35a16fdfe5fb91..2ee8568e0441d2b7800cb8de9017f07708ad0424 100644 (file)
@@ -1,6 +1,9 @@
 // $G -N -o slow.$A $D/bug369.dir/pkg.go &&
 // $G -o fast.$A $D/bug369.dir/pkg.go &&
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9cb45f6e0dea549bd6e9f6395c2092bdef4700f4..246bc7c4e5b7e20159897aef4a2f7dcc8a03875f 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index bf993df068032e28461088cc080d1be245fe138c..6329e9635a2dadbaed3b2c59a475c7fcd4898c7e 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a6f7208bbd54ab5a3a448deeeb9ea996acde408f..34578565afa04c55b40dd36c591249eb1f9f8a41 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug372
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 934a6c7328c7d57586ca253053d423bc0e2dd1bc..e91f26d6ed054e4d92fe644d2f8a4b3aa59bbcf9 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index b55c5df4567ca77f1c66ea3abab451f1d9eb3448..4f0b721f24bcdf28e110e0b93bcf64dea0002d03 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 527358526375c779f2ebea4b873279a804823449..cb159b0d6be0a2aad5a7b2cae29f662ed6080736 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug375
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 1efbeecf21c1a6458c09937b671f4083ba63029e..5fbbc9cd444332ded2d7879c78c26aceaa9fcebd 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c9060756b1a4870408831f687c16daee97837190..e29b813a481d01fedae3e6db0eb4340e1b53e16e 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package one
 
 func Foo() (n int64, _ *int) {
index 8a5346ab72b0a03032cf23f5e627cf2ec28ee8ba..2a10812d56d0a558febeaf87b3b0ffdf53b7db1a 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 package two
 
 import _ "./one"
index e905e34d683f1e210db8a817c812bec2e16a4dc2..22df005b2a23708eec061a23c8816adc748b7683 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+// compiledir
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index b393b3dc1e9246d96f931047d495dfd357b49c0d..f3346c648dc6a480fe06026e18085824e6b34902 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug378
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3dd3d2983bd0869130cad19cbdc35e84c1df75de..81e9c266ee4f22130a1562033027b1616d15480c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 75b58064f5df3ecbd4a4db185a2a48237bb96b1d..96e1edecac8e24bc988f5657ddd7cde27827aafc 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 3f3232bf12f3afd1ba326ad81b373b2930b1412c..0253e1446bc821ba64bcd112a17641352d0c472d 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,14 +7,25 @@
 // Issue 2276.
 
 // Check that the error messages says 
-//     bug378.go:19: unsafe.Alignof(0) not used
+//     bug381.go:29: unsafe.Alignof(0) not used
 // and not
-//     bug378.go:19: 4 not used
+//     bug381.go:29: 4 not used
+
+// Issue 2768: previously got
+//    bug381.go:30: cannot use 3 (type time.Weekday) as type int in function argument
+// want
+//    bug381.go:30: cannot use time.Wednesday (type time.Weekday) as type int in function argument
 
 package main
 
-import "unsafe"
+import (
+       "time"
+       "unsafe"
+)
+
+func f(int)
 
 func main() {
        unsafe.Alignof(0) // ERROR "unsafe\.Alignof|value computed is not used"
+       f(time.Wednesday) // ERROR "time.Wednesday|incompatible type"
 }
index 6212fbf507c3e355ab2c05832aae284850bb1e10..10c71d46624ff8fbf9f2b50120a9103c7a95a61a 100644 (file)
@@ -1,5 +1,12 @@
 // $G $D/$F.dir/pkg.go && $G $D/$F.go || echo "Bug 382"
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file
+
 // Issue 2529
 
 package main
index 181a897b63d42f82b96db769f67e2be468591498..503779c3772de6060a217878c0cfa1ffdd744528 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index b3d646688293197b9831f407b847695f5bfa75d6..0233c197c4e9ce4d46d18aea8dde63085770e2c1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a009f664e09d48da94ad0375ac4725cb7cf4840c..5ac4136e7dc56ade92039e23e24daa8019d46823 100644 (file)
@@ -1,4 +1,7 @@
-// [ $O == 6 ] || errchk $G -e $D/$F.go
+// [ $A == 6 ] || errchk $G -e $D/$F.go
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 701be0d09ac6ec33a4721025418115fb0965a1eb..8c7b9d52081f237633a7ff77e5649218dc776f1e 100644 (file)
@@ -1,4 +1,7 @@
-// [ $O != 6 ]  || errchk $G -e $D/$F.go
+// [ $A != 6 ]  || errchk $G -e $D/$F.go
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -8,7 +11,7 @@
 
 package main
 func main() {  // ERROR "stack frame too large"
-       var arr [1000200030]int
+       var arr [1000200030]int32
        arr_bkup := arr
        _ = arr_bkup
 }
index b42c07073b03946c4ad58ab9dea057b82002fa3b..ec358bd36e40ca690b78d0367954b2ae068733ea 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c9db4aea89fc6a8c5a142a23c456dd674d942044..59d5ef903845d49165e2babe4d4094464c2692b8 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo "Bug387"
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index c17fd7ca23a1dbcb5fb4eccbe0118f70b9fc1048..d41f9ea543c525062a5e1972597535c8d8d2ed11 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ecbbbdd585e8fe4c04ac34e1f127ab3014b38d9d..55a02e05c0705c97e5da03c6a050be2456d4f3c3 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 31c4dd40babb829eef8dc13350c5c535c00451ef..7ce9e137035a4a679728f710b98d3129e96c1e9a 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 81507188b23439a8fed28eab37bf9b1f7a575bc4..07d129ddc4804ba002faebe938a19144c1b4f9b6 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo "Issue2576"
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a7017255e5a1aa198236fcc2514c7c1e0849bbff..8242f284620720e4edfd6d1ed52e8eca7f17b4e6 100644 (file)
@@ -20,3 +20,24 @@ func F3() (ret []int) { return append(ret, 1) }
 // Call of inlined method with blank receiver.
 func (_ *T) M() int { return 1 }
 func (t *T) MM() int { return t.M() }
+
+
+// One more like issue 2678
+type S struct { x, y int }
+type U []S
+
+func F4(S int) U { return U{{S,S}} }
+
+func F5() []*S {
+       return []*S{ {1,2}, { 3, 4} }
+}
+
+func F6(S int) *U {
+       return &U{{S,S}}
+}
+
+// Bug in the fix.
+
+type PB struct { x int }
+
+func (t *PB) Reset() { *t = PB{} }
similarity index 83%
rename from gcc/testsuite/go.test/test/fixedbugs/bug392.dir/two.go
rename to gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg2.go
index b0ce26d39abadef65dfcadbb00e5e4990747c070..8320b2fffa2e23a0cc35095f9dd0458f773eb132 100644 (file)
@@ -5,7 +5,7 @@
 // Use the functions in one.go so that the inlined
 // forms get type-checked.
 
-package two
+package pkg2
 
 import "./one"
 
@@ -13,8 +13,13 @@ func use() {
        one.F1(nil)
        one.F2(nil)
        one.F3()
+       one.F4(1)
 
        var t *one.T
        t.M()
        t.MM()
 }
+
+var V = []one.PB{{}, {}}
+
+func F() *one.PB
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go
new file mode 100644 (file)
index 0000000..402c3b0
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in pkg2.go so that the inlined
+// forms get type-checked.
+
+package pkg3
+
+import "./pkg2"
+
+var x = pkg2.F()
+var v = pkg2.V
index 50af6006fbe698c60458fbbcf1a8c53ff68acafd..48b79e01b894a128edb9c5c4a839674a5ead3156 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+// compiledir
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index e21b9c4a416dbbc9d0aa6f7ea4ee2be76730f31d..f8a9c657819ddc37065ff595ac7c88c55febecb4 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug393
+// compile
 
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // issue 2672
 // was trying binary search with an interface type
 
-package main
+package bug393
 
 func f(x interface{}) int {
        switch x {
index 42c20e7a9188c797922389d47ef38e178489e15e..2d77156c1aeccd650347d16df2751c0617e2d6c1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7902a07d535057966a1f9c558678666bc9b9396d..96a1dd7dc26ee9607a9cf40c3707300989e3170c 100644 (file)
@@ -4,6 +4,7 @@
 
 package one
 
+// Issue 2687
 type T struct { int }
 
 func New(i int) T { return T{i} }
index 50af6006fbe698c60458fbbcf1a8c53ff68acafd..48b79e01b894a128edb9c5c4a839674a5ead3156 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+// compiledir
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
index 03957013023af0051c2962c0ba0a8452fded3d26..56cc7cdd4d47b683043447f7c3867caa2d358970 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug398.go b/gcc/testsuite/go.test/test/fixedbugs/bug398.go
new file mode 100644 (file)
index 0000000..1dd3fa4
--- /dev/null
@@ -0,0 +1,24 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Used to crash compiler in interface type equality check.
+
+package p
+
+type I1 interface {
+      F() interface{I1}
+}
+
+type I2 interface {
+      F() interface{I2}
+}       
+
+var v1 I1
+var v2 I2
+
+func f() bool {
+       return v1 == v2
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug399.go b/gcc/testsuite/go.test/test/fixedbugs/bug399.go
new file mode 100644 (file)
index 0000000..94852c9
--- /dev/null
@@ -0,0 +1,15 @@
+// compile
+
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2674
+
+package main
+const dow = "\000\003"
+
+func main() {
+       println(int(dow[1]))
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug401.go b/gcc/testsuite/go.test/test/fixedbugs/bug401.go
new file mode 100644 (file)
index 0000000..5589b5b
--- /dev/null
@@ -0,0 +1,46 @@
+// run
+
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2582
+package main
+
+type T struct{}
+
+func (T) cplx() complex128 {
+       for false {
+       } // avoid inlining
+       return complex(1, 0)
+}
+
+func (T) cplx2() complex128 {
+       return complex(0, 1)
+}
+
+type I interface {
+       cplx() complex128
+}
+
+func main() {
+
+       var t T
+
+       if v := real(t.cplx()); v != 1 {
+               panic("not-inlined complex call failed")
+       }
+       _ = imag(t.cplx())
+
+       _ = real(t.cplx2())
+       if v := imag(t.cplx2()); v != 1 {
+               panic("potentially inlined complex call failed")
+       }
+
+       var i I
+       i = t
+       if v := real(i.cplx()); v != 1 {
+               panic("potentially inlined complex call failed")
+       }
+       _ = imag(i.cplx())
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug402.go b/gcc/testsuite/go.test/test/fixedbugs/bug402.go
new file mode 100644 (file)
index 0000000..db3f3da
--- /dev/null
@@ -0,0 +1,31 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+var a = []int64{
+       0.0005 * 1e9,
+       0.001 * 1e9,
+       0.005 * 1e9,
+       0.01 * 1e9,
+       0.05 * 1e9,
+       0.1 * 1e9,
+       0.5 * 1e9,
+       1 * 1e9,
+       5 * 1e9,
+}
+
+func main() {
+       s := ""
+       for _, v := range a {
+               s += fmt.Sprint(v) + " "
+       }
+       if s != "500000 1000000 5000000 10000000 50000000 100000000 500000000 1000000000 5000000000 " {
+               panic(s)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug403.go b/gcc/testsuite/go.test/test/fixedbugs/bug403.go
new file mode 100644 (file)
index 0000000..ed7b49a
--- /dev/null
@@ -0,0 +1,23 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Crashed gccgo.
+
+package p
+
+type S struct {
+       f interface{}
+}
+
+func F(p *S) bool {
+       v := p.f
+       switch a := v.(type) {
+       case nil:
+               _ = a
+               return true
+       }
+       return true
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go
new file mode 100644 (file)
index 0000000..2024eb0
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+type T1 int
+type T2 []T1
+type T3 T2
+
+func F1(T2) {
+}
+
+func (p *T1) M1() T3 {
+       return nil
+}
+
+func (p T3) M2() {
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go
new file mode 100644 (file)
index 0000000..162eae7
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// The gccgo compiler would fail on the import statement.
+// two.go:10:13: error: use of undefined type ‘one.T2’
+
+package two
+
+import "./one"
+
+var V one.T3
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.go
new file mode 100644 (file)
index 0000000..481acda
--- /dev/null
@@ -0,0 +1,7 @@
+// compiledir
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug405.go b/gcc/testsuite/go.test/test/fixedbugs/bug405.go
new file mode 100644 (file)
index 0000000..e8ecc4d
--- /dev/null
@@ -0,0 +1,24 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test using _ receiver.  Failed with gccgo.
+
+package main
+
+type S struct {}
+
+func (_ S) F(i int) int {
+       return i
+}
+
+func main() {
+       s := S{}
+       const c = 123
+       i := s.F(c)
+       if i != c {
+               panic(i)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug406.go b/gcc/testsuite/go.test/test/fixedbugs/bug406.go
new file mode 100644 (file)
index 0000000..c6f8534
--- /dev/null
@@ -0,0 +1,25 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2821
+package main
+
+type matrix struct {
+       e []int
+}
+
+func (a matrix) equal() bool {
+       for _ = range a.e {
+       }
+       return true
+}
+
+func main() {
+       var a matrix
+       var i interface{}
+       i = true && a.equal()
+       _ = i
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go
new file mode 100644 (file)
index 0000000..a91d904
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+// Issue 2877
+type T struct {
+       f func(t *T, arg int)
+       g func(t T, arg int)
+}
+
+func (t *T) foo(arg int) {}
+func (t T) goo(arg int) {}
+
+func (t *T) F() { t.f = (*T).foo }
+func (t *T) G() { t.g = T.goo }
+
+
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go
new file mode 100644 (file)
index 0000000..67e1852
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+       var r one.T
+       r.F()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.go
new file mode 100644 (file)
index 0000000..48b79e0
--- /dev/null
@@ -0,0 +1,7 @@
+// compiledir
+
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug409.go b/gcc/testsuite/go.test/test/fixedbugs/bug409.go
new file mode 100644 (file)
index 0000000..1dca43b
--- /dev/null
@@ -0,0 +1,20 @@
+// cmpout
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Multiple inlined calls to a function that causes
+// redundant address loads.
+
+package main
+
+func F(v [2]float64) [2]float64 {
+       return [2]float64{v[0], v[1]}
+}
+
+func main() {
+       a := F([2]float64{1, 2})
+       b := F([2]float64{3, 4})
+       println(a[0], a[1], b[0], b[1])
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug409.out b/gcc/testsuite/go.test/test/fixedbugs/bug409.out
new file mode 100644 (file)
index 0000000..3cb40ed
--- /dev/null
@@ -0,0 +1 @@
++1.000000e+000 +2.000000e+000 +3.000000e+000 +4.000000e+000
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug410.go b/gcc/testsuite/go.test/test/fixedbugs/bug410.go
new file mode 100644 (file)
index 0000000..35ecbfc
--- /dev/null
@@ -0,0 +1,24 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Used to run 6g out of registers.  Issue 2669.
+
+package p
+
+type y struct {
+       num int
+}
+
+func zzz () {
+    k := make([]byte, 10)
+       arr := make ([]*y, 0)
+    for s := range arr {
+        x := make([]byte, 10)
+        for i := 0; i < 100 ; i++ {
+            x[i] ^= k[i-arr[s].num%0]
+        }
+    }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug411.go b/gcc/testsuite/go.test/test/fixedbugs/bug411.go
new file mode 100644 (file)
index 0000000..3b90db8
--- /dev/null
@@ -0,0 +1,19 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2588.  Used to trigger internal compiler error on 8g,
+// because the compiler tried to registerize the int64 being
+// used as a memory operand of a int64->float64 move.
+
+package p
+
+func f1(a int64) {
+       f2(float64(a), float64(a))
+}
+
+func f2(a,b float64) {
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug412.go b/gcc/testsuite/go.test/test/fixedbugs/bug412.go
new file mode 100644 (file)
index 0000000..8dd0a5f
--- /dev/null
@@ -0,0 +1,16 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type t struct {
+       x int  // ERROR "duplicate field x|duplicate field name .x."
+       x int
+}
+
+func f(t *t) int {
+       return t.x  // GC_ERROR "ambiguous selector t.x"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug413.go b/gcc/testsuite/go.test/test/fixedbugs/bug413.go
new file mode 100644 (file)
index 0000000..ba80464
--- /dev/null
@@ -0,0 +1,11 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+func f(i int) int { return i }
+
+var i = func() int {a := f(i); return a}()  // ERROR "initialization loop|depends upon itself"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go
new file mode 100644 (file)
index 0000000..5200123
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+         package main
+       
+         import "./p1"
+       
+         type MyObject struct {
+           p1.Fer
+         }
+       
+         func main() {
+           var b p1.Fer = &p1.Object{}
+           p1.PrintFer(b)
+           var c p1.Fer = &MyObject{b}
+           p1.PrintFer(c)
+         }
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go
new file mode 100644 (file)
index 0000000..7768818
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+         package p1
+       
+         import "fmt"
+       
+         type Fer interface {
+           f() string
+         }
+       
+         type Object struct {}
+       
+         func (this *Object) f() string {
+           return "Object.f"
+         }
+       
+         func PrintFer(fer Fer) {
+           fmt.Sprintln(fer.f())
+         }
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.go
new file mode 100644 (file)
index 0000000..5612fd5
--- /dev/null
@@ -0,0 +1,10 @@
+// $G $D/$F.dir/p1.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go
new file mode 100644 (file)
index 0000000..b4152d6
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type A struct {
+       s struct{int}
+}
+
+func (a *A) f() {
+       a.s = struct{int}{0}
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go
new file mode 100644 (file)
index 0000000..b894453
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+import "./p"
+func main() {}
+var _ p.A
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.go
new file mode 100644 (file)
index 0000000..8cd4c49
--- /dev/null
@@ -0,0 +1,9 @@
+// compiledir
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2716.  Export metadata error made main.go not compile.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug416.go b/gcc/testsuite/go.test/test/fixedbugs/bug416.go
new file mode 100644 (file)
index 0000000..1d24fa9
--- /dev/null
@@ -0,0 +1,13 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type T struct {
+       X int
+}
+
+func (t *T) X() {} // ERROR "type T has both field and method named X|redeclares struct field name"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug417.go b/gcc/testsuite/go.test/test/fixedbugs/bug417.go
new file mode 100644 (file)
index 0000000..a9acb42
--- /dev/null
@@ -0,0 +1,32 @@
+// compile
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Some indirect uses of types crashed gccgo, because it assumed that
+// the size of the type was known before it had been computed.
+
+package p
+
+type S1 struct {
+       p *[1]S3
+       s [][1]S3
+       m map[int][1]S3
+       c chan [1]S3
+       i interface { f([1]S3) [1]S3 }
+       f func([1]S3) [1]S3
+}
+
+type S2 struct {
+       p *struct { F S3 }
+       s []struct { F S3 }
+       m map[int]struct { F S3 }
+       c chan struct { F S3 }
+       i interface { f(struct { F S3 }) struct { F S3 } }
+       f func(struct { F S3 } ) struct { F S3 }
+}
+
+type S3 struct {
+       I int
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug418.go b/gcc/testsuite/go.test/test/fixedbugs/bug418.go
new file mode 100644 (file)
index 0000000..64d86b3
--- /dev/null
@@ -0,0 +1,22 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3044.
+// Multiple valued expressions in return lists.
+
+package p
+
+func Two() (a, b int)
+
+// F used to compile.
+func F() (x interface{}, y int) {
+       return Two(), 0 // ERROR "single-value context"
+}
+
+// Recursive used to trigger an internal compiler error.
+func Recursive() (x interface{}, y int) {
+       return Recursive(), 0 // ERROR "single-value context"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug419.go b/gcc/testsuite/go.test/test/fixedbugs/bug419.go
new file mode 100644 (file)
index 0000000..cfab404
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1811.
+// gccgo failed to compile this.
+
+package p
+
+type E interface{}
+
+type I interface {
+       E
+       E
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug420.go b/gcc/testsuite/go.test/test/fixedbugs/bug420.go
new file mode 100644 (file)
index 0000000..02b4349
--- /dev/null
@@ -0,0 +1,14 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1757.
+// gccgo failed to compile this.
+
+package main
+
+func main() {
+     (_) = 0
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug421.go b/gcc/testsuite/go.test/test/fixedbugs/bug421.go
new file mode 100644 (file)
index 0000000..1fe0237
--- /dev/null
@@ -0,0 +1,17 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1927.
+// gccgo failed to issue the first error below.
+
+package main
+
+func main() {
+       println(int(1) == uint(1))      // ERROR "types"
+       var x int = 1
+       var y uint = 1
+       println(x == y)                 // ERROR "types"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug422.go b/gcc/testsuite/go.test/test/fixedbugs/bug422.go
new file mode 100644 (file)
index 0000000..6865fe4
--- /dev/null
@@ -0,0 +1,11 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo crashed compiling this file.
+
+package p
+
+var V = "a" > "b"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug423.go b/gcc/testsuite/go.test/test/fixedbugs/bug423.go
new file mode 100644 (file)
index 0000000..7268912
--- /dev/null
@@ -0,0 +1,277 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gc used to overflow a counter when a variable was
+// mentioned 256 times, and generate stack corruption.
+
+package main
+
+func main() {
+       F(1)
+}
+
+func F(arg int) {
+       var X interface{}
+       _ = X // used once
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 32 times
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 64 times
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 96 times
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 128 times
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 200 times
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0
+       X = 0 // used 256 times
+       if arg != 1 {
+               panic("argument was changed")
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go b/gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go
new file mode 100644 (file)
index 0000000..97054da
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package lib
+
+type I interface {
+       m() string
+}
+
+type T struct{}
+
+// m is not accessible from outside this package.
+func (t *T) m() string {
+       return "lib.T.m"
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug424.go b/gcc/testsuite/go.test/test/fixedbugs/bug424.go
new file mode 100644 (file)
index 0000000..4152454
--- /dev/null
@@ -0,0 +1,102 @@
+// $G $D/$F.dir/lib.go && $G $D/$F.go && $L $F.$A && ./$A.out
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Tests that method calls through an interface always
+// call the locally defined method localT.m independent
+// at which embedding level it is and in which order
+// embedding is done.
+
+package main
+
+import "./lib"
+import "reflect"
+import "fmt"
+
+type localI interface {
+       m() string
+}
+
+type localT struct{}
+
+func (t *localT) m() string {
+       return "main.localT.m"
+}
+
+type myT1 struct {
+       localT
+}
+
+type myT2 struct {
+       localT
+       lib.T
+}
+
+type myT3 struct {
+       lib.T
+       localT
+}
+
+func main() {
+       var i localI
+
+       i = new(localT)
+       if i.m() != "main.localT.m" {
+               println("BUG: localT:", i.m(), "called")
+       }
+
+       i = new(myT1)
+       if i.m() != "main.localT.m" {
+               println("BUG: myT1:", i.m(), "called")
+       }
+
+       i = new(myT2)
+       if i.m() != "main.localT.m" {
+               println("BUG: myT2:", i.m(), "called")
+       }
+
+       t3 := new(myT3)
+       if t3.m() != "main.localT.m" {
+               println("BUG: t3:", t3.m(), "called")
+       }
+       
+       i = new(myT3)
+       if i.m() != "main.localT.m" {
+               t := reflect.TypeOf(i)
+               n := t.NumMethod()
+               for j := 0; j < n; j++ {
+                       m := t.Method(j)
+                       fmt.Printf("#%d: %s.%s %s\n", j, m.PkgPath, m.Name, m.Type)
+               }
+               println("BUG: myT3:", i.m(), "called")
+       }
+       
+       var t4 struct {
+               localT
+               lib.T
+       }
+       if t4.m() != "main.localT.m" {
+               println("BUG: t4:", t4.m(), "called")
+       }
+       i = &t4
+       if i.m() != "main.localT.m" {
+               println("BUG: myT4:", i.m(), "called")
+       }
+       
+       var t5 struct {
+               lib.T
+               localT
+       }
+       if t5.m() != "main.localT.m" {
+               println("BUG: t5:", t5.m(), "called")
+       }
+       i = &t5
+       if i.m() != "main.localT.m" {
+               println("BUG: myT5:", i.m(), "called")
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug425.go b/gcc/testsuite/go.test/test/fixedbugs/bug425.go
new file mode 100644 (file)
index 0000000..5546bd9
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// http://code.google.com/p/go/issues/detail?id=3119
+
+package main
+
+import "fmt"
+
+func main() {
+       s := "hello"
+       fmt.Println(s == "")
+       fmt.Println(s + "world" == "world")
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug426.go b/gcc/testsuite/go.test/test/fixedbugs/bug426.go
new file mode 100644 (file)
index 0000000..a1af3cf
--- /dev/null
@@ -0,0 +1,15 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo crashed compiling this.
+
+package p
+
+type T *T
+
+func f(t T) {
+       println(t, *t)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug427.go b/gcc/testsuite/go.test/test/fixedbugs/bug427.go
new file mode 100644 (file)
index 0000000..1239e7a
--- /dev/null
@@ -0,0 +1,39 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// http://code.google.com/p/go/issues/detail?id=3351
+
+package main
+
+// struct with four fields of basic type
+type S struct {a, b, c, d int}
+
+// struct with five fields of basic type
+type T struct {a, b, c, d, e int}
+
+// array with four elements
+type A [4]int
+
+// array with five elements
+type B [5]int
+
+func main() {
+       var i interface{}
+
+       var s1, s2 S
+       i = s1 == s2
+
+       var t1, t2 T
+       i = t1 == t2
+
+       var a1, a2 A
+       i = a1 == a2
+
+       var b1, b2 B
+       i = b1 == b2
+
+       _ = i
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug428.go b/gcc/testsuite/go.test/test/fixedbugs/bug428.go
new file mode 100644 (file)
index 0000000..298c455
--- /dev/null
@@ -0,0 +1,19 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that when the compiler expands append inline it does not
+// overwrite a value before it needs it (issue 3369).
+
+package main
+
+func main() {
+       s := make([]byte, 5, 6)
+       copy(s, "12346")
+       s = append(s[:len(s)-1], '5', s[len(s)-1])
+       if string(s) != "123456" {
+               panic(s)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug429.go b/gcc/testsuite/go.test/test/fixedbugs/bug429.go
new file mode 100644 (file)
index 0000000..794d293
--- /dev/null
@@ -0,0 +1,16 @@
+// $G $D/$F.go && $L $F.$A && ! ./$A.out || echo BUG: bug429
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Should print deadlock message, not hang.
+
+package main
+
+func main() {
+       select {}
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug430.go b/gcc/testsuite/go.test/test/fixedbugs/bug430.go
new file mode 100644 (file)
index 0000000..93d5cf2
--- /dev/null
@@ -0,0 +1,22 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo crashed compiling this.
+
+package main
+
+type S struct {
+       f [2][]int
+}
+
+func F() (r [2][]int) {
+       return
+}
+
+func main() {
+       var a []S
+       a[0].f = F()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug431.go b/gcc/testsuite/go.test/test/fixedbugs/bug431.go
new file mode 100644 (file)
index 0000000..1057dad
--- /dev/null
@@ -0,0 +1,18 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo gave an invalid error ("floating point constant truncated to
+// integer") compiling this.
+
+package p
+
+const C = 1<<63 - 1
+
+func F(i int64) int64 {
+       return i
+}
+
+var V = F(int64(C) / 1e6)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug432.go b/gcc/testsuite/go.test/test/fixedbugs/bug432.go
new file mode 100644 (file)
index 0000000..0c1a914
--- /dev/null
@@ -0,0 +1,13 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo crashed compiling this.
+
+package p
+
+var v struct{ I }
+
+type I interface{}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug433.go b/gcc/testsuite/go.test/test/fixedbugs/bug433.go
new file mode 100644 (file)
index 0000000..1139dfa
--- /dev/null
@@ -0,0 +1,39 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that initializing struct fields out of order still runs
+// functions in the right order.  This failed with gccgo.
+
+package main
+
+type S struct {
+       i1, i2, i3 int
+}
+
+var G int
+
+func v(i int) int {
+       if i != G {
+               panic(i)
+       }
+       G = i + 1
+       return G
+}
+
+func F() S {
+       return S{
+               i1: v(0),
+               i3: v(1),
+               i2: v(2),
+       }
+}
+
+func main() {
+       s := F()
+       if s != (S{1, 3, 2}) {
+               panic(s)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug434.go b/gcc/testsuite/go.test/test/fixedbugs/bug434.go
new file mode 100644 (file)
index 0000000..5abb567
--- /dev/null
@@ -0,0 +1,32 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that typed and untyped negative zero floating point constants
+// are treated as equivalent to zero constants.
+
+package main
+
+import "math"
+
+const zero = 0.0
+
+func main() {
+       x := -zero
+       b := math.Float64bits(x)
+       if b != 0 {
+               panic(b)
+       }
+       x = -float64(zero)
+       b = math.Float64bits(x)
+       if b != 0 {
+               panic(b)
+       }
+       v := x
+       b = math.Float64bits(-v)
+       if b != 0x8000000000000000 {
+               panic(b)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug435.go b/gcc/testsuite/go.test/test/fixedbugs/bug435.go
new file mode 100644 (file)
index 0000000..9c30b14
--- /dev/null
@@ -0,0 +1,15 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that a syntax error caused by an unexpected EOF
+// gives an error message with the correct line number.
+//
+// https://code.google.com/p/go/issues/detail?id=3392
+
+package main
+
+func foo() {
+       bar(1, // ERROR "unexpected|missing|undefined"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug436.go b/gcc/testsuite/go.test/test/fixedbugs/bug436.go
new file mode 100644 (file)
index 0000000..e848eae
--- /dev/null
@@ -0,0 +1,32 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Gccgo used to crash compiling this.
+
+package main
+
+func foo() (int, int) {
+       return 1, 2
+}
+
+var c = b
+var a, b = foo()
+var d = b + 1
+
+func main() {
+       if a != 1 {
+               panic(a)
+       }
+       if b != 2 {
+               panic(b)
+       }
+       if c != 2 {
+               panic(c)
+       }
+       if d != 3 {
+               panic(d)
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go
new file mode 100644 (file)
index 0000000..8d3caad
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+type I1 interface {
+       f()
+}
+
+type S1 struct {
+}
+
+func (s S1) f() {
+}
+
+func F1(i1 I1) {
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go
new file mode 100644 (file)
index 0000000..406dd59
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package two
+
+import "./one"
+
+type S2 struct {
+       one.S1
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.go
new file mode 100644 (file)
index 0000000..b1e76a6
--- /dev/null
@@ -0,0 +1,30 @@
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.go && $L $F.$A && ./$A.out
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test converting a type defined in a different package to an
+// interface defined in a third package, where the interface has a
+// hidden method.  This used to cause a link error with gccgo.
+
+package main
+
+import (
+       "./one"
+       "./two"
+)
+
+func F(i1 one.I1) {
+       switch v := i1.(type) {
+       case two.S2:
+               one.F1(v)
+       }
+}
+
+func main() {
+       F(nil)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug438.go b/gcc/testsuite/go.test/test/fixedbugs/bug438.go
new file mode 100644 (file)
index 0000000..15d3fda
--- /dev/null
@@ -0,0 +1,16 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Gccgo used to incorrectly give an error when compiling this.
+
+package p
+
+func F() (i int) {
+       for first := true; first; first = false {
+               i++
+       }
+       return
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug439.go b/gcc/testsuite/go.test/test/fixedbugs/bug439.go
new file mode 100644 (file)
index 0000000..87d4ae0
--- /dev/null
@@ -0,0 +1,22 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Gccgo used to crash compiling this.
+
+package p
+
+type E int
+
+func (e E) P() *E { return &e }
+
+const (
+       C1 E = 0
+       C2 = C1
+)
+
+func F() *E {
+       return C2.P()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug440_32.go b/gcc/testsuite/go.test/test/fixedbugs/bug440_32.go
new file mode 100644 (file)
index 0000000..2d26fbb
--- /dev/null
@@ -0,0 +1,21 @@
+// run
+
+// Test for 8g register move bug.  The optimizer gets confused
+// about 16- vs 32-bit moves during splitContractIndex.
+
+// Issue 3910.
+
+package main
+
+func main() {
+       const c = 0x12345678
+       index, n, offset := splitContractIndex(c)
+       if index != int((c&0xffff)>>5) || n != int(c&(1<<5-1)) || offset != (c>>16)&(1<<14-1) {
+               println("BUG", index, n, offset)
+       }
+}
+
+func splitContractIndex(ce uint32) (index, n, offset int) {
+       h := uint16(ce)
+       return int(h >> 5), int(h & (1<<5 - 1)), int(ce>>16) & (1<<14 - 1)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug440_64.go b/gcc/testsuite/go.test/test/fixedbugs/bug440_64.go
new file mode 100644 (file)
index 0000000..3ab3e56
--- /dev/null
@@ -0,0 +1,21 @@
+// run
+
+// Test for 6g register move bug.  The optimizer gets confused
+// about 32- vs 64-bit moves during splitContractIndex.
+
+// Issue 3918.
+
+package main
+
+func main() {
+       const c = 0x123400005678
+       index, offset := splitContractIndex(c)
+       if index != (c&0xffffffff)>>5 || offset != c+1 {
+               println("BUG", index, offset)
+       }
+}
+
+func splitContractIndex(ce uint64) (index uint32, offset uint64) {
+       h := uint32(ce)
+       return h >> 5, ce + 1
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug441.go b/gcc/testsuite/go.test/test/fixedbugs/bug441.go
new file mode 100644 (file)
index 0000000..8562bfe
--- /dev/null
@@ -0,0 +1,36 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Was discarding function calls made for arguments named _
+// in inlined functions.  Issue 3593.
+
+package main
+
+var did int
+
+func main() {
+       foo(side())
+       foo2(side(), side())
+       foo3(side(), side())
+       T.m1(T(side()))
+       T(1).m2(side())
+       const want = 7
+       if did != want {
+               println("BUG: missing", want-did, "calls")
+       }
+}
+
+func foo(_ int) {}
+func foo2(_, _ int) {}
+func foo3(int, int) {}
+type T int
+func (_ T) m1() {}
+func (t T) m2(_ int) {}
+
+func side() int {
+       did++
+       return 1
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug442.go b/gcc/testsuite/go.test/test/fixedbugs/bug442.go
new file mode 100644 (file)
index 0000000..1d1a948
--- /dev/null
@@ -0,0 +1,27 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Used to crash generating hash and == functions for struct
+// with leading _ field.  Issue 3607.
+
+package main
+
+type T struct {
+       _ int
+       X interface{}
+       _ string
+       Y float64
+}
+
+func main() {
+       m := map[T]int{}
+       m[T{X: 1, Y: 2}] = 1
+       m[T{X: 2, Y: 3}] = 2
+       m[T{X: 1, Y: 2}] = 3  // overwrites first entry
+       if len(m) != 2 {
+               println("BUG")
+       }
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug443.go b/gcc/testsuite/go.test/test/fixedbugs/bug443.go
new file mode 100644 (file)
index 0000000..b67bd8c
--- /dev/null
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Was failing to compile with 'invalid receiver' due to
+// incomplete type definition evaluation.  Issue 3709.
+
+package p
+
+type T1 struct { F *T2 }
+type T2 T1
+
+type T3 T2
+func (*T3) M()  // was invalid receiver
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug444.go b/gcc/testsuite/go.test/test/fixedbugs/bug444.go
new file mode 100644 (file)
index 0000000..b54fb4f
--- /dev/null
@@ -0,0 +1,36 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// The no-op conversion here used to confuse the compiler
+// into doing a load-effective-address of nil.
+// See issue 3670.
+
+package main
+
+import "reflect"
+
+type T interface {}
+
+var x bool
+
+func main() {
+        reflect.TypeOf(nil)
+        reflect.TypeOf(T(nil)) // used to miscompile
+        shouldPanic()
+}
+
+func f() byte {
+       return []byte(nil)[0] // used to miscompile
+}
+
+func shouldPanic() {
+       defer func() {
+               if recover() == nil {
+                       panic("not panicking")
+               }
+       }()
+       f()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug445.go b/gcc/testsuite/go.test/test/fixedbugs/bug445.go
new file mode 100644 (file)
index 0000000..497ecd3
--- /dev/null
@@ -0,0 +1,14 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3765
+
+package main
+
+func f(x uint) uint {
+       m := ^(1 << x)
+       return uint(m)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug446.go b/gcc/testsuite/go.test/test/fixedbugs/bug446.go
new file mode 100644 (file)
index 0000000..1e435e1
--- /dev/null
@@ -0,0 +1,36 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3824.
+// Method calls are ignored when deciding initialization
+// order.
+
+package main
+
+type T int
+
+func (r T) Method1() int { return a }
+func (r T) Method2() int { return b }
+
+// dummy1 and dummy2 must be initialized after a and b.
+var dummy1 = T(0).Method1()
+var dummy2 = T.Method2(0)
+
+// Use a function call to force generating code.
+var a = identity(1)
+var b = identity(2)
+
+func identity(a int) int { return a }
+
+func main() {
+       if dummy1 != 1 {
+               panic("dummy1 != 1")
+       }
+       if dummy2 != 2 {
+               panic("dummy2 != 2")
+       }
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug447.go b/gcc/testsuite/go.test/test/fixedbugs/bug447.go
new file mode 100644 (file)
index 0000000..a4c871b
--- /dev/null
@@ -0,0 +1,105 @@
+// runoutput
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3804
+// test all possible float -> integer conversions
+
+package main
+
+import (
+       "bytes"
+       "fmt"
+       "strings"
+)
+
+var (
+       intWidths = []int{8, 16, 32, 64} // int%d and uint%d
+       floatWidths = []int{32, 64} // float%d
+)
+
+func main() {
+
+       var names, funcs bytes.Buffer
+
+       for _, iWidth := range intWidths {
+               for _, typ := range []string{"int", "uint"} {
+                       var segs bytes.Buffer
+                       itype := fmt.Sprintf("%s%d", typ, iWidth)
+                       names.WriteString("\ttest" + itype + ",\n")
+                       for _, fWidth := range floatWidths {
+                               ftype := fmt.Sprintf("float%d", fWidth)
+                               seg := strings.Replace(testSegment, "$F", ftype, -1)
+                               seg = strings.Replace(seg, "$I", itype, -1)
+                               segs.WriteString(seg)
+                       }
+                       body := strings.Replace(testFunc, "$I", itype, -1)
+                       if typ[0] == 'u' {
+                               body = strings.Replace(body, "$TEST", " || i < 0", 1)
+                       } else {
+                               body = strings.Replace(body, "$TEST", "", 1)
+                       }
+                       body = strings.Replace(body, "$TESTSEGMENTS", segs.String(), 1)
+                       funcs.WriteString(body)
+               }
+       }
+
+       program = strings.Replace(program, "$NAMES", names.String(), 1)
+       program = strings.Replace(program, "$FUNCS", funcs.String(), 1)
+       fmt.Print(program)
+}
+
+const testSegment = `
+       f$F := $F(f)
+       if math.Abs(float64(f$F) - f) < 0.05 {
+               if v := $I(f$F); v != $I(i) {
+                       fmt.Printf("$I($F(%f)) = %v, expected %v\n", f, v, i)
+               }
+       }`
+
+const testFunc =
+`func test$I(f float64, i int64) {
+       if i != int64($I(i))$TEST {
+               return
+       }
+$TESTSEGMENTS
+}
+`
+
+var program =
+`package main
+
+import (
+       "fmt"
+       "math"
+)
+
+var tests = []struct {
+       f float64
+       i int64
+}{
+       {39.7, 39},
+       {-39.7, -39},
+       {258.6, 258},
+       {-258.6, -258},
+       {65538.9, 65538},
+       {-65538.9, -65538},
+       {4294967298.8, 4294967298},
+       {-4294967298.8, -4294967298},
+}
+
+var funcs = []func(float64, int64){
+$NAMES
+}
+
+$FUNCS
+func main() {
+       for _, t := range tests {
+               for _, f := range funcs {
+                       f(t.f, t.i)
+               }
+       }
+}
+`
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go
new file mode 100644 (file)
index 0000000..032e5d9
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package pkg1
+
+var x = make(chan interface{})
+
+func Do() int {
+       return (<-x).(int)
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go
new file mode 100644 (file)
index 0000000..5c78c7d
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3843: inlining bug due to wrong receive operator precedence.
+
+package pkg2
+
+import "./pkg1"
+
+func F() {
+       pkg1.Do()
+}
+
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.go
new file mode 100644 (file)
index 0000000..242f599
--- /dev/null
@@ -0,0 +1,7 @@
+// compiledir
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug449.go b/gcc/testsuite/go.test/test/fixedbugs/bug449.go
new file mode 100644 (file)
index 0000000..a9650f4
--- /dev/null
@@ -0,0 +1,69 @@
+// runoutput
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3866
+// runtime.equal failed to take padding between arguments and
+// return values into account, so in certain cases gc-generated
+// code will read a random bool from the stack as the result of
+// the comparison.
+// This program generates a lot of equality tests and hopes to
+// catch this.
+// NOTE: this program assumes comparing instance of T and T's
+// underlying []byte will make gc emit calls to runtime.equal,
+// and if gc optimizes this case, then the test will no longer
+// be correct (in the sense that it no longer tests runtime.equal).
+
+package main
+
+import (
+       "bytes"
+       "fmt"
+       "strconv"
+       "strings"
+)
+
+const ntest = 1024
+
+func main() {
+       var decls, calls bytes.Buffer
+
+       for i := 1; i <= ntest; i++ {
+               s := strconv.Itoa(i)
+               decls.WriteString(strings.Replace(decl, "$", s, -1))
+               calls.WriteString(strings.Replace("call(test$)\n\t", "$", s, -1))
+       }
+
+       program = strings.Replace(program, "$DECLS", decls.String(), 1)
+       program = strings.Replace(program, "$CALLS", calls.String(), 1)
+       fmt.Print(program)
+}
+
+var program = `package main
+
+var count int
+
+func call(f func() bool) {
+       if f() {
+               count++
+       }
+}
+
+$DECLS
+
+func main() {
+       $CALLS
+       if count != 0 {
+               println("failed", count, "case(s)")
+       }
+}
+`
+
+const decl = `
+type T$ [$]uint8
+func test$() bool {
+       v := T${1}
+       return v == [$]uint8{2} || v != [$]uint8{1}
+}`
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug450.go b/gcc/testsuite/go.test/test/fixedbugs/bug450.go
new file mode 100644 (file)
index 0000000..3f13de1
--- /dev/null
@@ -0,0 +1,28 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3899: 8g incorrectly thinks a variable is
+// "set but not used" and elides an assignment, causing
+// variables to end up with wrong data.
+//
+// The reason is a miscalculation of variable width.
+
+package main
+
+func bar(f func()) {
+       f()
+}
+
+func foo() {
+       f := func() {}
+       if f == nil {
+       }
+       bar(f)
+}
+
+func main() {
+       foo()
+}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug451.go b/gcc/testsuite/go.test/test/fixedbugs/bug451.go
new file mode 100644 (file)
index 0000000..75ce974
--- /dev/null
@@ -0,0 +1,11 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T x.T // ERROR "undefined|expected package"
+
+// bogus "invalid recursive type"
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug452.go b/gcc/testsuite/go.test/test/fixedbugs/bug452.go
new file mode 100644 (file)
index 0000000..d2e4a0b
--- /dev/null
@@ -0,0 +1,38 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3835: 8g tries to optimize arithmetic involving integer
+// constants, but can run out of registers in the process.
+
+package main
+
+var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G int
+
+func foo() int {
+       return a + 1 + b + 2 + c + 3 + d + 4 + e + 5 + f + 6 + g + 7 + h + 8 + i + 9 + j + 10 +
+               k + 1 + l + 2 + m + 3 + n + 4 + o + 5 + p + 6 + q + 7 + r + 8 + s + 9 + t + 10 +
+               u + 1 + v + 2 + w + 3 + x + 4 + y + 5 + z + 6 + A + 7 + B + 8 + C + 9 + D + 10 +
+               E + 1 + F + 2 + G + 3
+}
+
+func bar() int8 {
+       var (
+               W int16
+               X int32
+               Y int32
+               Z int32
+       )
+       return int8(W+int16(X+3)+3) * int8(Y+3+Z*3)
+}
+
+func main() {
+       if foo() == 0 {
+               panic("foo")
+       }
+       if bar() == 0 {
+               panic("bar")
+       }
+}
index 7b91d88e51a56a66e833bd52d1b9f81d2714b62f..2912c3749c24e66f87ae8abbdc180c6b988767ff 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test floating-point literal syntax.
+
 package main
 
 var bad bool
index f51cbc27775fa01cbcd08dcc901d8d9a8d3fcae7..f9f59a937f2d9f9c13d6f8b416ca266c72f94947 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test floating-point comparison involving NaN.
+
 package main
 
 import "math"
index 36ad15709b1ff0348822437a35e72fc9af1b6c54..8a50090657fb51d36f78f499b2f49700b680d760 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test for loops.
+
 package main
 
 func assertequal(is, shouldbe int, msg string) {
index e8ed928bcd3773d528219357be629480283a5233..246cb56fd95c398ef2f973cee4599814dd19b1bb 100644 (file)
@@ -1,9 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple functions.
 
 package main
 
index 056ff9877d39e83624a514ee3ae1cb24b0554426..c89f7ff2eae777ffb99e594ab635284ee4bc4a07 100644 (file)
@@ -1,14 +1,15 @@
-// errchk $G $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// does not compile and should not compile
+// Test that result parameters are in the same scope as regular parameters.
+// Does not compile.
 
 package main
 
-func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return values must have names
+func f1(a int) (int, float32) {
        return 7, 7.0
 }
 
index 87e78194ef9af93a7185c7095840237f72ec8b27..b5966a91f6065e58030908746c5b996615635a4f 100644 (file)
@@ -1,9 +1,12 @@
-// $G $F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test function signatures.
+// Compiled but not run.
+
 package main
 
 type t1 int
index 110b0ef1c49b727560fd41a70af754a866947785..6be3bf0184d386f436fd3d7a1044b26da8084613 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal function signatures are detected.
+// Does not compile.
+
 package main
 
 type t1 int
index 2a1a932de902b2d89496b963797396dc31352c05..85f1e4b81e91fea4c9b3dee5851d5025140aab69 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that it is illegal to take the address of a function.
+// Does not compile.
+
 package main
 
 var notmain func()
index e27825c2b281cdaff880ca7b4f502556668da73b..2e058be7e6e19526fb24502964b5466d6e3fa86a 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test functions and goroutines.
+
 package main
 
 func caller(f func(int, int) int, a, b int, c chan int) {
index 1356b6aa8b809805b5d5af63531be07fe166759d..456cb49f0920ee5c93b5f7c3b70e0aaa3f57dcea 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test closures in if conditions.
+
 package main
 
 func main() {
index e38b008cc097d2f946b863a68718fbbe32d1b0ea..6f6766f29f6aad0814df79190910ca2aa3d8f3fb 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test evaluation order in if condition.
+
 package main
 
 var calledf = false
diff --git a/gcc/testsuite/go.test/test/func8.go b/gcc/testsuite/go.test/test/func8.go
new file mode 100644 (file)
index 0000000..7defe26
--- /dev/null
@@ -0,0 +1,49 @@
+// run
+
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test evaluation order.
+
+package main
+
+var calledf int
+
+func f() int {
+       calledf++
+       return 0
+}
+
+func g() int {
+       return calledf
+}
+
+var xy string
+
+func x() bool {
+       for false {
+       } // no inlining
+       xy += "x"
+       return false
+}
+
+func y() string {
+       for false {
+       } // no inlining
+       xy += "y"
+       return "abc"
+}
+
+func main() {
+       if f() == g() {
+               println("wrong f,g order")
+       }
+
+       if x() == (y() == "abc") {
+               panic("wrong compare")
+       }
+       if xy != "xy" {
+               println("wrong x,y order")
+       }
+}
index 3aab8fac95302354bd62be9e33f7ac310eb4ece9..6688f9fbddb9148c60ff0719e45cfc367cff35dc 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Simple test of the garbage collector.
+
 package main
 
 import "runtime"
index 84034e7cea934526c741e5500a3711fb9b58829c..6049ea14e9bfa9a3a4ab26ccb4169c34968f1552 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// A simple test of the garbage collector.
+
 package main
 
 func main() {
index 772f9810daaba053c60da480ede9e01b7874a531..de52a4fbf2eacd4f5469972cf6d1605f75b1f119 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that buffered channels are garbage collected properly.
+// Test that buffered channels are garbage collected properly.
 // An interesting case because they have finalizers and used to
 // have self loops that kept them from being collected.
 // (Cyclic data with finalizers is never finalized, nor collected.)
index e0b4cf6e2a791e8350e6dd70624835df6810bab2..3e44e04c6aae814feb2f6c250598009124f92699 100644 (file)
 
 == dwarf/
 
+== safe/
+
 == fixedbugs/
 
+=========== fixedbugs/bug429.go
+throw: all goroutines are asleep - deadlock!
+
 == bugs/
 
 =========== bugs/bug395.go
 bug395 is broken
+
+=========== bugs/bug434.go
+bugs/bug434.dir/two.go:10: one.t.int undefined (cannot refer to unexported field or method one.int)
+BUG:bug434
index 53ed055a070abc94f8d386ba0201a5e5d1c4227d..2f0d3c3904d80553d2f18eae97c1f07a15269277 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that println can be the target of a go statement.
+
 package main
 
 import "time"
index 1fccb314c87d916dfd7102cc90ddbf719367dd9e..ca477b3d0c3beb77025ac31326b661d7dec8b43f 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify goto semantics.
+// Does not compile.
+//
 // Each test is in a separate function just so that if the
 // compiler stops processing after one error, we don't
 // lose other ones.
diff --git a/gcc/testsuite/go.test/test/hashmap.go b/gcc/testsuite/go.test/test/hashmap.go
deleted file mode 100755 (executable)
index 0a4d7ab..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-// $G $F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-// ----------------------------------------------------------------------------
-// Helper functions
-
-func ASSERT(p bool) {
-       if !p {
-               // panic 0
-       }
-}
-
-
-// ----------------------------------------------------------------------------
-// Implementation of the HashMap
-
-type KeyType interface {
-       Hash() uint32
-       Match(other KeyType) bool
-}
-
-
-type ValueType interface {
-       // empty interface
-}
-
-
-type Entry struct {
-       key KeyType
-       value ValueType
-}
-
-
-type Array [1024]Entry
-
-type HashMap struct {
-       map_ *Array
-       log2_capacity_ uint32
-       occupancy_ uint32
-}
-
-
-func (m *HashMap) capacity() uint32 {
-       return 1 << m.log2_capacity_
-}
-
-
-func (m *HashMap) Clear() {
-       // Mark all entries as empty.
-       var i uint32 = m.capacity() - 1
-       for i > 0 {
-               m.map_[i].key = nil
-               i = i - 1
-       }
-       m.occupancy_ = 0
-}
-
-
-func (m *HashMap) Initialize (initial_log2_capacity uint32) {
-       m.log2_capacity_ = initial_log2_capacity
-       m.map_ = new(Array)
-       m.Clear()
-}
-
-
-func (m *HashMap) Probe (key KeyType) *Entry {
-       ASSERT(key != nil)
-
-       var i uint32 = key.Hash() % m.capacity()
-       ASSERT(0 <= i && i < m.capacity())
-
-       ASSERT(m.occupancy_ < m.capacity())     // guarantees loop termination
-       for m.map_[i].key != nil && !m.map_[i].key.Match(key) {
-               i++
-               if i >= m.capacity() {
-                       i = 0
-               }
-       }
-
-       return &m.map_[i]
-}
-
-
-func (m *HashMap) Lookup (key KeyType, insert bool) *Entry {
-       // Find a matching entry.
-       var p *Entry = m.Probe(key)
-               if p.key != nil {
-               return p
-       }
-
-       // No entry found; insert one if necessary.
-       if insert {
-               p.key = key
-               p.value = nil
-               m.occupancy_++
-
-               // Grow the map if we reached >= 80% occupancy.
-               if m.occupancy_ + m.occupancy_/4 >= m.capacity() {
-                       m.Resize()
-                       p = m.Probe(key)
-               }
-
-               return p
-       }
-
-       // No entry found and none inserted.
-       return nil
-}
-
-
-func (m *HashMap) Resize() {
-       var hmap *Array = m.map_
-       var n uint32 = m.occupancy_
-
-       // Allocate a new map of twice the current size.
-       m.Initialize(m.log2_capacity_ << 1)
-
-       // Rehash all current entries.
-       var i uint32 = 0
-       for n > 0 {
-               if hmap[i].key != nil {
-                       m.Lookup(hmap[i].key, true).value = hmap[i].value
-                       n = n - 1
-               }
-               i++
-       }
-}
-
-
-// ----------------------------------------------------------------------------
-// Test code
-
-type Number struct {
-       x uint32
-}
-
-
-func (n *Number) Hash() uint32 {
-       return n.x * 23
-}
-
-
-func (n *Number) Match(other KeyType) bool {
-       // var y *Number = other
-       // return n.x == y.x
-       return false
-}
-
-
-func MakeNumber (x uint32) *Number {
-       var n *Number = new(Number)
-       n.x = x
-       return n
-}
-
-
-func main() {
-       // func (n int) int { return n + 1; }(1)
-
-       //print "HashMap - gri 2/8/2008\n"
-
-       var hmap *HashMap = new(HashMap)
-       hmap.Initialize(0)
-
-       var x1 *Number = MakeNumber(1001)
-       var x2 *Number = MakeNumber(2002)
-       var x3 *Number = MakeNumber(3003)
-       _, _, _ = x1, x2, x3
-
-       // this doesn't work I think...
-       //hmap.Lookup(x1, true)
-       //hmap.Lookup(x2, true)
-       //hmap.Lookup(x3, true)
-
-       //print "done\n"
-}
index 16c95f00686e6669f609946a073d0cd6c621d637..5025ec9bb350b85220d867180f931cbe04080f74 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that we can do page 1 of the C book.
+
 package main
 
 func main() {
index 18a6715d7eb979bba97baf24585ea895d01d438c..25cc141648b9a65b7555075ad947b1035ad3111d 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test if statements in various forms.
+
 package main
 
 func assertequal(is, shouldbe int, msg string) {
index bd83dc3bdd30c4d52f10e52c79b926b07cdfda2d..d135cd284517fb540e2ff43fb2b6892b72f800ba 100644 (file)
@@ -1,11 +1,11 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// check that when import gives multiple names
-// to a type, they're still all the same type
+// Test that when import gives multiple names
+// to a single type, they still all refer to the same type.
 
 package main
 
index ebd704ef9959e21e690baa52f59bccf7936a5570..56b29d58c066e0987bd6b46b89b6c1703f2c8953 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// check for import conflicts
+// Verify that import conflicts are detected by the compiler.
+// Does not compile.
 
 package main
 
index 0efc285fac859c7c9791dd3f4399cd70757cac53..5c275f34b36b818d2891afb84a71d85359bdb205 100644 (file)
@@ -1,9 +1,12 @@
-// true  # used by import3
+// skip # used by import3
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Various declarations of exported variables and functions.
+// Imported by import3.go.
+
 package p
 
 var C1 chan <- chan int = (chan<- (chan int))(nil)
index e4900b93ddc706507a339422a641a5ea96dbe203..0a5ba1d01ac5956038e6102779172ab1f535e4a7 100644 (file)
@@ -1,10 +1,13 @@
 // $G $D/import2.go && $G $D/$F.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that all the types from import2.go made it
+// Test that all the types from import2.go made it
 // intact and with the same meaning, by assigning to or using them.
 
 package main
index 1ae1d0e4ad3c59ee3d9225e32af8bf834bf47a46..f35f5678184ac642ef76e66c73a10cafbd643755 100644 (file)
@@ -1,12 +1,17 @@
 // $G $D/empty.go && errchk $G $D/$F.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+// Verify that various kinds of "imported and not used"
+// errors are caught by the compiler.
+// Does not compile.
 
-// various kinds of imported and not used
+package main
 
 // standard
 import "fmt"   // ERROR "imported and not used.*fmt"
diff --git a/gcc/testsuite/go.test/test/import5.go b/gcc/testsuite/go.test/test/import5.go
new file mode 100644 (file)
index 0000000..6480acf
--- /dev/null
@@ -0,0 +1,55 @@
+// errorcheck
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Verify that invalid imports are rejected by the compiler.
+// Does not compile.
+
+package main
+
+// Correct import paths.
+import _ "fmt"
+import _ `time`
+import _ "m\x61th"
+import _ "go/parser"
+
+// Correct import paths, but the packages don't exist.
+// Don't test.
+//import "a.b"
+//import "greek/αβ"
+
+// Import paths must be strings.
+import 42    // ERROR "import statement"
+import 'a'   // ERROR "import statement"
+import 3.14  // ERROR "import statement"
+import 0.25i // ERROR "import statement"
+
+// Each of these pairs tests both `` vs "" strings
+// and also use of invalid characters spelled out as
+// escape sequences and written directly.
+// For example `"\x00"` tests import "\x00"
+// while "`\x00`" tests import `<actual-NUL-byte>`.
+import ""         // ERROR "import path"
+import ``         // ERROR "import path"
+import "\x00"     // ERROR "import path"
+import `\x00`     // ERROR "import path"
+import "\x7f"     // ERROR "import path"
+import `\x7f`     // ERROR "import path"
+import "a!"       // ERROR "import path"
+import `a!`       // ERROR "import path"
+import "a b"      // ERROR "import path"
+import `a b`      // ERROR "import path"
+import "a\\b"     // ERROR "import path"
+import `a\\b`     // ERROR "import path"
+import "\"`a`\""  // ERROR "import path"
+import `\"a\"`    // ERROR "import path"
+import "\x80\x80" // ERROR "import path"
+import `\x80\x80` // ERROR "import path"
+import "\xFFFD"   // ERROR "import path"
+import `\xFFFD`   // ERROR "import path"
+
+// Invalid local imports.
+import "/foo"  // ERROR "import path cannot be absolute path"
+import "c:/foo"  // ERROR "import path contains invalid character"
index 38aa33dd305927ae8d658db75a0295cec827c824..447d708969fbfa079f2dc3c7e3346398862e5933 100644 (file)
@@ -4,11 +4,15 @@
 // ./$A.out -pass 2 >tmp.go && errchk $G -e tmp.go
 // rm -f tmp.go $A.out1
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
 // Generate test of index and slice bounds checks.
+// The output is compiled and run.
 
 package main
 
@@ -30,16 +34,20 @@ import (
 type quad struct { x, y, z, w int }
 
 const (
-       cj = 11
-       ci int = 12
-       ci32 int32 = 13
-       ci64 int64 = 14
+       cj = 100011
+       ci int = 100012
+       ci8 int8 = 115
+       ci16 int16 = 10016
+       ci32 int32 = 100013
+       ci64 int64 = 100014
        ci64big int64 = 1<<31
        ci64bigger int64 = 1<<32
        chuge = 1<<100
 
        cnj = -2
        cni int = -3
+       cni8 int8 = -6
+       cni16 int16 = -7
        cni32 int32 = -4
        cni64 int64 = -5
        cni64big int64 = -1<<31
@@ -47,16 +55,20 @@ const (
        cnhuge = -1<<100
 )
 
-var j int = 20
-var i int = 21
-var i32 int32 = 22
-var i64 int64 = 23
+var j int = 100020
+var i int = 100021
+var i8 int8 = 126
+var i16 int16 = 10025
+var i32 int32 = 100022
+var i64 int64 = 100023
 var i64big int64 = 1<<31
 var i64bigger int64 = 1<<32
 var huge uint64 = 1<<64 - 1
 
 var nj int = -10
 var ni int = -11
+var ni8 int8 = -14
+var ni16 int16 = -15
 var ni32 int32 = -12
 var ni64 int64 = -13
 var ni64big int64 = -1<<31
@@ -71,6 +83,14 @@ var sq []quad = make([]quad, 10)
 var aq [10]quad
 var paq *[10]quad = &aq
 
+var sib []int = make([]int, 100000)
+var aib [100000]int
+var paib *[100000]int = &aib
+
+var sqb []quad = make([]quad, 100000)
+var aqb [100000]quad
+var paqb *[100000]quad = &aqb
+
 type T struct {
        si []int
        ai [10]int
@@ -78,11 +98,18 @@ type T struct {
        sq []quad
        aq [10]quad
        paq *[10]quad
+
+       sib []int
+       aib [100000]int
+       paib *[100000]int
+       sqb []quad
+       aqb [100000]quad
+       paqb *[100000]quad
 }
 
-var t = T{si, ai, pai, sq, aq, paq}
+var t = T{si, ai, pai, sq, aq, paq, sib, aib, paib, sqb, aqb, paqb}
 
-var pt = &T{si, ai, pai, sq, aq, paq}
+var pt = &T{si, ai, pai, sq, aq, paq, sib, aib, paib, sqb, aqb, paqb}
 
 // test that f panics
 func test(f func(), s string) {
@@ -91,11 +118,25 @@ func test(f func(), s string) {
                        _, file, line, _ := runtime.Caller(2)
                        bug()
                        print(file, ":", line, ": ", s, " did not panic\n")
+               } else if !contains(err.(error).Error(), "out of range") {
+                       _, file, line, _ := runtime.Caller(2)
+                       bug()
+                       print(file, ":", line, ": ", s, " unexpected panic: ", err.(error).Error(), "\n")
                }
        }()
        f()
 }
 
+func contains(x, y string) bool {
+       for i := 0; i+len(y) <= len(x); i++ {
+               if x[i:i+len(y)] == y {
+                       return true
+               }
+       }
+       return false
+}
+
+
 var X interface{}
 func use(y interface{}) {
        X = y
@@ -146,11 +187,14 @@ func main() {
                
                // Array, pointer to array, slice.
                []string{"a", "pa", "s"},
-
+               
                // Element is int, element is quad (struct).
                // This controls whether we end up in gsubr.c (i) or cgen.c (q).
                []string{"i", "q"},
 
+               // Small or big len.
+               []string{"", "b"},
+
                // Variable or constant.
                []string{"", "c"},
 
@@ -158,11 +202,11 @@ func main() {
                []string{"", "n"},
 
                // Size of index.
-               []string{"j", "i", "i32", "i64", "i64big", "i64bigger", "huge"},
+               []string{"j", "i", "i8", "i16", "i32", "i64", "i64big", "i64bigger", "huge"},
        }
        
        forall(choices, func(x []string) {
-               p, a, e, c, n, i := x[0], x[1], x[2], x[3], x[4], x[5]
+               p, a, e, big, c, n, i := x[0], x[1], x[2], x[3], x[4], x[5], x[6]
 
                // Pass: dynamic=0, static=1, 2.
                // Which cases should be caught statically?
@@ -184,10 +228,15 @@ func main() {
                                thisPass = 2
                        }
                }
+               
+               // If we're using the big-len data, positive int8 and int16 cannot overflow.
+               if big == "b" && n == "" && (i == "i8" || i == "i16") {
+                       return
+               }
 
                // Only print the test case if it is appropriate for this pass.
                if thisPass == *pass {
-                       pae := p+a+e
+                       pae := p+a+e+big
                        cni := c+n+i
                        
                        // Index operation
index cfddde9ce2bdac144408675c7fa55959994b6dbf..bb20f3009bfdd010b6806c0e36ddb178d50062c8 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG indirect
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test various safe uses of indirection.
+
 package main
 
 var m0 map[string]int
index ecb4f138ace8ca50565b2c2aa89cfff606db3f77..51da4cc7c4586b82f0121318f6ec545f01591a2c 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal uses of indirection are caught by the compiler.
+// Does not compile.
+
 package main
 
 var m0 map[string]int
index 74c2d5c26146d0e393af8a828b75bd80d00a8695..f4689443cf1415be71abe719d0c89aaebdecba76 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that erroneous use of init is detected.
+// Does not compile.
+
 package main
 
 import "runtime"
index 9ce3c12ee68f9267f4d4be3709a7fc314d7ee4ed..a888ad7440c5c85ef089c3c0418277a369ed29d5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -16,10 +16,11 @@ func init() {
        c := make(chan int)
        go send(c)
        <-c
-       
-       const chunk = 1<<20
-       runtime.UpdateMemStats()
-       sys := runtime.MemStats.Sys     
+
+       const chunk = 1 << 20
+       memstats := new(runtime.MemStats)
+       runtime.ReadMemStats(memstats)
+       sys := memstats.Sys
        b := make([]byte, chunk)
        for i := range b {
                b[i] = byte(i%10 + '0')
@@ -28,8 +29,8 @@ func init() {
        for i := 0; i < 1000; i++ {
                x = []byte(s)
        }
-       runtime.UpdateMemStats()
-       sys1 := runtime.MemStats.Sys
+       runtime.ReadMemStats(memstats)
+       sys1 := memstats.Sys
        if sys1-sys > chunk*50 {
                println("allocated 1000 chunks of", chunk, "and used ", sys1-sys, "memory")
        }
@@ -41,4 +42,3 @@ func send(c chan int) {
 
 func main() {
 }
-
index 195d4575f767c67a27b49c91b923769e43ae175d..a54fce4280236a164459681347ee274902ddd039 100644 (file)
@@ -1,15 +1,17 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test trailing commas. DO NOT gofmt THIS FILE.
+
 package main
 
-var a = []int{1, 2}
-var b = [5]int{1, 2, 3}
-var c = []int{1}
-var d = [...]int{1, 2, 3}
+var a = []int{1, 2}
+var b = [5]int{1, 2, 3}
+var c = []int{1}
+var d = [...]int{1, 2, 3}
 
 func main() {
        if len(a) != 2 {
index 6dd7d67dc37bcf57a309548e21ca3aa093768ac8..1307e0209615b9355a44a76632119d72d9f748e7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test initialization of package-level variables.
+
 package main
 
 import "fmt"
index e7f8b0e92fe30a83397f45129a2da036856fe600..48908c347864084ba64fad28299ac1fee57ebf6c 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that erroneous initialization expressions are caught by the compiler
+// Does not compile.
+
 package main
 
 type S struct {
diff --git a/gcc/testsuite/go.test/test/initsyscall.go b/gcc/testsuite/go.test/test/initsyscall.go
deleted file mode 100644 (file)
index d0c26d2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This used to crash because the scheduler
-// tried to kick off a new scheduling thread for f
-// when time.Nanoseconds went into the system call.
-// It's not okay to schedule new goroutines
-// until main has started.
-
-package main
-
-import "time"
-
-func f() {
-}
-
-func init() {
-       go f()
-       time.Now()
-}
-
-func main() {
-}
index 2644e17b57da46ef9d91be75cbf0a2a59a404340..78deaea13020557993bbec27e6547c67428bb418 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test integer literal syntax.
+
 package main
 
 import "os"
index 407bcfd9bae9a3f68859c0ed405aae0ea24a36a5..3920528a403bfad15b4f5faee8c63ceab3356846 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test implicit and explicit conversions of constants.
+
 package main
 
 const (
index 44f6ab127ea38026b0ac396aa8e8500c09065d67..0f2e9a990ec9d142b8beddd9b602b90d465d6388 100644 (file)
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// check that big vs small, pointer vs not
-// interface methods work.
+// Test big vs. small, pointer vs. value interface methods.
 
 package main
 
index 7f429f7031e14274113816eefe9947ee4cee6f74..eb6fd1d5542f206225202a35eedbb6b6a70c9613 100644 (file)
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check uses of all the different interface
-// conversion runtime functions.
+// Test all the different interface conversion runtime functions.
 
 package main
 
index 658b1a92fa89c2dba8f622435a44cdd8e212cfe5..4a3ec8a375da2f68535fdc48fd0d86abaeff8942 100644 (file)
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that static interface conversion of
-// interface value nil succeeds.
+// Test static interface conversion of interface value nil.
 
 package main
 
index 658b1a92fa89c2dba8f622435a44cdd8e212cfe5..4a3ec8a375da2f68535fdc48fd0d86abaeff8942 100644 (file)
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that static interface conversion of
-// interface value nil succeeds.
+// Test static interface conversion of interface value nil.
 
 package main
 
index 2fddee1905a06394dfa1be4a2c702649923fb907..5c52ac0232346651c196e6a4e8fb1321cc8c4940 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods derived from embedded interface values.
+// Test methods derived from embedded interface values.
 
 package main
 
index bbd81e7603805d8f52ed92567671fc76fd51d382..e2ee20adebaceda1fc55fc480a196d5d8a4a7107 100644 (file)
@@ -1,10 +1,10 @@
-// true        # used by embed1.go
+// skip # used by embed1.go
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that embedded interface types can have local methods.
+// Test that embedded interface types can have local methods.
 
 package p
 
index 24e50471f2d43440d5e7c294c1fd1242fc71d08d..07b873a633b9ff62fb640c1ae6f5004aa7cb341b 100644 (file)
@@ -1,10 +1,13 @@
 // $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that embedded interface types can have local methods.
+// Test that embedded interface types can have local methods.
 
 package main
 
index c18a1fecec2af129cfb189b70b2aacbe770a574b..1636db78eb89c734ba940b7a14481b77954bb79a 100644 (file)
@@ -1,10 +1,10 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods derived from embedded interface and *interface values.
+// Test methods derived from embedded interface and *interface values.
 
 package main
 
index daae59b36182dafea0b136ad14539925b1024c4f..eb81156e081d79ac08f966a423b28cc7313a6c31 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Static error messages about interface conversions.
+// Verify compiler messages about erroneous static interface conversions.
+// Does not compile.
 
 package main
 
@@ -14,6 +15,10 @@ type T struct {
 
 var t *T
 
+type X int
+
+func (x *X) M() {}
+
 type I interface {
        M()
 }
@@ -39,7 +44,7 @@ func main() {
        // because i has an extra method
        // that t does not, so i cannot contain a t.
        i = t // ERROR "incompatible|missing M method"
-       t = i // ERROR "incompatible|need type assertion"
+       t = i // ERROR "incompatible|assignment$"
 
        i = i2 // ok
        i2 = i // ERROR "incompatible|missing N method"
@@ -65,6 +70,8 @@ func (Int) M(float64) {}
 
 var _ = m.(Int) // ERROR "impossible type assertion"
 
+var _ = m.(X) // ERROR "pointer receiver"
+
 var ii int
 var jj Int
 
index 0c20bcf756a4275b505eb5ab07edf5ba961f9d63..72b854dc00c753dcd8639f4186813837883f4a9f 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that interface conversion fails when method is missing.
+// Test that interface conversion fails when method is missing.
 
 package main
 
index ddb83254278c59007fc04a5c54b88f4e0b587adc..861a640842f6400f62ca2eea88a2ee401f6fefa9 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface comparisons using types hidden
+// Test interface comparisons using types hidden
 // inside reflected-on structs.
 
 package main
index 3c2ea5975a14286c334c66d5968384eeaa3ca00a..1c5166ededf6d99d0a26cc22df78022235407c17 100644 (file)
@@ -1,10 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: interface/noeq
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface values containing types that cannot be compared for equality.
+// Test run-time error detection for interface values containing types
+// that cannot be compared for equality.
 
 package main
 
index f1e363cbff63be7f9f4ff9b2d41ccbf250a7d683..2927050669a9f58e710a577258d6ad28bc1a7bce 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that interface{M()} = *interface{M()} produces a compiler error.
+// Test that interface{M()} = *interface{M()} produces a compiler error.
+// Does not compile.
 
 package main
 
index 37890c923a51ef0a26c1ffa023d6c35f1c8bcbd8..0a42385ea7bf69058ff8251af99892847dc63e0a 100644 (file)
@@ -1,9 +1,15 @@
 // $G $D/${F}1.go && errchk $G $D/$F.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that unexported methods are not visible outside the package.
+// Does not compile.
+
 package main
 
 import "./private1"
index 3173fbef41ff75eda87aec56983ff329eedd5914..3281c38be606452ab5a5cc810f390cabb8ad0ba4 100644 (file)
@@ -1,9 +1,11 @@
-// true  # used by private.go
+// skip # used by private.go
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Imported by private.go, which should not be able to see the private method.
+
 package p
 
 type Exported interface {
index f53daf8dab1ef5c4aaa641f70b1bcc8a317ae767..4511ab3b473c1e11786e2a59b4b43f72f56ba1c5 100644 (file)
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Implicit methods for embedded types.
-// Mixed pointer and non-pointer receivers.
+// Test Implicit methods for embedded types and
+// mixed pointer and non-pointer receivers.
 
 package main
 
index 51312d00025e1297000f0f332d04d0b1b1d2ccb7..2b7ccdc1a7bdcad99d8a00834b154fee59187293 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Error messages about missing implicit methods.
+// Verify compiler complains about missing implicit methods.
+// Does not compile.
 
 package main
 
index 1eb56e976726e8b6cf243da3af9b293d032932cd..fcc88331e0b3e61e68ec55b5546899d3ae23c920 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // Check mutually recursive interfaces
 
-package main
+package recursive
 
 type I1 interface {
        foo() I2
index 2c93a28363aa89b86980025123c1fa86ce719ae8..cc3cdc37f1ae482768ff4038b4a50f9fd60dfaa7 100644 (file)
@@ -1,9 +1,11 @@
-// true  # used by recursive2
+// skip # used by recursive2
 
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Mutually recursive type definitions imported and used by recursive1.go.
+
 package p
 
 type I1 interface {
index a7f9ab5dbd98e71b2deacdb6b12889d736c9b764..3a1059960cf14c853b6e19a7c3b7d21bb3ba85aa 100644 (file)
@@ -1,10 +1,13 @@
 // $G $D/recursive1.go && $G $D/$F.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that the mutually recursive types in recursive1.go made it
+// Test that the mutually recursive types in recursive1.go made it
 // intact and with the same meaning, by assigning to or using them.
 
 package main
index 5cf083617813495b1da44ac203044620d2551742..4d86f39184090727a471f5881851d32f760310c4 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods with different return types.
+// Test interface methods with different return types are distinct.
 
 package main
 
index 40b7f4f9101d21121d430661ff1da628c4b85cf2..f60819ca8116f24c77132cc8a3cb6676ff76b922 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG interface6
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface values containing structures.
+// Test interface values containing structures.
 
 package main
 
index c40ca1f382464f943ebd7af7476d8a0edd5d34de..7187dbe335ea42f03ea44942782398b49d45027b 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test iota.
+
 package main
 
 func assert(cond bool, msg string) {
index 40209f5da377a5632a921832c9db64108293b46b..9412e3502dd950a12919dfedde52d797e824ed0a 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test arrays and slices.
+
 package main
 
 func setpd(a []int) {
@@ -68,6 +70,9 @@ func testpdpd() {
 
        a = a[5:25]
        res(sumpd(a), 5, 25)
+
+       a = a[30:95]
+       res(sumpd(a), 35, 100)
 }
 
 // call ptr fixed with ptr fixed
index ef75b044d7c45ad78248d5d6c1c0f59e19a19ef4..36b18f80ea9faf66423a310d81d8d9bb6f9337a2 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test communication operations including select.
+
 package main
 
 import "os"
index e5fc033f3d668a9f1829ef0ac51a4aaa4e449070..cbd21a3d69c074d53b97a655e22e3afd5bdf7847 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test communication with multiple simultaneous goroutines.
+
 package main
 
 import "runtime"
index da0a84a043a9fc500878de919e130bc1b95707d2..bc50bbe224c35278289513bfed53d2018e0496a4 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test composite literals.
+
 package main
 
 type   M       map[int]int
index 3780ec886a4b52e4fe31ee08d3cfaf4691f09883..33acbd8cd2184f70bab6a6b2c7d4aeac74520132 100644 (file)
@@ -1,10 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// near-exhaustive test of converting numbers between types.
+// Test, near-exhaustive, of converting numbers between types.
+// No complex numbers though.
 
 package main
 
index f38ce5b65d11007b3ba071ec8365bbbe427ca381..665e52a5f3580dd0e558b44ff069ee7b0803350e 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test trivial, bootstrap-level complex numbers, including printing.
+
 package main
 
 const (
index 8ec7d40f5e58104b6260a1066cb8e18b0359a315..78240a563977c87323a69081ecf3ac379c9ae0cd 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple arithmetic and assignment for complex numbers.
+
 package main
 
 const (
index 89f4a04181e44926d5cbecf9a448072ee34d5fe5..eb1da7b8c0da13529f59c76329331d5536a721c7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test arithmetic on complex numbers, including multiplication and division.
+
 package main
 
 const (
index 048c93eef67fb5a24fa42e626294fc39a29fd62a..be0b8646ab8890c3b005cf273b68bf53d94ec5aa 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test composition, decomposition, and reflection on complex numbers.
+
 package main
 
 import "unsafe"
index 738afcd2cad3df54fca8f4391fbc5b6551f5c02e..97d5d16f4aae56470336b0e29624f48191e74cbe 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test complex numbers,including fmt support.
+// Used to crash.
+
 package main
 
 import "fmt"
index e6696674b0a5670185501128d63367a4f8d4154e..4e8f4433d3cb2e076dd6b021608ee6d8de202ac3 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test compound types made of complex numbers.
+
 package main
 
 var a [12]complex128
index 5a64d16b49069643839e9003590bbd05a8837f9d..670e07417aad71317faa48547da969b8501901d3 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test integer division by constants.
+
 package main
 
 import "math/rand"
index dc44ea245b9c9021868ce2a2c3de7c1a2343eefd..f1bd56ec66b85143316214eccc499aeba0816b1e 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test integer division and modulus.
+
 package main
 
 const (
index 9805e479bb92c4e415838a34180a6c5d3b624365..9b35c56acfd4deed50375ee0840ce042d65a82f3 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test embedded fields of structs, including methods.
+
 package main
 
 
index 176ecd74930911736aa7c27361748125c41090c6..db35548db8511744778b368bd4a8d8a1702837f7 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple for loop.
 
 package main
 
index 9bb50886a4ab113139802c1d93a7f863e6ffa825..d8fbb95a311b19be39796cf00d86db02862b118c 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test interfaces on basic types.
+
 package main
 
 type myint int
index 94bc7eaada67d1dbc579e9304674348b6aa5e4cf..9432181df2aeef625732c081959ea1a2fdf449aa 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test interfaces and methods.
+
 package main
 
 type S struct {
index 73d1b0660bd7666e610c3c1ef61c1bce21afc271..8a2fca0d4bd069979e7e0b7621bfd61b531d06b2 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test interface assignment.
+
 package main
 
 type   Iputs   interface {
index 7a509f0484a92630c47dc174dda79f0a121be0b7..fcb3e611d9d6a62ab3f9bb5fed3d7da035c4b3ca 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test goto and labels.
+
 package main
 
 func main() {
index bac2bc17cce2fce3eb0e76f658912c1d722de22d..e241d4edb798a76c9493cc7169b27c842560ff8c 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple function literals.
 
 package main
 
index ae0bc0c58ab6d6567040216c516f4d762d0802f8..ef2499194f7add8299c3e8b4a636b765c17acc3f 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple multi-argument multi-valued function.
+
 package main
 
 func
index c2603a0a099c62ac996e0e5836571068713db13b..d88cf100321d1e4cda890cc1190d0a5e6b03bae2 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test integer modulus by contstants.
+
 package main
 
 import "math/rand"
index 6739ba33ae65097da35b688271371892ae428869..af806cfd9281af8386bfe42fe818a88825c99986 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test method invocation with pointer receivers and function-valued fields.
 
 package main
 
index e2ddde629285f14e23a9e100723e7a145f7cb058..d78170c9d25a5b7f05dea58180432642026e87db 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test pointers and the . (selector) operator on structs.
 
 package main
 
index 9535fd497d6d5408151bdc84b89e317d490cbb51..89c14e5c35b56076df5c4a6bb83e29e33d8ad0e1 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test 'for range' on arrays, slices, and maps.
+
 package main
 
 const size = 16
index a5854b93e2f3627e2f22c62f8fb80268671a5e0a..3042a671bfbfd3d2bbb0bb2d93d21ceee354b0c6 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test general operation using a list implementation.
+
 package main
 
 type Item interface {
index d13e2441d401488add0f6aad2775a7cb8ca9c981..4b4410ee859fc8bfa95ba388e84a7e1d398282ed 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test general operation using s-list.
+// First Go program ever run (although not in this exact form).
+
 package main
 
 import "fmt"
index 05188a47232633c34d8593d3e3f6138737395e35..c6a420b39d7125b07c71dd9c8ab9255ef69059a7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test for loops of many forms.
+
 package main
 
 func assertequal(is, shouldbe int, msg string) {
index 6b3d4b2e46086c82b33354f0dbbb7bcb9d09b5dd..885267e30c2a613a1cda64c18b81cb017d8047ba 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test functions of many signatures.
+
 package main
 
 func assertequal(is, shouldbe int, msg string) {
index 157a07aec54bf5f4e179e8002dc1382c934b1822..af8789615ee5ddc2197c7e845aad16631c88c3f3 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test shift.
+
 package main
 
 var    ians    [18]int;
index 1b6f245eea20a8551aaf3268937fae011ae87e07..0e81a341b8563d3506731199a7e128f57c583444 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple operations on arrays.
+
 package main
 
 var b[10] float32;
index dbd9c8d8bcfe6e1e1914da51c4af93854d25b940..ab2ecc21aad7603ebb3c9c3f85a34bc54a6ca993 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test basic operations on bool.
+
 package main
 
 type s struct {
index feb85d29997da3bbf1c5feb4495a0371dffcf13b..22cad2ad0e44a9808424d03edc18cba53aaff2db 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple arithmetic conversion.
+
 package main
 
 type vlong int64
index ba9ce6f7bce012a540b5421bea887be8bf5e8f06..e5dc2b24955bfcc7a09163d383f183af1d6ba25a 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple functions.
 
 package main
 
index 710af2e08c69b277e2f264f0829abe79075fa380..b28250b1d38132ebdd98ba6f1ce34c0c52e14be8 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple switch.
+
 package main
 
 func main() {
index fd060b0e2e909fe474e66d7938f570842f44ebc5..c6eefbb5addb431c485492917509c3569076ac90 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test scoping of variables.
+
 
 package main
 
index 5c31270fcd3dca00032b250c9848043581b00fe4..6cf676c588b2558b185a5bf6c70d3d1e8ec595c7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test basic operations of slices and arrays.
+
 package main
 
 var bx [10]byte
index 639042128774d1888e4c2e70adf26224dc1789f1..c07c591252da9d69013a094df5715d1b1992f732 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test slicing and re-slicing.
+
 package main
 
 var bx []byte
index e0510824293221abb38fedf12961d5ac8e30c82a..6df8dc4ddf1939c6fa837a26af0da21879ef328e 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test string operations including printing.
 
 package main
 
index dfaaf12131cc732565cb72eb3af8224f725c41b7..4d511fe6735db22b1ebc46d8161d232157f8e154 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test struct-valued variables (not pointers).
 
 package main
 
index e3d853266e14d8dae1a7121bd293a2dc4a48820f..b30c27ec44b2b35efb0f0c8c3a750e3677a5a01a 100644 (file)
@@ -1,10 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Pass 1 label errors.
+// Verify that erroneous labels are caught by the compiler.
+// This set is caught by pass 1.
+// Does not compile.
 
 package main
 
index 656daaeea54e29f16312e128d6c0e390a3c6dcd2..f923a18820e329c386de32949406b7db957de289 100644 (file)
@@ -1,10 +1,13 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Pass 2 label errors.
+
+// Verify that erroneous labels are caught by the compiler.
+// This set is caught by pass 2. That's why this file is label1.go.
+// Does not compile.
 
 package main
 
diff --git a/gcc/testsuite/go.test/test/linkx.go b/gcc/testsuite/go.test/test/linkx.go
new file mode 100644 (file)
index 0000000..12d446f
--- /dev/null
@@ -0,0 +1,20 @@
+// $G $D/$F.go && $L -X main.tbd hello $F.$A && ./$A.out
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test the -X facility of the gc linker (6l etc.).
+
+package main
+
+var tbd string
+
+func main() {
+       if tbd != "hello" {
+               println("BUG: test/linkx", len(tbd), tbd)
+       }
+}
index bf05388127ceba120de38ef024f1ed72fbbe27da..ba185fc9ace9c8d2b76523af30861bf73a1e34d8 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test literal syntax for basic types.
+
 package main
 
 var nbad int
index ff62392473d58bef51aefe3262aa54356c998aa0..be6d79b2b8e09ed623639972ac9e9f7ff9a411bb 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// trivial finalizer test
+// Test basic operation of finalizers.
 
 package main
 
index c3963499bcef1fec02933893a8ba142b32a18825..6dec0dfd71938b6b57d00e599a1145022396c7ad 100644 (file)
@@ -1,14 +1,18 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test maps, almost exhaustively.
+
 package main
 
 import (
        "fmt"
+       "math"
        "strconv"
+       "time"
 )
 
 const count = 100
@@ -26,6 +30,12 @@ func P(a []string) string {
 }
 
 func main() {
+       testbasic()
+       testfloat()
+       testnan()
+}
+
+func testbasic() {
        // Test a map literal.
        mlit := map[string]int{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4}
        for i := 0; i < len(mlit); i++ {
@@ -479,7 +489,7 @@ func main() {
 
                mipM[i][i]++
                if mipM[i][i] != (i+1)+1 {
-                       fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i])
+                       fmt.Printf("update mipM[%d][%d] = %d\n", i, i, mipM[i][i])
                }
        }
 
@@ -489,3 +499,195 @@ func main() {
                panic("range mnil")
        }
 }
+
+func testfloat() {
+       // Test floating point numbers in maps.
+       // Two map keys refer to the same entry if the keys are ==.
+       // The special cases, then, are that +0 == -0 and that NaN != NaN.
+
+       {
+               var (
+                       pz   = float32(0)
+                       nz   = math.Float32frombits(1 << 31)
+                       nana = float32(math.NaN())
+                       nanb = math.Float32frombits(math.Float32bits(nana) ^ 2)
+               )
+
+               m := map[float32]string{
+                       pz:   "+0",
+                       nana: "NaN",
+                       nanb: "NaN",
+               }
+               if m[pz] != "+0" {
+                       fmt.Println("float32 map cannot read back m[+0]:", m[pz])
+               }
+               if m[nz] != "+0" {
+                       fmt.Println("float32 map does not treat", pz, "and", nz, "as equal for read")
+                       fmt.Println("float32 map does not treat -0 and +0 as equal for read")
+               }
+               m[nz] = "-0"
+               if m[pz] != "-0" {
+                       fmt.Println("float32 map does not treat -0 and +0 as equal for write")
+               }
+               if _, ok := m[nana]; ok {
+                       fmt.Println("float32 map allows NaN lookup (a)")
+               }
+               if _, ok := m[nanb]; ok {
+                       fmt.Println("float32 map allows NaN lookup (b)")
+               }
+               if len(m) != 3 {
+                       fmt.Println("float32 map should have 3 entries:", m)
+               }
+               m[nana] = "NaN"
+               m[nanb] = "NaN"
+               if len(m) != 5 {
+                       fmt.Println("float32 map should have 5 entries:", m)
+               }
+       }
+
+       {
+               var (
+                       pz   = float64(0)
+                       nz   = math.Float64frombits(1 << 63)
+                       nana = float64(math.NaN())
+                       nanb = math.Float64frombits(math.Float64bits(nana) ^ 2)
+               )
+
+               m := map[float64]string{
+                       pz:   "+0",
+                       nana: "NaN",
+                       nanb: "NaN",
+               }
+               if m[nz] != "+0" {
+                       fmt.Println("float64 map does not treat -0 and +0 as equal for read")
+               }
+               m[nz] = "-0"
+               if m[pz] != "-0" {
+                       fmt.Println("float64 map does not treat -0 and +0 as equal for write")
+               }
+               if _, ok := m[nana]; ok {
+                       fmt.Println("float64 map allows NaN lookup (a)")
+               }
+               if _, ok := m[nanb]; ok {
+                       fmt.Println("float64 map allows NaN lookup (b)")
+               }
+               if len(m) != 3 {
+                       fmt.Println("float64 map should have 3 entries:", m)
+               }
+               m[nana] = "NaN"
+               m[nanb] = "NaN"
+               if len(m) != 5 {
+                       fmt.Println("float64 map should have 5 entries:", m)
+               }
+       }
+
+       {
+               var (
+                       pz   = complex64(0)
+                       nz   = complex(0, math.Float32frombits(1<<31))
+                       nana = complex(5, float32(math.NaN()))
+                       nanb = complex(5, math.Float32frombits(math.Float32bits(float32(math.NaN()))^2))
+               )
+
+               m := map[complex64]string{
+                       pz:   "+0",
+                       nana: "NaN",
+                       nanb: "NaN",
+               }
+               if m[nz] != "+0" {
+                       fmt.Println("complex64 map does not treat -0 and +0 as equal for read")
+               }
+               m[nz] = "-0"
+               if m[pz] != "-0" {
+                       fmt.Println("complex64 map does not treat -0 and +0 as equal for write")
+               }
+               if _, ok := m[nana]; ok {
+                       fmt.Println("complex64 map allows NaN lookup (a)")
+               }
+               if _, ok := m[nanb]; ok {
+                       fmt.Println("complex64 map allows NaN lookup (b)")
+               }
+               if len(m) != 3 {
+                       fmt.Println("complex64 map should have 3 entries:", m)
+               }
+               m[nana] = "NaN"
+               m[nanb] = "NaN"
+               if len(m) != 5 {
+                       fmt.Println("complex64 map should have 5 entries:", m)
+               }
+       }
+
+       {
+               var (
+                       pz   = complex128(0)
+                       nz   = complex(0, math.Float64frombits(1<<63))
+                       nana = complex(5, float64(math.NaN()))
+                       nanb = complex(5, math.Float64frombits(math.Float64bits(float64(math.NaN()))^2))
+               )
+
+               m := map[complex128]string{
+                       pz:   "+0",
+                       nana: "NaN",
+                       nanb: "NaN",
+               }
+               if m[nz] != "+0" {
+                       fmt.Println("complex128 map does not treat -0 and +0 as equal for read")
+               }
+               m[nz] = "-0"
+               if m[pz] != "-0" {
+                       fmt.Println("complex128 map does not treat -0 and +0 as equal for write")
+               }
+               if _, ok := m[nana]; ok {
+                       fmt.Println("complex128 map allows NaN lookup (a)")
+               }
+               if _, ok := m[nanb]; ok {
+                       fmt.Println("complex128 map allows NaN lookup (b)")
+               }
+               if len(m) != 3 {
+                       fmt.Println("complex128 map should have 3 entries:", m)
+               }
+               m[nana] = "NaN"
+               m[nanb] = "NaN"
+               if len(m) != 5 {
+                       fmt.Println("complex128 map should have 5 entries:", m)
+               }
+       }
+}
+
+func testnan() {
+       // Test that NaNs in maps don't go quadratic.
+       t := func(n int) time.Duration {
+               t0 := time.Now()
+               m := map[float64]int{}
+               nan := math.NaN()
+               for i := 0; i < n; i++ {
+                       m[nan] = 1
+               }
+               if len(m) != n {
+                       panic("wrong size map after nan insertion")
+               }
+               return time.Since(t0)
+       }
+
+       // Depending on the machine and OS, this test might be too fast
+       // to measure with accurate enough granularity. On failure,
+       // make it run longer, hoping that the timing granularity
+       // is eventually sufficient.
+
+       n := 30000 // 0.02 seconds on a MacBook Air
+       fails := 0
+       for {
+               t1 := t(n)
+               t2 := t(2 * n)
+               // should be 2x (linear); allow up to 3x
+               if t2 < 3*t1 {
+                       return
+               }
+               fails++
+               if fails == 4 {
+                       fmt.Printf("too slow: %d inserts: %v; %d inserts: %v\n", n, t1, 2*n, t2)
+                       return
+               }
+               n *= 2
+       }
+}
index 6af10565cd1cf6750cbeb9049b163e09f6b90c12..6f1a1c8ac01c97288756dc5654acd189194f8807 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test map declarations of many types, including erroneous ones.
+// Does not compile.
+
 package main
 
 func main() {}
@@ -38,4 +41,22 @@ var (
        _ map[[]int]v       // ERROR "invalid map key"
        _ map[func()]v      // ERROR "invalid map key"
        _ map[map[int]int]v // ERROR "invalid map key"
+       _ map[T1]v    // ERROR "invalid map key"
+       _ map[T2]v    // ERROR "invalid map key"
+       _ map[T3]v    // ERROR "invalid map key"
+       _ map[T4]v    // ERROR "invalid map key"
+       _ map[T5]v
+       _ map[T6]v
+       _ map[T7]v
+       _ map[T8]v
 )
+
+type T1 []int
+type T2 struct { F T1 }
+type T3 []T4
+type T4 struct { F T3 }
+
+type T5 *int
+type T6 struct { F T5 }
+type T7 *T4
+type T8 struct { F *T7 }
index b5a02c6873ebca877c9a264f4aedf272f8910017..0c239afbd1946f815b83548d8ab49c40cea5e721 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple methods of various types, with pointer and
+// value receivers.
+
 package main
 
 type S string
@@ -91,27 +94,27 @@ func main() {
        }
 
        if val(s) != 1 {
-               println("s.val:", val(s))
+               println("val(s):", val(s))
                panic("fail")
        }
        if val(ps) != 2 {
-               println("ps.val:", val(ps))
+               println("val(ps):", val(ps))
                panic("fail")
        }
        if val(i) != 3 {
-               println("i.val:", val(i))
+               println("val(i):", val(i))
                panic("fail")
        }
        if val(pi) != 4 {
-               println("pi.val:", val(pi))
+               println("val(pi):", val(pi))
                panic("fail")
        }
        if val(t) != 7 {
-               println("t.val:", val(t))
+               println("val(t):", val(t))
                panic("fail")
        }
        if val(pt) != 8 {
-               println("pt.val:", val(pt))
+               println("val(pt):", val(pt))
                panic("fail")
        }
 
@@ -124,4 +127,124 @@ func main() {
                println("Val.val(v):", Val.val(v))
                panic("fail")
        }
+
+       var zs struct { S }
+       var zps struct { *S1 }
+       var zi struct { I }
+       var zpi struct { *I1 }
+       var zpt struct { *T1 }
+       var zt struct { T }
+       var zv struct { Val }
+
+       if zs.val() != 1 {
+               println("zs.val:", zs.val())
+               panic("fail")
+       }
+       if zps.val() != 2 {
+               println("zps.val:", zps.val())
+               panic("fail")
+       }
+       if zi.val() != 3 {
+               println("zi.val:", zi.val())
+               panic("fail")
+       }
+       if zpi.val() != 4 {
+               println("zpi.val:", zpi.val())
+               panic("fail")
+       }
+       if zt.val() != 7 {
+               println("zt.val:", zt.val())
+               panic("fail")
+       }
+       if zpt.val() != 8 {
+               println("zpt.val:", zpt.val())
+               panic("fail")
+       }
+
+       if val(zs) != 1 {
+               println("val(zs):", val(zs))
+               panic("fail")
+       }
+       if val(zps) != 2 {
+               println("val(zps):", val(zps))
+               panic("fail")
+       }
+       if val(zi) != 3 {
+               println("val(zi):", val(zi))
+               panic("fail")
+       }
+       if val(zpi) != 4 {
+               println("val(zpi):", val(zpi))
+               panic("fail")
+       }
+       if val(zt) != 7 {
+               println("val(zt):", val(zt))
+               panic("fail")
+       }
+       if val(zpt) != 8 {
+               println("val(zpt):", val(zpt))
+               panic("fail")
+       }
+
+       zv.Val = zi
+       if zv.val() != 3 {
+               println("zv.val():", zv.val())
+               panic("fail")
+       }
+
+       if (&zs).val() != 1 {
+               println("(&zs).val:", (&zs).val())
+               panic("fail")
+       }
+       if (&zps).val() != 2 {
+               println("(&zps).val:", (&zps).val())
+               panic("fail")
+       }
+       if (&zi).val() != 3 {
+               println("(&zi).val:", (&zi).val())
+               panic("fail")
+       }
+       if (&zpi).val() != 4 {
+               println("(&zpi).val:", (&zpi).val())
+               panic("fail")
+       }
+       if (&zt).val() != 7 {
+               println("(&zt).val:", (&zt).val())
+               panic("fail")
+       }
+       if (&zpt).val() != 8 {
+               println("(&zpt).val:", (&zpt).val())
+               panic("fail")
+       }
+
+       if val(&zs) != 1 {
+               println("val(&zs):", val(&zs))
+               panic("fail")
+       }
+       if val(&zps) != 2 {
+               println("val(&zps):", val(&zps))
+               panic("fail")
+       }
+       if val(&zi) != 3 {
+               println("val(&zi):", val(&zi))
+               panic("fail")
+       }
+       if val(&zpi) != 4 {
+               println("val(&zpi):", val(&zpi))
+               panic("fail")
+       }
+       if val(&zt) != 7 {
+               println("val(&zt):", val(&zt))
+               panic("fail")
+       }
+       if val(&zpt) != 8 {
+               println("val(&zpt):", val(&zpt))
+               panic("fail")
+       }
+
+       zv.Val = &zi
+       if zv.val() != 3 {
+               println("zv.val():", zv.val())
+               panic("fail")
+       }
 }
index ec14ef9e4f4549602c138a14da48f3ec0b1d2c0f..365b8ca553dafe8490611fc56ca91acd3c4f7564 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that method redeclarations are caught by the compiler.
+// Does not compile.
+
 package main
 
 type T struct { }
index 039779efbe18cf015c39a9336ddac4ffbb53819d..b63da10dc691d45a6e665965927130c23fad3972 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that pointers and interface types cannot be method receivers.
+// Does not compile.
+
 package main
 
 type T struct {
index 7946a87502b7fb0a28c410ae4cc48bdabdff6e99..fd64771527ed07cefb3359189f6ba900193e6842 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG method3
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// test that methods on slices work
+// Test methods on slices.
 
 package main
 
diff --git a/gcc/testsuite/go.test/test/method4.go b/gcc/testsuite/go.test/test/method4.go
new file mode 100644 (file)
index 0000000..7e7b1ff
--- /dev/null
@@ -0,0 +1,109 @@
+// $G $D/method4a.go && $G $D/$F.go && $L $F.$A && ./$A.out
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test method expressions with arguments.
+
+package main
+
+import "./method4a"
+
+type T1 int
+
+type T2 struct {
+       f int
+}
+
+type I1 interface {
+       Sum([]int, int) int
+}
+
+type I2 interface {
+       Sum(a []int, b int) int
+}
+
+func (i T1) Sum(a []int, b int) int {
+       r := int(i) + b
+       for _, v := range a {
+               r += v
+       }
+       return r
+}
+
+func (p *T2) Sum(a []int, b int) int {
+       r := p.f + b
+       for _, v := range a {
+               r += v
+       }
+       return r
+}
+
+func eq(v1, v2 int) {
+       if v1 != v2 {
+               panic(0)
+       }
+}
+
+func main() {
+       a := []int{1, 2, 3}
+       t1 := T1(4)
+       t2 := &T2{4}
+
+       eq(t1.Sum(a, 5), 15)
+       eq(t2.Sum(a, 6), 16)
+
+       eq(T1.Sum(t1, a, 7), 17)
+       eq((*T2).Sum(t2, a, 8), 18)
+
+       f1 := T1.Sum
+       eq(f1(t1, a, 9), 19)
+       f2 := (*T2).Sum
+       eq(f2(t2, a, 10), 20)
+
+       eq(I1.Sum(t1, a, 11), 21)
+       eq(I1.Sum(t2, a, 12), 22)
+
+       f3 := I1.Sum
+       eq(f3(t1, a, 13), 23)
+       eq(f3(t2, a, 14), 24)
+
+       eq(I2.Sum(t1, a, 15), 25)
+       eq(I2.Sum(t2, a, 16), 26)
+
+       f4 := I2.Sum
+       eq(f4(t1, a, 17), 27)
+       eq(f4(t2, a, 18), 28)
+       
+       mt1 := method4a.T1(4)
+       mt2 := &method4a.T2{4}
+
+       eq(mt1.Sum(a, 30), 40)
+       eq(mt2.Sum(a, 31), 41)
+
+       eq(method4a.T1.Sum(mt1, a, 32), 42)
+       eq((*method4a.T2).Sum(mt2, a, 33), 43)
+
+       g1 := method4a.T1.Sum
+       eq(g1(mt1, a, 34), 44)
+       g2 := (*method4a.T2).Sum
+       eq(g2(mt2, a, 35), 45)
+
+       eq(method4a.I1.Sum(mt1, a, 36), 46)
+       eq(method4a.I1.Sum(mt2, a, 37), 47)
+
+       g3 := method4a.I1.Sum
+       eq(g3(mt1, a, 38), 48)
+       eq(g3(mt2, a, 39), 49)
+
+       eq(method4a.I2.Sum(mt1, a, 40), 50)
+       eq(method4a.I2.Sum(mt2, a, 41), 51)
+
+       g4 := method4a.I2.Sum
+       eq(g4(mt1, a, 42), 52)
+       eq(g4(mt2, a, 43), 53)
+}
diff --git a/gcc/testsuite/go.test/test/method4a.go b/gcc/testsuite/go.test/test/method4a.go
new file mode 100644 (file)
index 0000000..d23039b
--- /dev/null
@@ -0,0 +1,40 @@
+// skip
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test method expressions with arguments.
+// This file is not tested by itself; it is imported by method4.go.
+
+package method4a
+
+type T1 int
+
+type T2 struct {
+       F int
+}
+
+type I1 interface {
+       Sum([]int, int) int
+}
+
+type I2 interface {
+       Sum(a []int, b int) int
+}
+
+func (i T1) Sum(a []int, b int) int {
+       r := int(i) + b
+       for _, v := range a {
+               r += v
+       }
+       return r
+}
+
+func (p *T2) Sum(a []int, b int) int {
+       r := p.F + b
+       for _, v := range a {
+               r += v
+       }
+       return r
+}
index 5b6bb81fe342c1905f8e53c768ce90215273ad9b..d0330ab23892ea40073b7db1e2d8416c36bb49d3 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 561d84a43dcfa4564b6a2ca08bd9d68b78cbb692..62b874c5cb9cbebf2bba8a4a87cf4ea544d38708 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,6 +6,7 @@
 
 // Test that basic operations on named types are valid
 // and preserve the type.
+// Does not compile.
 
 package main
 
index efcf4f7822b08c2672ae647c01342a40b8a7023d..9f7bcbb59fdb6182b2528f82bfd0019382eb62d0 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test nil.
+
 package main
 
 import (
index b0c1df2d95c2e59d9545be001f0bb901d3d5f369..b784914e590af5124570bb5f53f6f85fa4e15b0d 100644 (file)
@@ -1,9 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that the implementation catches nil ptr indirection
+// in a large address space.
+
 package main
 
 import "unsafe"
index 142d4deb1f4d3e9bcc8bbf7000fb37689a60f9f3..968c95295132eb6ad8ef7846e44d8da7cb489785 100644 (file)
@@ -3,6 +3,9 @@
 // errchk $G -e tmp.go
 // rm -f tmp.go
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
index 1872cd0ebc9ee8a41ba7bb884aef735578febf34..eafa076481a88eebb4feb678b592b626c04f4c00 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that types can be parenthesized.
+
 package main
 
 func f(interface{})
index dd4c36e0b434f02ea0715daca3c491026b716d30..745f5153f6bcf7189af6864066ec597c12d0a8ea 100644 (file)
@@ -1,9 +1,12 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that heavy recursion works. Simple torture test for
+// segmented stacks: do math in unary by recursion.
+
 package main
 
 type Number *Number
index d867bdc646c14c34807a7a8417e4c7cfb28e2794..5693c58d4f6a35407acff36e6e29daf9e24135de 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+// cmpout
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that big numbers work as constants and print can print them.
+
 package main
 
 func main() {
index 84119450b281fe589f1622172be90eced182a5a8..68b0c9a2f3362be907da60e6fb25c207a4df98f9 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the 'for range' construct.
+
 package main
 
 // test range over channels
@@ -56,6 +58,17 @@ func testslice() {
                println("wrong sum ranging over makeslice")
                panic("fail")
        }
+       
+       x := []int{10, 20}
+       y := []int{99}
+       i := 1
+       for i, x[i] = range y {
+               break
+       }
+       if i != 0 || x[0] != 10 || x[1] != 99 {
+               println("wrong parallel assignment", i, x[0], x[1])
+               panic("fail")
+       }
 }
 
 func testslice1() {
index ca6f0728860c7aa3006026695df48cd72a7c2475..eea655ec5789f2eb7370e968cf29688aa49869b4 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -244,3 +244,30 @@ func test7() {
                die()
        }
 }
+
+func varargs(s *int, a ...int) {
+       *s = 0
+       for _, v := range a {
+               *s += v
+       }
+       if recover() != nil {
+               *s += 100
+       }
+}
+
+func test8a() (r int) {
+       defer varargs(&r, 1, 2, 3)
+       panic(0)
+}
+
+func test8b() (r int) {
+       defer varargs(&r, 4, 5, 6)
+       return
+}
+
+func test8() {
+       if test8a() != 106 || test8b() != 15 {
+               println("wrong value")
+               die()
+       }
+}
index db584738bb556e38d2e292a75445947f66a620c5..b763a10741746eeec64f2ccde024a469a9c3ce2e 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index b5db6f0d1ca424868958267331fb169121cdf315..946d05ae637f7da30779468a2e60a8e228ea4374 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 60ade9b61c5e6e3b675ea31f93056788ef5efc48..98700231ef516e21e927ca5f3b2093c016e9ed9c 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test recovering from runtime errors.
+
 package main
 
 import (
index f21ef015b22fccfb756fbe34062a298df5cef821..e54427455380aa55a9e4fb351821a25150c50d35 100644 (file)
@@ -1,73 +1,99 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that predeclared names can be redeclared by the user.
+
 package main
 
 import "fmt"
 
 func main() {
        n :=
-               bool +
+               append +
+                       bool +
                        byte +
-                       float +
+                       complex +
+                       complex64 +
+                       complex128 +
+                       cap +
+                       close +
+                       delete +
+                       error +
+                       false +
                        float32 +
                        float64 +
+                       imag +
                        int +
                        int8 +
                        int16 +
                        int32 +
                        int64 +
+                       len +
+                       make +
+                       new +
+                       nil +
+                       panic +
+                       print +
+                       println +
+                       real +
+                       recover +
+                       rune +
+                       string +
+                       true +
                        uint +
                        uint8 +
                        uint16 +
                        uint32 +
                        uint64 +
                        uintptr +
-                       true +
-                       false +
-                       iota +
-                       nil +
-                       cap +
-                       len +
-                       make +
-                       new +
-                       panic +
-                       print +
-                       println
-       if n != 27*28/2 {
-               fmt.Println("BUG: wrong n", n, 27*28/2)
+                       iota
+       if n != NUM*(NUM-1)/2 {
+               fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2)
        }
 }
 
 const (
-       bool    = 1
-       byte    = 2
-       float   = 3
-       float32 = 4
-       float64 = 5
-       int     = 6
-       int8    = 7
-       int16   = 8
-       int32   = 9
-       int64   = 10
-       uint    = 11
-       uint8   = 12
-       uint16  = 13
-       uint32  = 14
-       uint64  = 15
-       uintptr = 16
-       true    = 17
-       false   = 18
-       iota    = 19
-       nil     = 20
-       cap     = 21
-       len     = 22
-       make    = 23
-       new     = 24
-       panic   = 25
-       print   = 26
-       println = 27
+       // cannot use iota here, because iota = 38 below
+       append     = 1
+       bool       = 2
+       byte       = 3
+       complex    = 4
+       complex64  = 5
+       complex128 = 6
+       cap        = 7
+       close      = 8
+       delete     = 9
+       error      = 10
+       false      = 11
+       float32    = 12
+       float64    = 13
+       imag       = 14
+       int        = 15
+       int8       = 16
+       int16      = 17
+       int32      = 18
+       int64      = 19
+       len        = 20
+       make       = 21
+       new        = 22
+       nil        = 23
+       panic      = 24
+       print      = 25
+       println    = 26
+       real       = 27
+       recover    = 28
+       rune       = 29
+       string     = 30
+       true       = 31
+       uint       = 32
+       uint8      = 33
+       uint16     = 34
+       uint32     = 35
+       uint64     = 36
+       uintptr    = 37
+       iota       = 38
+       NUM        = 39
 )
index 3e78bfca0bc505bd70acf826295292c4a2ab41bc..53db68de16e759f9140430322a1d84a0ea2a747b 100644 (file)
@@ -1,14 +1,17 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that renamed identifiers no longer have their old meaning.
+// Does not compile.
+
 package main
 
 func main() {
        var n byte       // ERROR "not a type|expected type"
-       var y = float(0) // ERROR "cannot call|expected function"
+       var y = float32(0) // ERROR "cannot call|expected function"
        const (
                a = 1 + iota // ERROR "string|incompatible types" "convert iota"
        )
@@ -16,31 +19,42 @@ func main() {
 }
 
 const (
-       bool    = 1
-       byte    = 2
-       float   = 3
-       float32 = 4
-       float64 = 5
-       int     = 6
-       int8    = 7
-       int16   = 8
-       int32   = 9
-       int64   = 10
-       uint    = 11
-       uint8   = 12
-       uint16  = 13
-       uint32  = 14
-       uint64  = 15
-       uintptr = 16
-       true    = 17
-       false   = 18
-       iota    = "abc"
-       nil     = 20
-       cap     = 21
-       len     = 22
-       make    = 23
-       new     = 24
-       panic   = 25
-       print   = 26
-       println = 27
+       append     = 1
+       bool       = 2
+       byte       = 3
+       complex    = 4
+       complex64  = 5
+       complex128 = 6
+       cap        = 7
+       close      = 8
+       delete     = 9
+       error      = 10
+       false      = 11
+       float32    = 12
+       float64    = 13
+       imag       = 14
+       int        = 15
+       int8       = 16
+       int16      = 17
+       int32      = 18
+       int64      = 19
+       len        = 20
+       make       = 21
+       new        = 22
+       nil        = 23
+       panic      = 24
+       print      = 25
+       println    = 26
+       real       = 27
+       recover    = 28
+       rune       = 29
+       string     = 30
+       true       = 31
+       uint       = 32
+       uint8      = 33
+       uint16     = 34
+       uint32     = 35
+       uint64     = 36
+       uintptr    = 37
+       iota       = "38"
 )
index 67d07523b41d8cef1bfac362b7c1fceaf8c65ea2..0cdeebd0f3160f4c303bf65383adeb6375c62c07 100644 (file)
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check reordering of assignments.
+// Test reordering of assignments.
 
 package main
 
@@ -19,6 +19,7 @@ func main() {
        p6()
        p7()
        p8()
+       p9()
 }
 
 var gx []int
@@ -119,3 +120,11 @@ func p8() {
        i := 0
        i, x[i], x[5] = 1, 100, 500
 }
+
+func p9() {
+       m := make(map[int]int)
+       m[0] = len(m)
+       if m[0] != 0 {
+               panic(m[0])
+       }
+}
diff --git a/gcc/testsuite/go.test/test/reorder2.go b/gcc/testsuite/go.test/test/reorder2.go
new file mode 100644 (file)
index 0000000..d91f1d8
--- /dev/null
@@ -0,0 +1,174 @@
+// run
+
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test reorderings; derived from fixedbugs/bug294.go.
+
+package main
+
+var log string
+
+type TT int
+
+func (t TT) a(s string) TT {
+       log += "a(" + s + ")"
+       return t
+}
+
+func (TT) b(s string) string {
+       log += "b(" + s + ")"
+       return s
+}
+
+type F func(s string) F
+
+func a(s string) F {
+       log += "a(" + s + ")"
+       return F(a)
+}
+
+func b(s string) string {
+       log += "b(" + s + ")"
+       return s
+}
+
+type I interface {
+       a(s string) I
+       b(s string) string
+}
+
+type T1 int
+
+func (t T1) a(s string) I {
+       log += "a(" + s + ")"
+       return t
+}
+
+func (T1) b(s string) string {
+       log += "b(" + s + ")"
+       return s
+}
+
+// f(g(), h()) where g is not inlinable but h is will have the same problem.
+// As will x := g() + h() (same conditions).
+// And g() <- h().
+func f(x, y string) {
+       log += "f(" + x + ", " + y + ")"
+}
+
+func ff(x, y string) {
+       for false {
+       } // prevent inl
+       log += "ff(" + x + ", " + y + ")"
+}
+
+func h(x string) string {
+       log += "h(" + x + ")"
+       return x
+}
+
+func g(x string) string {
+       for false {
+       } // prevent inl
+       log += "g(" + x + ")"
+       return x
+}
+
+func main() {
+       err := 0
+       var t TT
+       if a("1")("2")("3"); log != "a(1)a(2)a(3)" {
+               println("expecting a(1)a(2)a(3) , got ", log)
+               err++
+       }
+       log = ""
+
+       if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" {
+               println("expecting a(1)b(2)a(2), got ", log)
+               err++
+       }
+       log = ""
+       if a("3")(b("4"))(b("5")); log != "a(3)b(4)a(4)b(5)a(5)" {
+               println("expecting a(3)b(4)a(4)b(5)a(5), got ", log)
+               err++
+       }
+       log = ""
+       var i I = T1(0)
+       if i.a("6").a(i.b("7")).a(i.b("8")).a(i.b("9")); log != "a(6)b(7)a(7)b(8)a(8)b(9)a(9)" {
+               println("expecting a(6)ba(7)ba(8)ba(9), got", log)
+               err++
+       }
+       log = ""
+
+       if s := t.a("1").b("3"); log != "a(1)b(3)" || s != "3" {
+               println("expecting a(1)b(3) and 3, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if s := t.a("1").a(t.b("2")).b("3") + t.a("4").b("5"); log != "a(1)b(2)a(2)b(3)a(4)b(5)" || s != "35" {
+               println("expecting a(1)b(2)a(2)b(3)a(4)b(5) and 35, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if s := t.a("4").b("5") + t.a("1").a(t.b("2")).b("3"); log != "a(4)b(5)a(1)b(2)a(2)b(3)" || s != "53" {
+               println("expecting a(4)b(5)a(1)b(2)a(2)b(3) and 35, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if ff(g("1"), g("2")); log != "g(1)g(2)ff(1, 2)" {
+               println("expecting g(1)g(2)ff..., got ", log)
+               err++
+       }
+       log = ""
+
+       if ff(g("1"), h("2")); log != "g(1)h(2)ff(1, 2)" {
+               println("expecting g(1)h(2)ff..., got ", log)
+               err++
+       }
+       log = ""
+
+       if ff(h("1"), g("2")); log != "h(1)g(2)ff(1, 2)" {
+               println("expecting h(1)g(2)ff..., got ", log)
+               err++
+       }
+       log = ""
+
+       if ff(h("1"), h("2")); log != "h(1)h(2)ff(1, 2)" {
+               println("expecting h(1)h(2)ff..., got ", log)
+               err++
+       }
+       log = ""
+
+       if s := g("1") + g("2"); log != "g(1)g(2)" || s != "12" {
+               println("expecting g1g2 and 12, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if s := g("1") + h("2"); log != "g(1)h(2)" || s != "12" {
+               println("expecting g1h2 and 12, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if s := h("1") + g("2"); log != "h(1)g(2)" || s != "12" {
+               println("expecting h1g2 and 12, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if s := h("1") + h("2"); log != "h(1)h(2)" || s != "12" {
+               println("expecting h1h2 and 12, got ", log, " and ", s)
+               err++
+       }
+       log = ""
+
+       if err > 0 {
+               panic("fail")
+       }
+}
diff --git a/gcc/testsuite/go.test/test/rotate.go b/gcc/testsuite/go.test/test/rotate.go
new file mode 100644 (file)
index 0000000..aa334b4
--- /dev/null
@@ -0,0 +1,171 @@
+// $G $D/$F.go && $L $F.$A &&
+// ./$A.out >tmp.go && $G tmp.go && $L -o $A.out1 tmp.$A && ./$A.out1
+// rm -f tmp.go $A.out1
+
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Generate test of shift and rotate by constants.
+// The output is compiled and run.
+//
+// The output takes around a gigabyte of memory to compile, link, and run
+// but it is only done during ./run, not in normal builds using run.go.
+
+package main
+
+import (
+       "bufio"
+       "flag"
+       "fmt"
+       "os"
+       "strings"
+)
+
+func main() {
+       flag.Parse()
+
+       b := bufio.NewWriter(os.Stdout)
+       defer b.Flush()
+
+       fmt.Fprintf(b, "%s\n", prolog)
+
+       for logBits := uint(3); logBits <= 6; logBits++ {
+               typ := fmt.Sprintf("int%d", 1<<logBits)
+               fmt.Fprint(b, strings.Replace(checkFunc, "XXX", typ, -1))
+               fmt.Fprint(b, strings.Replace(checkFunc, "XXX", "u"+typ, -1))
+               for mode := 0; mode < 1<<2; mode++ {
+                       gentest(b, 1<<logBits, mode&1 != 0, mode&2 != 0)
+               }
+       }
+}
+
+const prolog = `
+
+package main
+
+import (
+       "fmt"
+       "os"
+)
+
+var (
+       i8 int8 = 0x12
+       i16 int16 = 0x1234
+       i32 int32 = 0x12345678
+       i64 int64 = 0x123456789abcdef0
+       ui8 uint8 = 0x12
+       ui16 uint16 = 0x1234
+       ui32 uint32 = 0x12345678
+       ui64 uint64 = 0x123456789abcdef0
+
+       ni8 = ^i8
+       ni16 = ^i16
+       ni32 = ^i32
+       ni64 = ^i64
+       nui8 = ^ui8
+       nui16 = ^ui16
+       nui32 = ^ui32
+       nui64 = ^ui64
+)
+
+var nfail = 0
+
+func main() {
+       if nfail > 0 {
+               fmt.Printf("BUG\n")
+       }
+}
+
+`
+
+const checkFunc = `
+func check_XXX(desc string, have, want XXX) {
+       if have != want {
+               nfail++
+               fmt.Printf("%s = %T(%#x), want %T(%#x)\n", desc, have, have, want, want)
+               if nfail >= 100 {
+                       fmt.Printf("BUG: stopping after 100 failures\n")
+                       os.Exit(0)
+               }
+       }
+}
+`
+
+var (
+       uop = [2]func(x, y uint64) uint64{
+               func(x, y uint64) uint64 {
+                       return x | y
+               },
+               func(x, y uint64) uint64 {
+                       return x ^ y
+               },
+       }
+       iop = [2]func(x, y int64) int64{
+               func(x, y int64) int64 {
+                       return x | y
+               },
+               func(x, y int64) int64 {
+                       return x ^ y
+               },
+       }
+       cop = [2]byte{'|', '^'}
+)
+
+func gentest(b *bufio.Writer, bits uint, unsigned, inverted bool) {
+       fmt.Fprintf(b, "func init() {\n")
+       defer fmt.Fprintf(b, "}\n")
+       n := 0
+
+       // Generate tests for left/right and right/left.
+       for l := uint(0); l <= bits; l++ {
+               for r := uint(0); r <= bits; r++ {
+                       for o, op := range cop {
+                               typ := fmt.Sprintf("int%d", bits)
+                               v := fmt.Sprintf("i%d", bits)
+                               if unsigned {
+                                       typ = "u" + typ
+                                       v = "u" + v
+                               }
+                               v0 := int64(0x123456789abcdef0)
+                               if inverted {
+                                       v = "n" + v
+                                       v0 = ^v0
+                               }
+                               expr1 := fmt.Sprintf("%s<<%d %c %s>>%d", v, l, op, v, r)
+                               expr2 := fmt.Sprintf("%s>>%d %c %s<<%d", v, r, op, v, l)
+
+                               var result string
+                               if unsigned {
+                                       v := uint64(v0) >> (64 - bits)
+                                       v = uop[o](v<<l, v>>r)
+                                       v <<= 64 - bits
+                                       v >>= 64 - bits
+                                       result = fmt.Sprintf("%#x", v)
+                               } else {
+                                       v := int64(v0) >> (64 - bits)
+                                       v = iop[o](v<<l, v>>r)
+                                       v <<= 64 - bits
+                                       v >>= 64 - bits
+                                       result = fmt.Sprintf("%#x", v)
+                               }
+
+                               fmt.Fprintf(b, "\tcheck_%s(%q, %s, %s(%s))\n", typ, expr1, expr1, typ, result)
+                               fmt.Fprintf(b, "\tcheck_%s(%q, %s, %s(%s))\n", typ, expr2, expr2, typ, result)
+
+                               // Chop test into multiple functions so that there's not one
+                               // enormous function to compile/link.
+                               // All the functions are named init so we don't have to do
+                               // anything special to call them.  ☺
+                               if n++; n >= 50 {
+                                       fmt.Fprintf(b, "}\n")
+                                       fmt.Fprintf(b, "func init() {\n")
+                                       n = 0
+                               }
+                       }
+               }
+       }
+}
index 03c91ee30ee3cea462898ca0f6ae89d2c51c1de3..d206312a29c729c7a3f85b262f5fc3e2b2a9b8b8 100755 (executable)
@@ -3,8 +3,8 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-eval $(gomake --no-print-directory -f ../src/Make.inc go-env)
-
+eval $(go tool dist env)
+export GOARCH GOOS GOROOT
 export E=
 
 case X"$GOARCH" in
@@ -29,13 +29,18 @@ export GOTRACEBACK=0
 export LANG=C
 unset GREP_OPTIONS     # in case user has a non-standard set
 
+unset GOROOT_FINAL  # breaks ./ imports
+
 failed=0
 
 PATH=${GOBIN:-$GOROOT/bin}:`pwd`:/bin:/usr/bin:/usr/local/bin
 
-RUNFILE="/tmp/gorun-$$-$USER"
-TMP1FILE="/tmp/gotest1-$$-$USER"
-TMP2FILE="/tmp/gotest2-$$-$USER"
+# TODO: We add the tool directory to the PATH to avoid thinking about a better way.
+PATH="$GOTOOLDIR:$PATH"
+
+RUNFILE="${TMPDIR:-/tmp}/gorun-$$-$USER"
+TMP1FILE="${TMPDIR:-/tmp}/gotest1-$$-$USER"
+TMP2FILE="${TMPDIR:-/tmp}/gotest2-$$-$USER"
 
 # don't run the machine out of memory: limit individual processes to 4GB.
 # on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
@@ -49,11 +54,13 @@ true >pass.out >times.out
 exclude=false  # exclude nothing
 golden=golden.out
 
+rm -f tmp.go  # generated by some tests, left behind if interrupted
+
 filterout() {
        grep '^'"$2"'$' $1 >/dev/null
 }
 
-for dir in . ken chan interface syntax dwarf fixedbugs bugs
+for dir in . ken chan interface syntax dwarf safe fixedbugs bugs
 do
        echo
        echo '==' $dir'/'
@@ -64,7 +71,8 @@ do
                fi
                export F=$(basename $i .go)
                export D=$dir
-               sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE"
+               echo '. ./testlib' >"$RUNFILE"
+               sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >>"$RUNFILE"
                if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE"
                then
                        echo
@@ -94,7 +102,7 @@ do
                        echo $i >>pass.out
                fi
                echo $(awk 'NR==1{print $2}' "$TMP2FILE") $D/$F >>times.out
-               rm -f $F.$A $A.out
+               rm -f $F.$A $A.out tmp.go
        ) done
 done | # clean up some stack noise
        egrep -v '^(r[0-9a-z]+|[cfg]s)  +0x'  |
diff --git a/gcc/testsuite/go.test/test/run.go b/gcc/testsuite/go.test/test/run.go
new file mode 100644 (file)
index 0000000..10dbcef
--- /dev/null
@@ -0,0 +1,607 @@
+// skip
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Run runs tests in the test directory.
+// 
+// TODO(bradfitz): docs of some sort, once we figure out how we're changing
+// headers of files
+package main
+
+import (
+       "bytes"
+       "errors"
+       "flag"
+       "fmt"
+       "go/build"
+       "io/ioutil"
+       "log"
+       "os"
+       "os/exec"
+       "path"
+       "path/filepath"
+       "regexp"
+       "runtime"
+       "sort"
+       "strconv"
+       "strings"
+)
+
+var (
+       verbose     = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.")
+       numParallel = flag.Int("n", runtime.NumCPU(), "number of parallel tests to run")
+       summary     = flag.Bool("summary", false, "show summary of results")
+       showSkips   = flag.Bool("show_skips", false, "show skipped tests")
+)
+
+var (
+       // gc and ld are [568][gl].
+       gc, ld string
+
+       // letter is the build.ArchChar
+       letter string
+
+       // dirs are the directories to look for *.go files in.
+       // TODO(bradfitz): just use all directories?
+       dirs = []string{".", "ken", "chan", "interface", "syntax", "dwarf", "fixedbugs", "bugs"}
+
+       // ratec controls the max number of tests running at a time.
+       ratec chan bool
+
+       // toRun is the channel of tests to run.
+       // It is nil until the first test is started.
+       toRun chan *test
+)
+
+// maxTests is an upper bound on the total number of tests.
+// It is used as a channel buffer size to make sure sends don't block.
+const maxTests = 5000
+
+func main() {
+       flag.Parse()
+
+       // Disable parallelism if printing
+       if *verbose {
+               *numParallel = 1
+       }
+
+       ratec = make(chan bool, *numParallel)
+       var err error
+       letter, err = build.ArchChar(build.Default.GOARCH)
+       check(err)
+       gc = letter + "g"
+       ld = letter + "l"
+
+       var tests []*test
+       if flag.NArg() > 0 {
+               for _, arg := range flag.Args() {
+                       if arg == "-" || arg == "--" {
+                               // Permit running:
+                               // $ go run run.go - env.go
+                               // $ go run run.go -- env.go
+                               // $ go run run.go - ./fixedbugs
+                               // $ go run run.go -- ./fixedbugs
+                               continue
+                       }
+                       if fi, err := os.Stat(arg); err == nil && fi.IsDir() {
+                               for _, baseGoFile := range goFiles(arg) {
+                                       tests = append(tests, startTest(arg, baseGoFile))
+                               }
+                       } else if strings.HasSuffix(arg, ".go") {
+                               dir, file := filepath.Split(arg)
+                               tests = append(tests, startTest(dir, file))
+                       } else {
+                               log.Fatalf("can't yet deal with non-directory and non-go file %q", arg)
+                       }
+               }
+       } else {
+               for _, dir := range dirs {
+                       for _, baseGoFile := range goFiles(dir) {
+                               tests = append(tests, startTest(dir, baseGoFile))
+                       }
+               }
+       }
+
+       failed := false
+       resCount := map[string]int{}
+       for _, test := range tests {
+               <-test.donec
+               _, isSkip := test.err.(skipError)
+               errStr := "pass"
+               if test.err != nil {
+                       errStr = test.err.Error()
+                       if !isSkip {
+                               failed = true
+                       }
+               }
+               if isSkip && !skipOkay[path.Join(test.dir, test.gofile)] {
+                       errStr = "unexpected skip for " + path.Join(test.dir, test.gofile) + ": " + errStr
+                       isSkip = false
+                       failed = true
+               }
+               resCount[errStr]++
+               if isSkip && !*verbose && !*showSkips {
+                       continue
+               }
+               if !*verbose && test.err == nil {
+                       continue
+               }
+               fmt.Printf("%-10s %-20s: %s\n", test.action, test.goFileName(), errStr)
+       }
+
+       if *summary {
+               for k, v := range resCount {
+                       fmt.Printf("%5d %s\n", v, k)
+               }
+       }
+
+       if failed {
+               os.Exit(1)
+       }
+}
+
+func toolPath(name string) string {
+       p := filepath.Join(os.Getenv("GOROOT"), "bin", "tool", name)
+       if _, err := os.Stat(p); err != nil {
+               log.Fatalf("didn't find binary at %s", p)
+       }
+       return p
+}
+
+func goFiles(dir string) []string {
+       f, err := os.Open(dir)
+       check(err)
+       dirnames, err := f.Readdirnames(-1)
+       check(err)
+       names := []string{}
+       for _, name := range dirnames {
+               if !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") {
+                       names = append(names, name)
+               }
+       }
+       sort.Strings(names)
+       return names
+}
+
+// skipError describes why a test was skipped.
+type skipError string
+
+func (s skipError) Error() string { return string(s) }
+
+func check(err error) {
+       if err != nil {
+               log.Fatal(err)
+       }
+}
+
+// test holds the state of a test.
+type test struct {
+       dir, gofile string
+       donec       chan bool // closed when done
+
+       src    string
+       action string // "compile", "build", "run", "errorcheck", "skip", "runoutput", "compiledir"
+
+       tempDir string
+       err     error
+}
+
+// startTest 
+func startTest(dir, gofile string) *test {
+       t := &test{
+               dir:    dir,
+               gofile: gofile,
+               donec:  make(chan bool, 1),
+       }
+       if toRun == nil {
+               toRun = make(chan *test, maxTests)
+               go runTests()
+       }
+       select {
+       case toRun <- t:
+       default:
+               panic("toRun buffer size (maxTests) is too small")
+       }
+       return t
+}
+
+// runTests runs tests in parallel, but respecting the order they
+// were enqueued on the toRun channel.
+func runTests() {
+       for {
+               ratec <- true
+               t := <-toRun
+               go func() {
+                       t.run()
+                       <-ratec
+               }()
+       }
+}
+
+var cwd, _ = os.Getwd()
+
+func (t *test) goFileName() string {
+       return filepath.Join(t.dir, t.gofile)
+}
+
+func (t *test) goDirName() string {
+       return filepath.Join(t.dir, strings.Replace(t.gofile, ".go", ".dir", -1))
+}
+
+// run runs a test.
+func (t *test) run() {
+       defer close(t.donec)
+
+       srcBytes, err := ioutil.ReadFile(t.goFileName())
+       if err != nil {
+               t.err = err
+               return
+       }
+       t.src = string(srcBytes)
+       if t.src[0] == '\n' {
+               t.err = skipError("starts with newline")
+               return
+       }
+       pos := strings.Index(t.src, "\n\n")
+       if pos == -1 {
+               t.err = errors.New("double newline not found")
+               return
+       }
+       action := t.src[:pos]
+       if strings.HasPrefix(action, "//") {
+               action = action[2:]
+       }
+
+       var args, flags []string
+       wantError := false
+       f := strings.Fields(action)
+       if len(f) > 0 {
+               action = f[0]
+               args = f[1:]
+       }
+
+       switch action {
+       case "cmpout":
+               action = "run" // the run case already looks for <dir>/<test>.out files
+               fallthrough
+       case "compile", "compiledir", "build", "run", "runoutput":
+               t.action = action
+       case "errorcheck":
+               t.action = action
+               wantError = true
+               for len(args) > 0 && strings.HasPrefix(args[0], "-") {
+                       if args[0] == "-0" {
+                               wantError = false
+                       } else {
+                               flags = append(flags, args[0])
+                       }
+                       args = args[1:]
+               }
+       case "skip":
+               t.action = "skip"
+               return
+       default:
+               t.err = skipError("skipped; unknown pattern: " + action)
+               t.action = "??"
+               return
+       }
+
+       t.makeTempDir()
+       defer os.RemoveAll(t.tempDir)
+
+       err = ioutil.WriteFile(filepath.Join(t.tempDir, t.gofile), srcBytes, 0644)
+       check(err)
+
+       // A few tests (of things like the environment) require these to be set.
+       os.Setenv("GOOS", runtime.GOOS)
+       os.Setenv("GOARCH", runtime.GOARCH)
+
+       useTmp := true
+       runcmd := func(args ...string) ([]byte, error) {
+               cmd := exec.Command(args[0], args[1:]...)
+               var buf bytes.Buffer
+               cmd.Stdout = &buf
+               cmd.Stderr = &buf
+               if useTmp {
+                       cmd.Dir = t.tempDir
+               }
+               err := cmd.Run()
+               return buf.Bytes(), err
+       }
+
+       long := filepath.Join(cwd, t.goFileName())
+       switch action {
+       default:
+               t.err = fmt.Errorf("unimplemented action %q", action)
+
+       case "errorcheck":
+               cmdline := []string{"go", "tool", gc, "-e", "-o", "a." + letter}
+               cmdline = append(cmdline, flags...)
+               cmdline = append(cmdline, long)
+               out, err := runcmd(cmdline...)
+               if wantError {
+                       if err == nil {
+                               t.err = fmt.Errorf("compilation succeeded unexpectedly\n%s", out)
+                               return
+                       }
+               } else {
+                       if err != nil {
+                               t.err = fmt.Errorf("%s\n%s", err, out)
+                               return
+                       }
+               }
+               t.err = t.errorCheck(string(out), long, t.gofile)
+               return
+
+       case "compile":
+               out, err := runcmd("go", "tool", gc, "-e", "-o", "a."+letter, long)
+               if err != nil {
+                       t.err = fmt.Errorf("%s\n%s", err, out)
+               }
+
+       case "compiledir":
+               // Compile all files in the directory in lexicographic order.
+               longdir := filepath.Join(cwd, t.goDirName())
+               files, dirErr := ioutil.ReadDir(longdir)
+               if dirErr != nil {
+                       t.err = dirErr
+                       return
+               }
+               for _, gofile := range files {
+                       if filepath.Ext(gofile.Name()) != ".go" {
+                               continue
+                       }
+                       afile := strings.Replace(gofile.Name(), ".go", "."+letter, -1)
+                       out, err := runcmd("go", "tool", gc, "-e", "-D.", "-I.", "-o", afile, filepath.Join(longdir, gofile.Name()))
+                       if err != nil {
+                               t.err = fmt.Errorf("%s\n%s", err, out)
+                               break
+                       }
+               }
+
+       case "build":
+               out, err := runcmd("go", "build", "-o", "a.exe", long)
+               if err != nil {
+                       t.err = fmt.Errorf("%s\n%s", err, out)
+               }
+
+       case "run":
+               useTmp = false
+               out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...)
+               if err != nil {
+                       t.err = fmt.Errorf("%s\n%s", err, out)
+               }
+               if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() {
+                       t.err = fmt.Errorf("incorrect output\n%s", out)
+               }
+
+       case "runoutput":
+               useTmp = false
+               out, err := runcmd("go", "run", t.goFileName())
+               if err != nil {
+                       t.err = fmt.Errorf("%s\n%s", err, out)
+               }
+               tfile := filepath.Join(t.tempDir, "tmp__.go")
+               err = ioutil.WriteFile(tfile, out, 0666)
+               if err != nil {
+                       t.err = fmt.Errorf("write tempfile:%s", err)
+                       return
+               }
+               out, err = runcmd("go", "run", tfile)
+               if err != nil {
+                       t.err = fmt.Errorf("%s\n%s", err, out)
+               }
+               if string(out) != t.expectedOutput() {
+                       t.err = fmt.Errorf("incorrect output\n%s", out)
+               }
+       }
+}
+
+func (t *test) String() string {
+       return filepath.Join(t.dir, t.gofile)
+}
+
+func (t *test) makeTempDir() {
+       var err error
+       t.tempDir, err = ioutil.TempDir("", "")
+       check(err)
+}
+
+func (t *test) expectedOutput() string {
+       filename := filepath.Join(t.dir, t.gofile)
+       filename = filename[:len(filename)-len(".go")]
+       filename += ".out"
+       b, _ := ioutil.ReadFile(filename)
+       return string(b)
+}
+
+func (t *test) errorCheck(outStr string, full, short string) (err error) {
+       defer func() {
+               if *verbose && err != nil {
+                       log.Printf("%s gc output:\n%s", t, outStr)
+               }
+       }()
+       var errs []error
+
+       var out []string
+       // 6g error messages continue onto additional lines with leading tabs.
+       // Split the output at the beginning of each line that doesn't begin with a tab.
+       for _, line := range strings.Split(outStr, "\n") {
+               if strings.HasSuffix(line, "\r") { // remove '\r', output by compiler on windows
+                       line = line[:len(line)-1]
+               }
+               if strings.HasPrefix(line, "\t") {
+                       out[len(out)-1] += "\n" + line
+               } else {
+                       out = append(out, line)
+               }
+       }
+
+       // Cut directory name.
+       for i := range out {
+               out[i] = strings.Replace(out[i], full, short, -1)
+       }
+
+       for _, we := range t.wantedErrors() {
+               var errmsgs []string
+               errmsgs, out = partitionStrings(we.filterRe, out)
+               if len(errmsgs) == 0 {
+                       errs = append(errs, fmt.Errorf("%s:%d: missing error %q", we.file, we.lineNum, we.reStr))
+                       continue
+               }
+               matched := false
+               for _, errmsg := range errmsgs {
+                       if we.re.MatchString(errmsg) {
+                               matched = true
+                       } else {
+                               out = append(out, errmsg)
+                       }
+               }
+               if !matched {
+                       errs = append(errs, fmt.Errorf("%s:%d: no match for %q in%s", we.file, we.lineNum, we.reStr, strings.Join(out, "\n")))
+                       continue
+               }
+       }
+
+       if len(errs) == 0 {
+               return nil
+       }
+       if len(errs) == 1 {
+               return errs[0]
+       }
+       var buf bytes.Buffer
+       fmt.Fprintf(&buf, "\n")
+       for _, err := range errs {
+               fmt.Fprintf(&buf, "%s\n", err.Error())
+       }
+       return errors.New(buf.String())
+
+}
+
+func partitionStrings(rx *regexp.Regexp, strs []string) (matched, unmatched []string) {
+       for _, s := range strs {
+               if rx.MatchString(s) {
+                       matched = append(matched, s)
+               } else {
+                       unmatched = append(unmatched, s)
+               }
+       }
+       return
+}
+
+type wantedError struct {
+       reStr    string
+       re       *regexp.Regexp
+       lineNum  int
+       file     string
+       filterRe *regexp.Regexp // /^file:linenum\b/m
+}
+
+var (
+       errRx       = regexp.MustCompile(`// (?:GC_)?ERROR (.*)`)
+       errQuotesRx = regexp.MustCompile(`"([^"]*)"`)
+       lineRx      = regexp.MustCompile(`LINE(([+-])([0-9]+))?`)
+)
+
+func (t *test) wantedErrors() (errs []wantedError) {
+       for i, line := range strings.Split(t.src, "\n") {
+               lineNum := i + 1
+               if strings.Contains(line, "////") {
+                       // double comment disables ERROR
+                       continue
+               }
+               m := errRx.FindStringSubmatch(line)
+               if m == nil {
+                       continue
+               }
+               all := m[1]
+               mm := errQuotesRx.FindAllStringSubmatch(all, -1)
+               if mm == nil {
+                       log.Fatalf("invalid errchk line in %s: %s", t.goFileName(), line)
+               }
+               for _, m := range mm {
+                       rx := lineRx.ReplaceAllStringFunc(m[1], func(m string) string {
+                               n := lineNum
+                               if strings.HasPrefix(m, "LINE+") {
+                                       delta, _ := strconv.Atoi(m[5:])
+                                       n += delta
+                               } else if strings.HasPrefix(m, "LINE-") {
+                                       delta, _ := strconv.Atoi(m[5:])
+                                       n -= delta
+                               }
+                               return fmt.Sprintf("%s:%d", t.gofile, n)
+                       })
+                       filterPattern := fmt.Sprintf(`^(\w+/)?%s:%d[:[]`, t.gofile, lineNum)
+                       errs = append(errs, wantedError{
+                               reStr:    rx,
+                               re:       regexp.MustCompile(rx),
+                               filterRe: regexp.MustCompile(filterPattern),
+                               lineNum:  lineNum,
+                               file:     t.gofile,
+                       })
+               }
+       }
+
+       return
+}
+
+var skipOkay = map[string]bool{
+       "args.go":                 true,
+       "ddd3.go":                 true,
+       "import3.go":              true,
+       "import4.go":              true,
+       "index.go":                true,
+       "linkx.go":                true,
+       "method4.go":              true,
+       "nul1.go":                 true,
+       "rotate.go":               true,
+       "sigchld.go":              true,
+       "sinit.go":                true,
+       "interface/embed1.go":     true,
+       "interface/private.go":    true,
+       "interface/recursive2.go": true,
+       "dwarf/main.go":           true,
+       "dwarf/z1.go":             true,
+       "dwarf/z10.go":            true,
+       "dwarf/z11.go":            true,
+       "dwarf/z12.go":            true,
+       "dwarf/z13.go":            true,
+       "dwarf/z14.go":            true,
+       "dwarf/z15.go":            true,
+       "dwarf/z16.go":            true,
+       "dwarf/z17.go":            true,
+       "dwarf/z18.go":            true,
+       "dwarf/z19.go":            true,
+       "dwarf/z2.go":             true,
+       "dwarf/z20.go":            true,
+       "dwarf/z3.go":             true,
+       "dwarf/z4.go":             true,
+       "dwarf/z5.go":             true,
+       "dwarf/z6.go":             true,
+       "dwarf/z7.go":             true,
+       "dwarf/z8.go":             true,
+       "dwarf/z9.go":             true,
+       "fixedbugs/bug083.go":     true,
+       "fixedbugs/bug133.go":     true,
+       "fixedbugs/bug160.go":     true,
+       "fixedbugs/bug191.go":     true,
+       "fixedbugs/bug248.go":     true,
+       "fixedbugs/bug302.go":     true,
+       "fixedbugs/bug313.go":     true,
+       "fixedbugs/bug322.go":     true,
+       "fixedbugs/bug324.go":     true,
+       "fixedbugs/bug345.go":     true,
+       "fixedbugs/bug367.go":     true,
+       "fixedbugs/bug369.go":     true,
+       "fixedbugs/bug382.go":     true,
+       "fixedbugs/bug385_32.go":  true,
+       "fixedbugs/bug385_64.go":  true,
+       "fixedbugs/bug414.go":     true,
+       "fixedbugs/bug424.go":     true,
+       "fixedbugs/bug429.go":     true,
+       "fixedbugs/bug437.go":     true,
+       "bugs/bug395.go":          true,
+       "bugs/bug434.go":          true,
+}
index 3386972b6d7ed98b72b9abe8131dfcd88b4d851b..c013c471d32d63396229af080a63981e60c4beb5 100644 (file)
@@ -1,10 +1,13 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+// Test rune constants, expressions and types.
+// Compiles but does not run.
+
+package rune
 
 var (
        r0 = 'a'
index 4be1d055b526d27d41de88a601b164c0fd0c6646..89f59e3edb1688dd1f63c4aa758d85de144d1983 100644 (file)
@@ -1,15 +1,16 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// make sure that even if a file imports runtime,
+// Test that even if a file imports runtime,
 // it cannot get at the low-level runtime definitions
-// known to the compiler.  for normal packages
+// known to the compiler.  For normal packages
 // the compiler doesn't even record the lower case
 // functions in its symbol table, but some functions
 // in runtime are hard-coded into the compiler.
+// Does not compile.
 
 package main
 
diff --git a/gcc/testsuite/go.test/test/safe/main.go b/gcc/testsuite/go.test/test/safe/main.go
new file mode 100644 (file)
index 0000000..d173ed9
--- /dev/null
@@ -0,0 +1,14 @@
+// true
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// can't use local path with -u, use -I. instead
+import "pkg"  // ERROR "import unsafe package"
+
+func main() {
+       print(pkg.Float32bits(1.0))
+}
diff --git a/gcc/testsuite/go.test/test/safe/nousesafe.go b/gcc/testsuite/go.test/test/safe/nousesafe.go
new file mode 100644 (file)
index 0000000..f61e7fe
--- /dev/null
@@ -0,0 +1,8 @@
+// $G $D/pkg.go && pack grc pkg.a pkg.$A 2> /dev/null && rm pkg.$A && errchk $G -I. -u $D/main.go
+// rm -f pkg.a
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/gcc/testsuite/go.test/test/safe/pkg.go b/gcc/testsuite/go.test/test/safe/pkg.go
new file mode 100644 (file)
index 0000000..bebc43a
--- /dev/null
@@ -0,0 +1,16 @@
+// true
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// a package that uses unsafe on the inside but not in it's api
+
+package pkg
+
+import "unsafe"
+
+// this should be inlinable
+func Float32bits(f float32) uint32 {
+       return *(*uint32)(unsafe.Pointer(&f))
+}
\ No newline at end of file
diff --git a/gcc/testsuite/go.test/test/safe/usesafe.go b/gcc/testsuite/go.test/test/safe/usesafe.go
new file mode 100644 (file)
index 0000000..07c13c1
--- /dev/null
@@ -0,0 +1,8 @@
+// $G $D/pkg.go && pack grcS pkg.a pkg.$A 2> /dev/null && rm pkg.$A && $G -I. -u $D/main.go
+// rm -f pkg.a
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
index c197eef66e58a8942b141289f9e29ed3629c00e5..b33d22ff8effe595fa340974f38925e749430911 100644 (file)
@@ -1,10 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test illegal shifts.
 // Issue 1708, illegal cases.
+// Does not compile.
 
 package p
 
index ec4c7addc2d733764deebcac5f69d13045cb1b74..88ef3c40f529647ac7a299701e82d2ffb008194e 100644 (file)
@@ -1,10 +1,12 @@
-// $G $D/$F.go || echo BUG: shift2
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test legal shifts.
 // Issue 1708, legal cases.
+// Compiles but does not run.
 
 package p
 
index 4fa1115824fb4e63f70bbad389a44f40e12a9cf7..0cd120c548e368f3a8c741ad2aacbf459f768334 100644 (file)
@@ -1,9 +1,12 @@
-// $G $F.go && $L $F.$A  # don't run it - goes forever
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test basic concurrency: the classic prime sieve.
+// Do not run - loops forever.
+
 package main
 
 // Send the sequence 2, 3, 4, ... to channel 'ch'.
index e7c3d5abb48d4289f3454552a0d85583104f6e4d..c1cfc2a8d0cc98056650267091dcb879c4228d6b 100644 (file)
@@ -1,10 +1,15 @@
 // [ "$GOOS" == windows ] ||
 // ($G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out)
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that a program can survive SIGCHLD.
+
 package main
 
 import "syscall"
index 28408abc23aba228772d324c53921a960fdd7fbd..6ba5c783e96181503b589b246e01bf4ac3293d7c 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simultaneous assignment.
+
 package main
 
 var a, b, c, d, e, f, g, h, i int
index 5cd3a4567b8d41e0dd6a2ad9b81515e57e66ca98..ffb8ef75110b4e280a0f76a66c7ca82ca5866a82 100644 (file)
@@ -1,9 +1,15 @@
 // $G -S $D/$F.go | egrep initdone >/dev/null && echo BUG sinit || true
 
+// NOTE: This test is not run by 'run.go' and so not run by all.bash.
+// To run this test you must use the ./run shell script.
+
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that many initializations can be done at link time and
+// generate no executable init functions.
+
 package p
 
 // Should be no init func in the assembly.
index 544e4c52c1bb87f63ade61569a8f7928e55b7370..a6abdd5c65727e5f5c03df72b5341df3aa099abe 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test unsafe.Sizeof, unsafe.Alignof, and unsafe.Offsetof all return uintptr.
+
 package main
 
 import "unsafe"
index 473a1d12d7d7f25eff50f7e21b1de78a0c40af60..ac54cec0ac74442309535200457f5b00b0a6e71f 100644 (file)
@@ -1,9 +1,13 @@
-// $G $F.go && $L $F.$A  # don't run it - produces too much output
+// build
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test general operation by solving a peg solitaire game.
+// A version of this is in the Go playground.
+// Don't run it - produces too much output.
+
 // This program solves the (English) peg solitaire board game.
 // See also: http://en.wikipedia.org/wiki/Peg_solitaire
 
index 1fd57161ff2903aff1bd3b15ff38cff561e8f8a1..b62febd48ddc28b77fa37f6bfb2beca2a42141bb 100644 (file)
@@ -1,9 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test stack splitting code.
 // Try to tickle stack splitting bugs by doing
 // go, defer, and closure calls at different stack depths.
 
index c702a05e91fa6a07fd9e65cad9a0c0cbe17b643a..457faaa88cd84418f7fc469d087e9dd52612418b 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test string literal syntax.
+
 package main
 
 import "os"
@@ -91,7 +93,7 @@ func main() {
                "backslashes 2 (backquote)")
        assert("\\x\\u\\U\\", `\x\u\U\`, "backslash 3 (backquote)")
 
-       // test large runes. perhaps not the most logical place for this test.
+       // test large and surrogate-half runes. perhaps not the most logical place for these tests.
        var r int32
        r = 0x10ffff // largest rune value
        s = string(r)
@@ -99,6 +101,28 @@ func main() {
        r = 0x10ffff + 1
        s = string(r)
        assert(s, "\xef\xbf\xbd", "too-large rune")
+       r = 0xD800
+       s = string(r)
+       assert(s, "\xef\xbf\xbd", "surrogate rune min")
+       r = 0xDFFF
+       s = string(r)
+       assert(s, "\xef\xbf\xbd", "surrogate rune max")
+       r = -1
+       s = string(r)
+       assert(s, "\xef\xbf\xbd", "negative rune")
+       
+       // the large rune tests again, this time using constants instead of a variable.
+       // these conversions will be done at compile time.
+       s = string(0x10ffff) // largest rune value
+       assert(s, "\xf4\x8f\xbf\xbf", "largest rune constant")
+       s = string(0x10ffff + 1)
+       assert(s, "\xef\xbf\xbd", "too-large rune constant")
+       s = string(0xD800)
+       assert(s, "\xef\xbf\xbd", "surrogate rune min constant")
+       s = string(0xDFFF)
+       assert(s, "\xef\xbf\xbd", "surrogate rune max constant")
+       s = string(-1)
+       assert(s, "\xef\xbf\xbd", "negative rune")
 
        assert(string(gr1), gx1, "global ->[]rune")
        assert(string(gr2), gx2fix, "global invalid ->[]rune")
index 6a7063e239d3dc70d03a2553eaa28b8383c5289d..99e5edb5a429d1ce4dc0ca30e4bc77385018c8ef 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test range over strings.
+
 package main
 
 import (
@@ -55,6 +57,13 @@ func main() {
                ok = false
        }
 
+       for _, c := range "a\xed\xa0\x80a" {
+               if c != 'a' && c != utf8.RuneError {
+                       fmt.Printf("surrogate UTF-8 does not error: %U\n", c)
+                       ok = false
+               }
+       }
+
        if !ok {
                fmt.Println("BUG: stringrange")
                os.Exit(1)
index 2398c4117d3ad85723d9843371e4f712e150b28a..e29eb30f544f8bf26e0f69c689dde750a5906cef 100644 (file)
@@ -1,12 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// zero length structs.
-// used to not be evaluated.
-// issue 2232.
+// Test zero length structs.
+// Used to not be evaluated.
+// Issue 2232.
 
 package main
 
index bed027ce85f6c9df79880dc18940a1be7756b6ad..fd8748b9bceb257f21d9bded8646808e6f2f3caf 100644 (file)
@@ -1,11 +1,15 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test switch statements.
+
 package main
 
+import "os"
+
 func assert(cond bool, msg string) {
        if !cond {
                print("assertion fail: ", msg, "\n")
@@ -279,4 +283,56 @@ func main() {
                assert(false, "m should not be nil")
        default:
        }
+
+       // switch on interface.
+       switch i := interface{}("hello"); i {
+       case 42:
+               assert(false, `i should be "hello"`)
+       case "hello":
+               assert(true, "hello")
+       default:
+               assert(false, `i should be "hello"`)
+       }
+
+       // switch on implicit bool converted to interface
+       // was broken: see issue 3980
+       switch i := interface{}(true); {
+       case i:
+               assert(true, "true")
+       case false:
+               assert(false, "i should be true")
+       default:
+               assert(false, "i should be true")
+       }
+
+       // switch on array.
+       switch ar := [3]int{1, 2, 3}; ar {
+       case [3]int{1,2,3}:
+               assert(true, "[1 2 3]")
+       case [3]int{4,5,6}:
+               assert(false, "ar should be [1 2 3]")
+       default:
+               assert(false, "ar should be [1 2 3]")
+       }
+
+       // switch on channel
+       switch c1, c2 := make(chan int), make(chan int); c1 {
+       case nil:
+               assert(false, "c1 did not match itself")
+       case c2:
+               assert(false, "c1 did not match itself")
+       case c1:
+               assert(true, "chan")
+       default:
+               assert(false, "c1 did not match itself")
+       }
+
+       i := 0
+       switch x := 5; {
+               case i < x:
+                       os.Exit(0)
+               case i == x:
+               case i > x:
+                       os.Exit(1)
+       }
 }
diff --git a/gcc/testsuite/go.test/test/switch1.go b/gcc/testsuite/go.test/test/switch1.go
deleted file mode 100644 (file)
index 5bd9d7c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// $G $F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import "os"
-
-func main() {
-       i := 0
-       switch x := 5; {
-               case i < x:
-                       os.Exit(0)
-               case i == x:
-               case i > x:
-                       os.Exit(1)
-       }
-}
index 6c9ebfe6d48ee9ef7bbd7459d1f0a4cf0412dd76..28705e464ef2c20949e7298fe1072a24fe2ab2df 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that erroneous switch statements are detected by the compiler.
+// Does not compile.
+
 package main
 
 type I interface {
@@ -42,6 +45,17 @@ func bad() {
        case f1: // ERROR "can only compare func f to nil|func can only be compared to nil"
        default:
        }
+
+       var ar, ar1 [4]func()
+       switch ar { // ERROR "cannot switch on"
+       case ar1:
+       default:
+       }
+
+       var st, st1 struct{ f func() }
+       switch st { // ERROR "cannot switch on"
+       case st1:
+       }
 }
 
 func good() {
index ff3577502f222c7b20ed30c24900054a1f9747a5..3b68bda35f5de243e5ba097b4e13f59d2b6a2652 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9c12e5e6fedac3f4a0e9d32d9b7b2b2e26bd05d3..868a1226d9f06a27ca792a01e14004d0c3f36c2e 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/syntax/composite.go b/gcc/testsuite/go.test/test/syntax/composite.go
new file mode 100644 (file)
index 0000000..6565334
--- /dev/null
@@ -0,0 +1,11 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var a = []int{
+       3 // ERROR "need trailing comma before newline in composite literal"
+}
index 99595254fd4877a402b77f3bbfe217d2d24b50a6..e985a9c09c75946cb789d441914785cb635a4ac1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index f12ce55caeb40847deb75200007c6907af8cbc1c..dc592d2b641b7c5c5a184c04ae6721788aa1f0fe 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a3b51f0c07b1674937f245c70a2c94fc153da2f1..b2a65f9a59374566a4d64ca286f5187c502f3227 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index dd1f2613445164383dbe4451bead730de762bdc8..f0a792126265a5cc8f8f01b38fe2463de2af2bd1 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index a7f43533a2c60a0da646604dd792194143d3636c..0b76b5416fbc5f053108fee01eef00784eaf4c5c 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 547d9bf79957a3a6e390a68b9f31d06306c827c1..8fbfb206ad73137fb0f4168a90a266a018694cf4 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 28d1d3906ddd6ceacf8586b0f362b87162ca8f88..cfb0ed17b7476474d08e4b710ba030e7c0226e53 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index ab5941bda5b71c817d86b72f653a166e8c05a8fd..645af7354a57ce7a42c22fd003abaa5c6747f835 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 7a9c2956e72882f6f9f029fad274f7c463e14a0b..e192348aa200ece91acfeab448d1807ce6f5bd71 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5f8ccc688f79bf26f72b0463b8b21f90ddfa2fa5..cf690f0840637118f2978fe94d57314d96ba63bf 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index b6279ed307abcd11b502d2d802d3ecaf2eb9c340..c1e1cc363a26dc0a025a38dce9987a30183f6b48 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 5a7b3ff4cc8ec2c71b4253ce28c15eaaf91f1236..6c9ade8bc2b8874a3542303f4964ebebdc56f348 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 93d86fbe959ba520f219e6be2e5b342586515129..c5958f5dd2c00a4e3d74c822807bdd8375bff07b 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 47f683cdf2978e90902ef86cb09f1f4b88a1afa0..cd8cf35236ab5089e275aca83d5611158a1db426 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 8525be8cf592aea395b17028babe949b95858ec4..f08955e91bcccf55441d33e958154db34db76a51 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
index 9d70bea39f51899f002713c6ecd9f271a7d4516e..e900eabebec55e4fb160d4c25e39d0a2fd8c4a17 100644 (file)
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/gcc/testsuite/go.test/test/test0.go b/gcc/testsuite/go.test/test/test0.go
deleted file mode 100644 (file)
index d8d86c4..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-// $G $F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-const a_const = 0
-
-const (
-       pi    = /* the usual */ 3.14159265358979323
-       e     = 2.718281828
-       mask1 int = 1 << iota
-       mask2 = 1 << iota
-       mask3 = 1 << iota
-       mask4 = 1 << iota
-)
-
-type (
-       Empty interface{}
-       Point struct {
-               x, y int
-       }
-       Point2 Point
-)
-
-func (p *Point) Initialize(x, y int) *Point {
-       p.x, p.y = x, y
-       return p
-}
-
-func (p *Point) Distance() int {
-       return p.x*p.x + p.y*p.y
-}
-
-var (
-       x1      int
-       x2      int
-       u, v, w float32
-)
-
-func foo() {}
-
-func min(x, y int) int {
-       if x < y {
-               return x
-       }
-       return y
-}
-
-func swap(x, y int) (u, v int) {
-       u = y
-       v = x
-       return
-}
-
-func control_structs() {
-       var p *Point = new(Point).Initialize(2, 3)
-       i := p.Distance()
-       var f float32 = 0.3
-       _ = f
-       for {
-       }
-       for {
-       }
-       for j := 0; j < i; j++ {
-               if i == 0 {
-               } else {
-                       i = 0
-               }
-               var x float32
-               _ = x
-       }
-foo: // a label
-       var j int
-       switch y := 0; true {
-       case i < y:
-               fallthrough
-       case i < j:
-       case i == 0, i == 1, i == j:
-               i++
-               i++
-               goto foo
-       default:
-               i = -+-+i
-               break
-       }
-}
-
-func main() {
-}
diff --git a/gcc/testsuite/go.test/test/testlib b/gcc/testsuite/go.test/test/testlib
new file mode 100644 (file)
index 0000000..29de767
--- /dev/null
@@ -0,0 +1,61 @@
+# Copyright 2012 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# These function names are also known to
+# (and are the plan for transitioning to) run.go.
+
+compile() {
+       $G $D/$F.go
+}
+
+compiledir() {
+       for gofile in $D/$F.dir/*.go
+       do
+               $G -I. "$gofile" || return 1
+       done
+}
+
+build() {
+       $G $D/$F.go && $L $F.$A
+}
+
+runoutput() {
+       go run "$D/$F.go" > tmp.go
+       go run tmp.go
+}
+
+run() {
+       gofiles=""
+       ingo=true
+       while $ingo; do
+               case "$1" in
+               *.go)
+                       gofiles="$gofiles $1"
+                       shift
+                       ;;
+               *)
+                       ingo=false
+                       ;;
+               esac
+       done
+
+       $G $D/$F.go $gofiles && $L $F.$A && ./$A.out "$@"
+}
+
+cmpout() {
+       $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+}
+
+errorcheck() {
+       zero=""
+       if [ "$1" = "-0" ]; then
+               zero="-0"
+               shift
+       fi
+       errchk $zero $G -e $* $D/$F.go
+}
+
+skip() {
+       true
+}
diff --git a/gcc/testsuite/go.test/test/times.out b/gcc/testsuite/go.test/test/times.out
deleted file mode 100644 (file)
index 841fab9..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-0.04 ./235
-1.72 ./64bit
-0.03 ./alias
-0.03 ./alias1
-0.30 ./append
-0.07 ./args
-0.02 ./assign
-0.04 ./assign1
-0.04 ./bigalg
-0.03 ./bigmap
-0.14 ./blank
-0.03 ./blank1
-0.03 ./chancap
-0.07 ./char_lit
-0.03 ./char_lit1
-0.09 ./closedchan
-0.05 ./closure
-0.06 ./cmp
-0.02 ./cmp6
-0.03 ./cmplx
-0.60 ./cmplxdivide
-0.00 ./cmplxdivide1
-0.04 ./complit
-0.02 ./complit1
-0.03 ./compos
-0.04 ./const
-0.03 ./const1
-0.03 ./const2
-0.13 ./const3
-0.08 ./convert
-0.03 ./convert1
-0.02 ./convert3
-0.04 ./convlit
-0.02 ./convlit1
-0.34 ./copy
-0.27 ./crlf
-0.05 ./ddd
-0.02 ./ddd1
-0.00 ./ddd2
-0.04 ./ddd3
-0.03 ./decl
-0.03 ./declbad
-0.14 ./defer
-0.03 ./deferprint
-0.14 ./divide
-0.00 ./empty
-0.08 ./env
-0.00 ./eof
-0.00 ./eof1
-0.04 ./escape
-0.12 ./escape2
-0.03 ./escape3
-0.05 ./float_lit
-0.14 ./floatcmp
-0.03 ./for
-0.04 ./func
-0.03 ./func1
-0.00 ./func2
-0.03 ./func3
-0.03 ./func4
-0.03 ./func5
-0.00 ./func6
-0.04 ./func7
-0.03 ./gc
-0.04 ./gc1
-0.26 ./gc2
-0.06 ./goprint
-0.04 ./goto
-0.04 ./hashmap
-0.03 ./helloworld
-0.03 ./if
-0.02 ./import
-0.15 ./import1
-0.00 ./import2
-0.01 ./import3
-0.14 ./import4
-1.70 ./index
-0.03 ./indirect
-0.02 ./indirect1
-0.02 ./init
-0.25 ./init1
-0.03 ./initcomma
-0.15 ./initialize
-0.02 ./initializerr
-0.06 ./initsyscall
-0.07 ./int_lit
-0.03 ./intcvt
-0.03 ./iota
-0.03 ./label
-0.03 ./label1
-0.04 ./literal
-0.15 ./malloc1
-0.06 ./mallocfin
-0.19 ./mallocrand
-0.21 ./mallocrep
-0.52 ./mallocrep1
-0.17 ./map
-0.02 ./map1
-0.05 ./method
-0.02 ./method1
-0.03 ./method2
-0.04 ./method3
-0.06 ./named
-0.03 ./named1
-0.18 ./nil
-0.15 ./nilptr
-0.16 ./nul1
-0.00 ./parentype
-0.11 ./peano
-0.02 ./printbig
-0.05 ./range
-0.04 ./recover
-0.04 ./recover1
-0.08 ./recover2
-0.06 ./recover3
-0.14 ./rename
-0.02 ./rename1
-0.16 ./reorder
-0.00 ./rune
-0.03 ./runtime
-0.03 ./shift1
-0.01 ./shift2
-0.03 ./sieve
-0.06 ./sigchld
-0.03 ./simassign
-0.02 ./sinit
-0.00 ./sizeof
-0.03 ./solitaire
-0.06 ./stack
-0.08 ./string_lit
-0.14 ./stringrange
-0.04 ./struct0
-0.04 ./switch
-0.08 ./switch1
-0.02 ./switch3
-0.04 ./test0
-0.03 ./turing
-0.07 ./typeswitch
-0.15 ./typeswitch1
-0.02 ./typeswitch2
-0.03 ./typeswitch3
-0.02 ./undef
-0.04 ./utf
-0.03 ./varerr
-0.03 ./varinit
-0.26 ./zerodivide
-0.04 ken/array
-0.11 ken/chan
-0.04 ken/chan1
-0.04 ken/complit
-0.07 ken/convert
-0.03 ken/cplx0
-0.02 ken/cplx1
-0.06 ken/cplx2
-0.09 ken/cplx3
-0.14 ken/cplx4
-0.03 ken/cplx5
-0.31 ken/divconst
-0.05 ken/divmod
-0.04 ken/embed
-0.03 ken/for
-0.04 ken/interbasic
-0.03 ken/interfun
-0.04 ken/intervar
-0.03 ken/label
-0.03 ken/litfun
-0.03 ken/mfunc
-0.34 ken/modconst
-0.03 ken/ptrfun
-0.03 ken/ptrvar
-0.04 ken/range
-0.03 ken/rob1
-0.18 ken/rob2
-0.04 ken/robfor
-0.04 ken/robfunc
-0.03 ken/shift
-0.03 ken/simparray
-0.04 ken/simpbool
-0.03 ken/simpconv
-0.03 ken/simpfun
-0.03 ken/simpswitch
-0.03 ken/simpvar
-0.02 ken/slicearray
-0.03 ken/sliceslice
-0.03 ken/string
-0.03 ken/strvar
-0.32 chan/doubleselect
-0.06 chan/fifo
-0.12 chan/goroutines
-0.07 chan/nonblock
-0.02 chan/perm
-0.10 chan/powser1
-0.09 chan/powser2
-0.03 chan/select
-0.15 chan/select2
-0.97 chan/select3
-0.03 chan/select4
-0.72 chan/select5
-0.03 chan/select6
-0.04 chan/select7
-0.03 chan/sendstmt
-0.03 chan/sieve1
-0.04 chan/sieve2
-0.02 chan/zerosize
-0.04 interface/bigdata
-0.04 interface/convert
-0.03 interface/convert1
-0.03 interface/convert2
-0.09 interface/embed
-0.00 interface/embed0
-0.03 interface/embed1
-0.02 interface/embed2
-0.02 interface/explicit
-0.03 interface/fail
-0.09 interface/fake
-0.03 interface/noeq
-0.03 interface/pointer
-0.03 interface/private
-0.00 interface/private1
-0.04 interface/receiver
-0.03 interface/receiver1
-0.00 interface/recursive
-0.03 interface/returntype
-0.09 interface/struct
-0.02 syntax/chan
-0.03 syntax/chan1
-0.02 syntax/else
-0.02 syntax/forvar
-0.03 syntax/if
-0.03 syntax/import
-0.03 syntax/interface
-0.03 syntax/semi1
-0.02 syntax/semi2
-0.03 syntax/semi3
-0.03 syntax/semi4
-0.02 syntax/semi5
-0.03 syntax/semi6
-0.02 syntax/semi7
-0.02 syntax/topexpr
-0.03 syntax/typesw
-0.02 syntax/vareq
-0.03 syntax/vareq1
-0.04 dwarf/linedirectives
-0.05 dwarf/main
-0.00 dwarf/z1
-0.00 dwarf/z10
-0.00 dwarf/z11
-0.00 dwarf/z12
-0.00 dwarf/z13
-0.00 dwarf/z14
-0.00 dwarf/z15
-0.00 dwarf/z16
-0.00 dwarf/z17
-0.00 dwarf/z18
-0.00 dwarf/z19
-0.00 dwarf/z2
-0.00 dwarf/z20
-0.00 dwarf/z3
-0.00 dwarf/z4
-0.00 dwarf/z5
-0.00 dwarf/z6
-0.00 dwarf/z7
-0.00 dwarf/z8
-0.00 dwarf/z9
-0.03 fixedbugs/bug000
-0.03 fixedbugs/bug002
-0.03 fixedbugs/bug003
-0.03 fixedbugs/bug004
-0.04 fixedbugs/bug005
-0.08 fixedbugs/bug006
-0.03 fixedbugs/bug007
-0.03 fixedbugs/bug008
-0.02 fixedbugs/bug009
-0.03 fixedbugs/bug010
-0.03 fixedbugs/bug011
-0.03 fixedbugs/bug012
-0.03 fixedbugs/bug013
-0.03 fixedbugs/bug014
-0.02 fixedbugs/bug015
-0.02 fixedbugs/bug016
-0.03 fixedbugs/bug017
-0.00 fixedbugs/bug020
-0.03 fixedbugs/bug021
-0.02 fixedbugs/bug022
-0.03 fixedbugs/bug023
-0.03 fixedbugs/bug024
-0.03 fixedbugs/bug026
-0.14 fixedbugs/bug027
-0.03 fixedbugs/bug028
-0.02 fixedbugs/bug030
-0.03 fixedbugs/bug031
-0.02 fixedbugs/bug035
-0.00 fixedbugs/bug036
-0.02 fixedbugs/bug037
-0.00 fixedbugs/bug038
-0.03 fixedbugs/bug039
-0.00 fixedbugs/bug040
-0.03 fixedbugs/bug045
-0.03 fixedbugs/bug046
-0.03 fixedbugs/bug047
-0.02 fixedbugs/bug048
-0.03 fixedbugs/bug049
-0.03 fixedbugs/bug050
-0.02 fixedbugs/bug051
-0.03 fixedbugs/bug052
-0.03 fixedbugs/bug053
-0.03 fixedbugs/bug054
-0.03 fixedbugs/bug055
-0.03 fixedbugs/bug056
-0.00 fixedbugs/bug057
-0.04 fixedbugs/bug058
-0.08 fixedbugs/bug059
-0.08 fixedbugs/bug060
-0.03 fixedbugs/bug061
-0.03 fixedbugs/bug062
-0.00 fixedbugs/bug063
-0.00 fixedbugs/bug064
-0.03 fixedbugs/bug065
-0.00 fixedbugs/bug066
-0.03 fixedbugs/bug067
-0.03 fixedbugs/bug068
-0.00 fixedbugs/bug069
-0.15 fixedbugs/bug070
-0.00 fixedbugs/bug071
-0.03 fixedbugs/bug072
-0.03 fixedbugs/bug073
-0.03 fixedbugs/bug074
-0.03 fixedbugs/bug075
-0.03 fixedbugs/bug076
-0.00 fixedbugs/bug077
-0.03 fixedbugs/bug078
-0.00 fixedbugs/bug080
-0.02 fixedbugs/bug081
-0.03 fixedbugs/bug082
-0.03 fixedbugs/bug083
-0.04 fixedbugs/bug084
-0.02 fixedbugs/bug085
-0.03 fixedbugs/bug086
-0.00 fixedbugs/bug087
-0.01 fixedbugs/bug088
-0.00 fixedbugs/bug089
-0.03 fixedbugs/bug090
-0.02 fixedbugs/bug091
-0.03 fixedbugs/bug092
-0.03 fixedbugs/bug093
-0.00 fixedbugs/bug094
-0.00 fixedbugs/bug096
-0.03 fixedbugs/bug097
-0.00 fixedbugs/bug098
-0.03 fixedbugs/bug099
-0.03 fixedbugs/bug101
-0.03 fixedbugs/bug102
-0.02 fixedbugs/bug103
-0.03 fixedbugs/bug104
-0.01 fixedbugs/bug106
-0.03 fixedbugs/bug107
-0.03 fixedbugs/bug108
-0.00 fixedbugs/bug109
-0.03 fixedbugs/bug110
-0.03 fixedbugs/bug111
-0.00 fixedbugs/bug112
-0.03 fixedbugs/bug113
-0.03 fixedbugs/bug114
-0.00 fixedbugs/bug115
-0.03 fixedbugs/bug116
-0.02 fixedbugs/bug117
-0.00 fixedbugs/bug118
-0.03 fixedbugs/bug119
-0.11 fixedbugs/bug120
-0.02 fixedbugs/bug121
-0.03 fixedbugs/bug122
-0.03 fixedbugs/bug123
-0.02 fixedbugs/bug126
-0.02 fixedbugs/bug127
-0.03 fixedbugs/bug128
-0.01 fixedbugs/bug129
-0.08 fixedbugs/bug130
-0.02 fixedbugs/bug131
-0.02 fixedbugs/bug132
-0.03 fixedbugs/bug133
-0.00 fixedbugs/bug135
-0.02 fixedbugs/bug136
-0.00 fixedbugs/bug137
-0.00 fixedbugs/bug139
-0.00 fixedbugs/bug140
-0.07 fixedbugs/bug141
-0.03 fixedbugs/bug142
-0.00 fixedbugs/bug143
-0.00 fixedbugs/bug144
-0.00 fixedbugs/bug145
-0.03 fixedbugs/bug146
-0.06 fixedbugs/bug147
-0.03 fixedbugs/bug148
-0.00 fixedbugs/bug149
-0.00 fixedbugs/bug150
-0.00 fixedbugs/bug151
-0.03 fixedbugs/bug1515
-0.03 fixedbugs/bug152
-0.14 fixedbugs/bug154
-0.03 fixedbugs/bug155
-0.00 fixedbugs/bug156
-0.00 fixedbugs/bug157
-0.00 fixedbugs/bug158
-0.07 fixedbugs/bug159
-0.09 fixedbugs/bug160
-0.00 fixedbugs/bug161
-0.02 fixedbugs/bug163
-0.00 fixedbugs/bug164
-0.03 fixedbugs/bug165
-0.03 fixedbugs/bug167
-0.03 fixedbugs/bug168
-0.02 fixedbugs/bug169
-0.03 fixedbugs/bug170
-0.03 fixedbugs/bug171
-0.02 fixedbugs/bug172
-0.00 fixedbugs/bug173
-0.00 fixedbugs/bug174
-0.03 fixedbugs/bug175
-0.03 fixedbugs/bug176
-0.09 fixedbugs/bug177
-0.03 fixedbugs/bug178
-0.03 fixedbugs/bug179
-0.03 fixedbugs/bug180
-0.03 fixedbugs/bug181
-0.02 fixedbugs/bug182
-0.03 fixedbugs/bug183
-0.15 fixedbugs/bug184
-0.04 fixedbugs/bug185
-0.02 fixedbugs/bug186
-0.08 fixedbugs/bug187
-0.03 fixedbugs/bug188
-0.03 fixedbugs/bug189
-0.00 fixedbugs/bug190
-0.04 fixedbugs/bug191
-0.03 fixedbugs/bug192
-0.03 fixedbugs/bug193
-0.03 fixedbugs/bug194
-0.02 fixedbugs/bug195
-0.04 fixedbugs/bug196
-0.02 fixedbugs/bug197
-0.03 fixedbugs/bug198
-0.03 fixedbugs/bug199
-0.03 fixedbugs/bug200
-0.03 fixedbugs/bug201
-0.03 fixedbugs/bug202
-0.03 fixedbugs/bug203
-0.03 fixedbugs/bug204
-0.02 fixedbugs/bug205
-0.21 fixedbugs/bug206
-0.14 fixedbugs/bug207
-0.02 fixedbugs/bug208
-0.02 fixedbugs/bug209
-0.03 fixedbugs/bug211
-0.03 fixedbugs/bug212
-0.03 fixedbugs/bug213
-0.00 fixedbugs/bug214
-0.02 fixedbugs/bug215
-0.00 fixedbugs/bug216
-0.03 fixedbugs/bug217
-0.00 fixedbugs/bug218
-0.00 fixedbugs/bug219
-0.04 fixedbugs/bug221
-0.01 fixedbugs/bug222
-0.00 fixedbugs/bug223
-0.03 fixedbugs/bug224
-0.03 fixedbugs/bug225
-0.03 fixedbugs/bug227
-0.03 fixedbugs/bug228
-0.03 fixedbugs/bug229
-0.03 fixedbugs/bug230
-0.02 fixedbugs/bug231
-0.00 fixedbugs/bug232
-0.01 fixedbugs/bug233
-0.04 fixedbugs/bug234
-0.00 fixedbugs/bug235
-0.04 fixedbugs/bug236
-0.15 fixedbugs/bug237
-0.03 fixedbugs/bug238
-0.00 fixedbugs/bug239
-0.03 fixedbugs/bug240
-0.03 fixedbugs/bug241
-0.04 fixedbugs/bug242
-0.04 fixedbugs/bug243
-0.03 fixedbugs/bug244
-0.00 fixedbugs/bug245
-0.03 fixedbugs/bug246
-0.03 fixedbugs/bug247
-0.11 fixedbugs/bug248
-0.03 fixedbugs/bug249
-0.00 fixedbugs/bug250
-0.03 fixedbugs/bug251
-0.03 fixedbugs/bug252
-0.03 fixedbugs/bug253
-0.03 fixedbugs/bug254
-0.03 fixedbugs/bug255
-0.03 fixedbugs/bug256
-0.47 fixedbugs/bug257
-0.14 fixedbugs/bug258
-0.16 fixedbugs/bug259
-0.16 fixedbugs/bug260
-0.03 fixedbugs/bug261
-0.10 fixedbugs/bug262
-0.03 fixedbugs/bug263
-0.03 fixedbugs/bug264
-0.07 fixedbugs/bug265
-0.03 fixedbugs/bug266
-0.00 fixedbugs/bug267
-0.03 fixedbugs/bug269
-0.13 fixedbugs/bug271
-0.02 fixedbugs/bug272
-0.04 fixedbugs/bug273
-0.02 fixedbugs/bug274
-0.00 fixedbugs/bug275
-0.03 fixedbugs/bug276
-0.00 fixedbugs/bug277
-0.03 fixedbugs/bug278
-0.04 fixedbugs/bug279
-0.02 fixedbugs/bug280
-0.04 fixedbugs/bug281
-0.00 fixedbugs/bug282
-0.00 fixedbugs/bug283
-0.03 fixedbugs/bug284
-0.05 fixedbugs/bug285
-0.04 fixedbugs/bug286
-0.02 fixedbugs/bug287
-0.00 fixedbugs/bug288
-0.02 fixedbugs/bug289
-0.04 fixedbugs/bug290
-0.04 fixedbugs/bug291
-0.03 fixedbugs/bug292
-0.04 fixedbugs/bug293
-0.03 fixedbugs/bug294
-0.16 fixedbugs/bug295
-0.04 fixedbugs/bug296
-0.03 fixedbugs/bug297
-0.03 fixedbugs/bug298
-0.03 fixedbugs/bug299
-0.03 fixedbugs/bug300
-0.00 fixedbugs/bug301
-0.04 fixedbugs/bug302
-0.05 fixedbugs/bug303
-0.00 fixedbugs/bug304
-0.03 fixedbugs/bug305
-0.01 fixedbugs/bug306
-0.00 fixedbugs/bug307
-0.01 fixedbugs/bug308
-0.00 fixedbugs/bug309
-0.04 fixedbugs/bug311
-0.03 fixedbugs/bug312
-0.04 fixedbugs/bug313
-0.04 fixedbugs/bug314
-0.00 fixedbugs/bug315
-0.00 fixedbugs/bug316
-0.03 fixedbugs/bug317
-0.03 fixedbugs/bug318
-0.00 fixedbugs/bug319
-0.03 fixedbugs/bug320
-0.14 fixedbugs/bug321
-0.04 fixedbugs/bug322
-0.03 fixedbugs/bug323
-0.04 fixedbugs/bug324
-0.03 fixedbugs/bug325
-0.02 fixedbugs/bug326
-0.04 fixedbugs/bug327
-0.03 fixedbugs/bug328
-0.04 fixedbugs/bug329
-0.02 fixedbugs/bug330
-0.04 fixedbugs/bug331
-0.02 fixedbugs/bug332
-0.03 fixedbugs/bug333
-0.01 fixedbugs/bug334
-0.01 fixedbugs/bug335
-0.04 fixedbugs/bug336
-0.03 fixedbugs/bug337
-0.00 fixedbugs/bug338
-0.03 fixedbugs/bug339
-0.02 fixedbugs/bug340
-0.03 fixedbugs/bug341
-0.02 fixedbugs/bug342
-0.04 fixedbugs/bug343
-0.02 fixedbugs/bug344
-0.03 fixedbugs/bug345
-0.08 fixedbugs/bug346
-0.04 fixedbugs/bug347
-0.06 fixedbugs/bug348
-0.03 fixedbugs/bug349
-0.03 fixedbugs/bug350
-0.02 fixedbugs/bug351
-0.03 fixedbugs/bug352
-0.03 fixedbugs/bug353
-0.00 fixedbugs/bug354
-0.03 fixedbugs/bug355
-0.03 fixedbugs/bug356
-0.02 fixedbugs/bug357
-0.04 fixedbugs/bug358
-0.00 fixedbugs/bug361
-0.03 fixedbugs/bug362
-0.03 fixedbugs/bug363
-0.15 fixedbugs/bug364
-0.02 fixedbugs/bug365
-0.03 fixedbugs/bug366
-0.03 fixedbugs/bug367
-0.03 fixedbugs/bug368
-0.51 fixedbugs/bug369
-0.03 fixedbugs/bug370
-0.02 fixedbugs/bug371
-0.03 fixedbugs/bug372
-0.03 fixedbugs/bug373
-0.03 fixedbugs/bug374
-0.03 fixedbugs/bug375
-0.03 fixedbugs/bug376
-0.01 fixedbugs/bug377
-0.03 fixedbugs/bug378
-0.02 fixedbugs/bug379
-0.00 fixedbugs/bug380
-0.03 fixedbugs/bug381
-0.01 fixedbugs/bug382
-0.03 fixedbugs/bug383
-0.03 fixedbugs/bug384
-0.00 fixedbugs/bug385_32
-0.03 fixedbugs/bug385_64
-0.03 fixedbugs/bug386
-0.01 fixedbugs/bug387
-0.02 fixedbugs/bug388
-0.03 fixedbugs/bug389
-0.03 fixedbugs/bug390
-0.00 fixedbugs/bug391
-0.01 fixedbugs/bug392
-0.00 fixedbugs/bug393
-0.03 fixedbugs/bug394
-0.00 fixedbugs/bug395
-0.01 fixedbugs/bug396
index 366982e67f12e8ecb4d381f022342a7fb4bffce7..acbe85b646ce7671dafc290afe39afb5aa5fe9e7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simulating a Turing machine, sort of.
+
 package main
 
 // brainfuck
index aa911f9b621807dbf12f0f31f1814203a6d8db8e..30a4b4975fbb3afeb7a54e19bcf7b57df4d130ff 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple type switches, including chans, maps etc.
+
 package main
 
 import "os"
index 9613b166f18bb15cd1491f468775f2fa869cb180..a980ce4c070d4f2c08d698bb846406d39f4d18c7 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple type switches on basic types.
+
 package main
 
 import "fmt"
index 3e3acdae37747a6337d075ec9421505dc7f7111d..6c703076a6f4908fb53cbe8446e6449bf20de8e2 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that various erroneous type switches are caught be the compiler.
+// Does not compile.
+
 package main
 
 import "io"
index 99d08a20f777d2a863304060d0d4f5f170720e1f..287e32e71e1786caebf57b120df9c35eff4056eb 100644 (file)
@@ -1,20 +1,43 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that erroneous type switches are caught be the compiler.
+// Issue 2700, among other things.
+// Does not compile.
+
 package main
 
+import (
+       "io"
+)
 
 type I interface {
-       M()
+       M()
 }
 
 func main(){
-       var x I
-       switch x.(type) {
-       case string:    // ERROR "impossible"
-               println("FAIL")
-       }
+       var x I
+       switch x.(type) {
+       case string:    // ERROR "impossible"
+               println("FAIL")
+       }
+       
+       // Issue 2700: if the case type is an interface, nothing is impossible
+       
+       var r io.Reader
+       
+       _, _ = r.(io.Writer)
+       
+       switch r.(type) {
+       case io.Writer:
+       }
+       
+       // Issue 2827.
+       switch _ := r.(type) {  // ERROR "invalid variable name _|no new variables"
+       }
 }
+
+
index 7ef07882aa298bcf152ad1b5c1a14879d143d59d..0a77e59370bc4116c848295e807a5c6ba2744fb1 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check line numbers in error messages.
+// Test line numbers in error messages.
+// Does not compile.
 
 package main
 
index 9fba58156b3423bb0c900a7eba44f26433ea1dd9..3ac79447e635fcfcb43f819508b0f6bbf2558685 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test UTF-8 in strings and character constants.
+
 package main
 
 import "unicode/utf8"
index ddd718f5b8a1e2ddd48440ee69a9b6b661428209..22aa9324f98e5d2eb4e3992c67a7ed0782eb3251 100644 (file)
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that a couple of illegal variable declarations are caught by the compiler.
+// Does not compile.
+
 package main
 
 func main() {
index c768777932ac8b9bb80d1f4defa7c63473da7289..84a4a1aa55cd58cf2169b1c2b83ec517d67f6a26 100644 (file)
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test var x = x + 1 works.
+
 package main
 
 func main() {
index 3b08e774cc193ce3034ed8f06272ba97deca9696..673d1d18d81f4d68c208b905198f5abfa3faeb74 100644 (file)
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that zero division causes a panic.
+
 package main
 
 import (