Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for CheckFunc (0.14 sec)

  1. src/cmd/compile/internal/ssa/nilcheck_test.go

    			If("bool2", "extra", "exit")),
    		Bloc("extra",
    			Goto("exit")),
    		Bloc("exit",
    			Exit("mem")))
    
    	CheckFunc(fun.f)
    	nilcheckelim(fun.f)
    
    	// clean up the removed nil check
    	fuse(fun.f, fuseTypePlain)
    	deadcode(fun.f)
    
    	CheckFunc(fun.f)
    	for _, b := range fun.f.Blocks {
    		if b == fun.blocks["secondCheck"] && isNilCheck(b) {
    			t.Errorf("secondCheck was not eliminated")
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 23:34:11 UTC 2023
    - 12.3K bytes
    - Viewed (0)
  2. src/net/http/httptest/recorder_test.go

    package httptest
    
    import (
    	"fmt"
    	"io"
    	"net/http"
    	"testing"
    )
    
    func TestRecorder(t *testing.T) {
    	type checkFunc func(*ResponseRecorder) error
    	check := func(fns ...checkFunc) []checkFunc { return fns }
    
    	hasStatus := func(wantCode int) checkFunc {
    		return func(rec *ResponseRecorder) error {
    			if rec.Code != wantCode {
    				return fmt.Errorf("Status = %d; want %d", rec.Code, wantCode)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 23:17:38 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ssa/fuse_test.go

    			Valu("bool1", OpNeqPtr, c.config.Types.Bool, 0, nil, "ptr1", "nilptr"),
    			If("bool1", "then", "exit")),
    		Bloc("then",
    			Goto("exit")),
    		Bloc("exit",
    			Exit("mem")))
    
    	CheckFunc(fun.f)
    	fuseLate(fun.f)
    
    	for _, b := range fun.f.Blocks {
    		if b == fun.blocks["then"] && b.Kind != BlockInvalid {
    			t.Errorf("then was not eliminated, but should have")
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 20:45:54 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/passbm_test.go

    	fun := c.Fun("entry", bg(size)...)
    	CheckFunc(fun.f)
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		fn(fun.f)
    		b.StopTimer()
    		CheckFunc(fun.f)
    		b.StartTimer()
    	}
    }
    
    // benchFnBlock runs passFunc across a function with b.N blocks.
    func benchFnBlock(b *testing.B, fn passFunc, bg blockGen) {
    	b.ReportAllocs()
    	c := testConfig(b)
    	fun := c.Fun("entry", bg(b.N)...)
    	CheckFunc(fun.f)
    	b.ResetTimer()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssa/deadstore_test.go

    			Valu("store4", OpStore, types.TypeMem, 0, c.config.Types.Bool, "addr3", "v", "store3"),
    			Goto("exit")),
    		Bloc("exit",
    			Exit("store3")))
    
    	CheckFunc(fun.f)
    	dse(fun.f)
    	CheckFunc(fun.f)
    
    	v1 := fun.values["store1"]
    	if v1.Op != OpCopy {
    		t.Errorf("dead store not removed")
    	}
    
    	v2 := fun.values["zero1"]
    	if v2.Op != OpCopy {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 25 20:07:26 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ssa/regalloc_test.go

    			Eq("a", "if", "exit"),
    		),
    		Bloc("if",
    			Eq("b", "plain", "exit"),
    		),
    		Bloc("plain",
    			Goto("exit"),
    		),
    		Bloc("exit",
    			Exit("mem"),
    		),
    	)
    	flagalloc(f.f)
    	regalloc(f.f)
    	checkFunc(f.f)
    }
    
    // Test to make sure G register is never reloaded from spill (spill of G is okay)
    // See #25504
    func TestNoGetgLoadReg(t *testing.T) {
    	/*
    		Original:
    		func fff3(i int) *g {
    			gee := getg()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:09:14 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/dom_test.go

    	return blocs
    }
    
    // sink for benchmark
    var domBenchRes []*Block
    
    func benchmarkDominators(b *testing.B, size int, bg blockGen) {
    	c := testConfig(b)
    	fun := c.Fun("entry", bg(size)...)
    
    	CheckFunc(fun.f)
    	b.SetBytes(int64(size))
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		domBenchRes = dominators(fun.f)
    	}
    }
    
    type domFunc func(f *Func) []*Block
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/cse_test.go

    			Valu("rstore", OpStore, types.TypeMem, 0, c.config.Types.Int64, "raddr", "r10", "raddrdef"),
    			Goto("exit")),
    		Bloc("exit",
    			Exit("rstore")))
    
    	CheckFunc(fun.f)
    	cse(fun.f)
    	deadcode(fun.f)
    	CheckFunc(fun.f)
    
    	s1Cnt := 2
    	// r1 == r2 == r3, needs to remove two of this set
    	s2Cnt := 1
    	// r4 == r5, needs to remove one of these
    	for k, v := range fun.values {
    		if v.Op == OpInvalid {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:09:14 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/ssa/sccp_test.go

    			Valu("t29", OpIsInBounds, c.config.Types.Int64, 0, nil, "v2", "v1"),
    			Valu("t30", OpIsSliceInBounds, c.config.Types.Int64, 0, nil, "v2", "v1"),
    			Goto("b2")),
    		Bloc("b2",
    			Exit("mem")))
    	sccp(fun.f)
    	CheckFunc(fun.f)
    	for name, value := range fun.values {
    		if strings.HasPrefix(name, "t") {
    			if !isConst(value) {
    				t.Errorf("Must be constant: %v", value.LongString())
    			}
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 21:01:50 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  10. tools/istio-iptables/pkg/builder/iptables_builder_test.go

    				goldenNameV4 = goldenName
    				goldenNameV6 = goldenName
    			} else {
    				goldenNameV4 = tt.name + "-v4"
    				goldenNameV6 = tt.name + "-v6"
    			}
    			checkFunc(goldenNameV4, iptables.BuildV4(), iptables.BuildV4Restore(), tt.expectV4)
    			checkFunc(goldenNameV6, iptables.BuildV6(), iptables.BuildV6Restore(), tt.expectV6)
    		})
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 11 14:29:54 UTC 2024
    - 6.6K bytes
    - Viewed (0)
Back to top