Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for rightCall (0.09 sec)

  1. src/cmd/compile/internal/test/testdata/short_test.go

    // Tests short circuiting.
    
    package main
    
    import "testing"
    
    func and_ssa(arg1, arg2 bool) bool {
    	return arg1 && rightCall(arg2)
    }
    
    func or_ssa(arg1, arg2 bool) bool {
    	return arg1 || rightCall(arg2)
    }
    
    var rightCalled bool
    
    //go:noinline
    func rightCall(v bool) bool {
    	rightCalled = true
    	return v
    	panic("unreached")
    }
    
    func testAnd(t *testing.T, arg1, arg2, wantRes bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 1.5K bytes
    - Viewed (0)
Back to top