Source file
test/fixedbugs/issue10958.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package main
22
23 import (
24 "runtime"
25 )
26
27 var someglobal1 int
28 var someglobal2 int
29 var someglobal3 int
30
31
32 func f() {}
33
34 func standinacorner1() {
35 for someglobal1&1 == 0 {
36 someglobal1++
37 someglobal1++
38 }
39 }
40
41 func standinacorner2(i int) {
42
43 if i != 0 {
44 goto midloop
45 }
46
47 loop:
48 if someglobal2&1 != 0 {
49 goto done
50 }
51 someglobal2++
52 midloop:
53 someglobal2++
54 goto loop
55
56 done:
57 return
58 }
59
60 func standinacorner3() {
61 for someglobal3&1 == 0 {
62 if someglobal3&2 != 0 {
63 for someglobal3&3 == 2 {
64 someglobal3++
65 someglobal3++
66 someglobal3++
67 someglobal3++
68 }
69 }
70 someglobal3++
71 someglobal3++
72 someglobal3++
73 someglobal3++
74 }
75 }
76
77 func main() {
78 go standinacorner1()
79 go standinacorner2(0)
80 go standinacorner3()
81
82 for someglobal1 == 0 {
83 runtime.Gosched()
84 }
85
86 for someglobal2 == 0 {
87 runtime.Gosched()
88 }
89
90 for someglobal3 == 0 {
91 runtime.Gosched()
92 }
93
94 runtime.GC()
95
96 }
97
View as plain text