Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/arm/go/src/cmd/link/internal/ld/testdata/issue25459/a/a.go

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


package a

const Always = true

var Count int

type FuncReturningInt func() int

var PointerToConstIf FuncReturningInt

func ConstIf() int {
	if Always {
		return 1
	}
	var imdead [4]int
	imdead[Count] = 1
	return imdead[0]
}

func CallConstIf() int {
	Count += 3
	return ConstIf()
}

func Another() {
	defer func() { PointerToConstIf = ConstIf; Count += 1 }()
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.