Exemple #1
0
func TestConvertToTheNumber10(t *testing.T) {
	runtime.Breakpoint()
	i := convertToTheNumber10(5)
	if i != 10 {
		t.Fatalf("Expected %d to equal 10", i)
	}
}
Exemple #2
0
func (e *Entry) warnIfNotClosed() {
	if e.e != nil {
		log.Printf("precache: Entry(%p) leaked! (Getter: %v)", e, e.e.g)
		runtime.Breakpoint()
		e.Close()
	}
}
Exemple #3
0
func main() {
	i1 := 1
	i2 := 2
	p1 := &i1
	runtime.Breakpoint()
	fmt.Printf("%d %d %v\n", i1, i2, p1)
}
Exemple #4
0
func ext۰runtime۰Breakpoint(fr *Frame, args []Value) Value {
	// If tracehook is DefaultTraceHook, should we run a PrintStack
	// and leave?
	TraceHook(fr, &fr.block.Instrs[0], ssa2.TRACE_CALL)
	runtime.Breakpoint()
	return nil
}
Exemple #5
0
func main() {
	i1 := 1
	i2 := 2
	p1 := &i1
	runtime.Breakpoint()
	fmt.Println(i1, i2, p1)
}
Exemple #6
0
func test() {
	fmt.Print("aaa")
	runtime.Breakpoint()
	fmt.Print("bbb")
	fmt.Print("bb")
	fmt.Print("bb2")
	fmt.Print("bbb")
}
Exemple #7
0
func main() {
	var i *int
	fmt.Println(4 * *2)
	fmt.Println(i)
	changeSample(&i)
	runtime.Breakpoint()
	fmt.Println(*i)
}
Exemple #8
0
func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		runtime.Breakpoint()
		msg := "hello, world!"
		header := w.Header().Get("Content-Type")
		w.Write([]byte(msg + header))
	})
	http.ListenAndServe(":9191", nil)
}
Exemple #9
0
func main() {
	fn1 := afunction
	var o someStruct
	fn2 := o.structfunc
	fn3 := func(s string) {
		fmt.Println("inline", s)
	}
	runtime.Breakpoint()
	fmt.Println(fn1, fn2, fn3, o)
}
Exemple #10
0
func main() {
	b := B{A: A{-314}, C: &C{"hello"}, a: A{42}, ptr: &A{1337}}
	runtime.Breakpoint()
	fmt.Println(b)
	fmt.Println(b.val)
	fmt.Println(b.A.val)
	fmt.Println(b.a.val)
	fmt.Println(b.ptr.val)
	fmt.Println(b.C.s)
	fmt.Println(b.s)
}
Exemple #11
0
func main() {
	flag.Parse()
	f, err := os.Create(*cpuprofile)
	if err != nil {
		log.Fatal(err)
	}
	runtime.Breakpoint()
	pprof.StartCPUProfile(f)
	defer pprof.StopCPUProfile()
	Print("aaaaaaaaaaaaaaaaaaa")
}
Exemple #12
0
// GCD. We assume positive numbers
func gcd(a int, b int) int {
	// Make: a <= b
	if a > b {
		a, b = b, a
	}

	if a <= 0 {
		return -1
	}

	runtime.Breakpoint()
	if a == 1 || b-a == 0 {
		return a
	}
	return gcd(b-a, a)
}
Exemple #13
0
func main() {
	n :=
		append +
			bool +
			byte +
			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 +
			iota
	if n != NUM*(NUM-1)/2 {
		fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2)
		runtime.Breakpoint() // panic is inaccessible
	}
}
Exemple #14
0
func foobar(baz string, bar FooBar) {
	var (
		a1   = "foofoofoofoofoofoo"
		a2   = 6
		a3   = 7.23
		a4   = [2]int{1, 2}
		a5   = []int{1, 2, 3, 4, 5}
		a6   = FooBar{Baz: 8, Bur: "word"}
		a7   = &FooBar{Baz: 5, Bur: "strum"}
		a8   = FooBar2{Bur: 10, Baz: "feh"}
		a9   = (*FooBar)(nil)
		a10  = a1[2:5]
		a11  = [3]FooBar{{1, "a"}, {2, "b"}, {3, "c"}}
		a12  = []FooBar{{4, "d"}, {5, "e"}}
		a13  = []*FooBar{{6, "f"}, {7, "g"}, {8, "h"}}
		b1   = true
		b2   = false
		neg  = -1
		i8   = int8(1)
		u8   = uint8(255)
		u16  = uint16(65535)
		u32  = uint32(4294967295)
		u64  = uint64(18446744073709551615)
		up   = uintptr(5)
		f32  = float32(1.2)
		c64  = complex(float32(1), float32(2))
		c128 = complex(float64(2), float64(3))
		i32  = [2]int32{1, 2}
		f    = barfoo
		ms   = Nest{0, &Nest{1, &Nest{2, &Nest{3, &Nest{4, nil}}}}} // Test recursion capping
		ba   = make([]int, 200, 200)                                // Test array size capping
	)

	runtime.Breakpoint()
	barfoo()
	fmt.Println(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, b1, b2, baz, neg, i8, u8, u16, u32, u64, up, f32, c64, c128, i32, bar, f, ms, ba, p1)
}
Exemple #15
0
func (c *common) Error(args ...interface{}) {
	header("Error")
	fmt.Println(args...)
	runtime.Breakpoint()
	hadError = true
}
Exemple #16
0
func (c *common) SkipNow()                 { header("SkipNow"); runtime.Breakpoint() }
Exemple #17
0
func (c *common) Skip(args ...interface{}) { header("Skip"); fmt.Println(args...); runtime.Breakpoint() }
Exemple #18
0
func (c *common) Log(args ...interface{})  { header("Log"); fmt.Println(args...); runtime.Breakpoint() }
Exemple #19
0
func (c *common) Logf(format string, args ...interface{}) {
	header("Logf")
	fmt.Printf(format, args...)
	runtime.Breakpoint()
}
Exemple #20
0
func (c *common) Fatal(args ...interface{}) {
	header("Fatal")
	fmt.Println(args...)
	runtime.Breakpoint()
	badExit()
}
Exemple #21
0
func main() {
	i1 := 1
	i2 := 2
	f1 := 3.0
	i3 := 3
	p1 := &i1
	s1 := []string{"one", "two", "three", "four", "five"}
	a1 := [5]string{"one", "two", "three", "four", "five"}
	c1 := cstruct{&bstruct{astruct{1, 2}}, []*astruct{&astruct{1, 2}, &astruct{2, 3}, &astruct{4, 5}}}
	s2 := []astruct{{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12}, {13, 14}, {15, 16}}
	p2 := &(c1.sa[2].B)
	as1 := astruct{1, 1}
	var p3 *int
	str1 := "01234567890"
	var fn1 functype = afunc
	var fn2 functype = nil
	var nilslice []int = nil
	var nilptr *int = nil
	ch1 := make(chan int, 2)
	var chnil chan int = nil
	m1 := map[string]astruct{
		"Malone":          astruct{2, 3},
		"Adenauer":        astruct{},
		"squadrons":       astruct{},
		"quintuplets":     astruct{},
		"parasite":        astruct{},
		"wristwatches":    astruct{},
		"flashgun":        astruct{},
		"equivocally":     astruct{},
		"sweetbrier":      astruct{},
		"idealism":        astruct{},
		"tangos":          astruct{},
		"alterable":       astruct{},
		"quaffing":        astruct{},
		"arsenic":         astruct{},
		"coincidentally":  astruct{},
		"hindrances":      astruct{},
		"zoning":          astruct{},
		"egging":          astruct{},
		"inserts":         astruct{},
		"adaptive":        astruct{},
		"orientations":    astruct{},
		"periling":        astruct{},
		"lip":             astruct{},
		"chant":           astruct{},
		"availing":        astruct{},
		"fern":            astruct{},
		"flummoxes":       astruct{},
		"meanders":        astruct{},
		"ravenously":      astruct{},
		"reminisce":       astruct{},
		"snorkel":         astruct{},
		"gutters":         astruct{},
		"jibbed":          astruct{},
		"tiara":           astruct{},
		"takers":          astruct{},
		"animates":        astruct{},
		"Zubenelgenubi":   astruct{},
		"bantering":       astruct{},
		"tumblers":        astruct{},
		"horticulturists": astruct{},
		"thallium":        astruct{},
	}
	var mnil map[string]astruct = nil
	m2 := map[int]*astruct{1: &astruct{10, 11}}
	m3 := map[astruct]int{{1, 1}: 42, {2, 2}: 43}
	up1 := unsafe.Pointer(&i1)

	var amb1 = 1
	runtime.Breakpoint()
	for amb1 := 0; amb1 < 10; amb1++ {
		fmt.Println(amb1)
	}
	fmt.Println(i1, i2, i3, p1, amb1, s1, a1, p2, p3, s2, as1, str1, f1, fn1, fn2, nilslice, nilptr, ch1, chnil, m1, mnil, m2, m3, up1)
}
func main() {
	runtime.Breakpoint()
	fmt.Println("broke")
}
Exemple #23
0
func (c *common) Errorf(format string, args ...interface{}) {
	header("Errorf")
	fmt.Printf(format, args...)
	runtime.Breakpoint()
	hadError = true
}
Exemple #24
0
func ext۰runtime۰Breakpoint(fn *ssa.Function, args []value) value {
	runtime.Breakpoint()
	return nil
}
Exemple #25
0
func (c *common) Fatalf(format string, args ...interface{}) {
	header("Fatalf")
	fmt.Printf(format, args...)
	runtime.Breakpoint()
	badExit()
}
Exemple #26
0
func die() {
	runtime.Breakpoint() // can't depend on panic
}
Exemple #27
0
func (c *common) FailNow()     { header("FailNow"); runtime.Breakpoint(); badExit() }
Exemple #28
0
func useless(args ...string) {
	runtime.Breakpoint()
	fmt.Println(args)
}
Exemple #29
0
func main() {
	i1 := 1
	i2 := 2
	f1 := 3.0
	i3 := 3
	p1 := &i1
	s1 := []string{"one", "two", "three", "four", "five"}
	s3 := make([]int, 0, 6)
	a1 := [5]string{"one", "two", "three", "four", "five"}
	c1 := cstruct{&bstruct{astruct{1, 2}}, []*astruct{&astruct{1, 2}, &astruct{2, 3}, &astruct{4, 5}}}
	s2 := []astruct{{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12}, {13, 14}, {15, 16}}
	p2 := &(c1.sa[2].B)
	as1 := astruct{1, 1}
	var p3 *int
	str1 := "01234567890"
	var fn1 functype = afunc
	var fn2 functype = nil
	var nilslice []int = nil
	var nilptr *int = nil
	ch1 := make(chan int, 2)
	var chnil chan int = nil
	m1 := map[string]astruct{
		"Malone":          astruct{2, 3},
		"Adenauer":        astruct{},
		"squadrons":       astruct{},
		"quintuplets":     astruct{},
		"parasite":        astruct{},
		"wristwatches":    astruct{},
		"flashgun":        astruct{},
		"equivocally":     astruct{},
		"sweetbrier":      astruct{},
		"idealism":        astruct{},
		"tangos":          astruct{},
		"alterable":       astruct{},
		"quaffing":        astruct{},
		"arsenic":         astruct{},
		"coincidentally":  astruct{},
		"hindrances":      astruct{},
		"zoning":          astruct{},
		"egging":          astruct{},
		"inserts":         astruct{},
		"adaptive":        astruct{},
		"orientations":    astruct{},
		"periling":        astruct{},
		"lip":             astruct{},
		"chant":           astruct{},
		"availing":        astruct{},
		"fern":            astruct{},
		"flummoxes":       astruct{},
		"meanders":        astruct{},
		"ravenously":      astruct{},
		"reminisce":       astruct{},
		"snorkel":         astruct{},
		"gutters":         astruct{},
		"jibbed":          astruct{},
		"tiara":           astruct{},
		"takers":          astruct{},
		"animates":        astruct{},
		"Zubenelgenubi":   astruct{},
		"bantering":       astruct{},
		"tumblers":        astruct{},
		"horticulturists": astruct{},
		"thallium":        astruct{},
	}
	var mnil map[string]astruct = nil
	m2 := map[int]*astruct{1: &astruct{10, 11}}
	m3 := map[astruct]int{{1, 1}: 42, {2, 2}: 43}
	up1 := unsafe.Pointer(&i1)
	i4 := 800
	i5 := -3
	i6 := -500
	var err1 error = c1.sa[0]
	var err2 error = c1.pb
	var errnil error = nil
	var iface1 interface{} = c1.sa[0]
	var iface2 interface{} = "test"
	var iface3 interface{} = map[string]constant.Value{}
	var iface4 interface{} = []constant.Value{constant.MakeInt64(4)}
	var ifacenil interface{} = nil
	arr1 := [4]int{0, 1, 2, 3}
	parr := &arr1
	cpx1 := complex(1, 2)
	const1 := constant.MakeInt64(3)
	recursive1 := dstruct{}
	recursive1.x = &recursive1
	var iface5 interface{} = &recursive1
	var iface2fn1 interface{} = afunc1
	var iface2fn2 interface{} = afunc2
	var mapinf maptype = map[string]interface{}{}
	mapinf["inf"] = mapinf
	var bencharr [64]benchstruct
	var benchparr [64]*benchstruct
	mainMenu := Menu{
		{Name: "home", Route: "/", Active: 1},
		{Name: "About", Route: "/about", Active: 1},
		{Name: "Login", Route: "/login", Active: 1},
	}

	for i := range benchparr {
		benchparr[i] = &benchstruct{}
	}

	var amb1 = 1
	runtime.Breakpoint()
	for amb1 := 0; amb1 < 10; amb1++ {
		fmt.Println(amb1)
	}
	runtime.Breakpoint()
	fmt.Println(i1, i2, i3, p1, amb1, s1, s3, a1, p2, p3, s2, as1, str1, f1, fn1, fn2, nilslice, nilptr, ch1, chnil, m1, mnil, m2, m3, up1, i4, i5, i6, err1, err2, errnil, iface1, iface2, ifacenil, arr1, parr, cpx1, const1, iface3, iface4, recursive1, recursive1.x, iface5, iface2fn1, iface2fn2, bencharr, benchparr, mapinf, mainMenu)
}
Exemple #30
0
func ext۰runtime۰Breakpoint(fr *frame, args []value) value {
	runtime.Breakpoint()
	return nil
}