PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
// runoutput -goexperiment rangefunc // Copyright 2023 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Torture test for range-over-func. // // cmd/internal/testdir runs this like // // go run rangegen.go >x.go // go run x.go // // but a longer version can be run using // // go run rangegen.go long // // In that second form, rangegen takes care of compiling // and running the code it generates, in batches. // That form takes 10-20 minutes to run. package main import ( "bytes" "fmt" "log" "math/bits" "os" "os/exec" "strings" ) const verbose = false func main() { long := len(os.Args) > 1 && os.Args[1] == "long" log.SetFlags(0) log.SetPrefix("rangegen: ") if !long && bits.UintSize == 32 { // Skip this test on 32-bit platforms, where it seems to // cause timeouts and build problems. skip() return } b := new(bytes.Buffer) tests := "" flush := func(force bool) { if !long || (strings.Count(tests, "\n") < 1000 && !force) { return } p(b, mainCode, tests) err := os.WriteFile("tmp.go", b.Bytes(), 0666) if err != nil { log.Fatal(err) } out, err := exec.Command("go", "run", "tmp.go").CombinedOutput() if err != nil { log.Fatalf("go run tmp.go: %v\n%s", err, out) } print(".") if force { print("\nPASS\n") } b.Reset() tests = "" p(b, "package main\n\n") p(b, "const verbose = %v\n\n", verbose) } p(b, "package main\n\n") p(b, "const verbose = %v\n\n", verbose) max := 2 if !long { max = 5 } for i := 1; i <= max; i++ { maxDouble := -1 if long { maxDouble = i } for double := -1; double <= maxDouble; double++ { code := gen(new(bytes.Buffer), "", "", "", i, double, func(c int) bool { return true }) for j := 0; j < code; j++ { hi := j + 1 if long { hi = code } for k := j; k < hi && k < code; k++ { s := fmt.Sprintf("%d_%d_%d_%d", i, double+1, j, k) code0 := gen(b, "testFunc"+s, "", "yield2", i, double, func(c int) bool { return c == j || c == k }) code1 := gen(b, "testSlice"+s, "_, ", "slice2", i, double, func(c int) bool { return c == j || c == k }) if code0 != code1 { panic("bad generator") } tests += "test" + s + "()\n" p(b, testCode, "test"+s, []int{j, k}, "testFunc"+s, "testSlice"+s) flush(false) } } } } for i := 1; i <= max; i++ { maxDouble := -1 if long { maxDouble = i } for double := -1; double <= maxDouble; double++ { s := fmt.Sprintf("%d_%d", i, double+1) code := gen(b, "testFunc"+s, "", "yield2", i, double, func(c int) bool { return true }) code1 := gen(b, "testSlice"+s, "_, ", "slice2", i, double, func(c int) bool { return true }) if code != code1 { panic("bad generator") } tests += "test" + s + "()\n" var all []int for j := 0; j < code; j++ { all = append(all, j) } p(b, testCode, "test"+s, all, "testFunc"+s, "testSlice"+s) flush(false) } } if long { flush(true) os.Remove("tmp.go") return } p(b, mainCode, tests) os.Stdout.Write(b.Bytes()) } func p(b *bytes.Buffer, format string, args ...any) { fmt.Fprintf(b, format, args...) } func gen(b *bytes.Buffer, name, prefix, rangeExpr string, depth, double int, allowed func(int) bool) int { p(b, "func %s(o *output, code int) int {\n", name) p(b, " dfr := 0; _ = dfr\n") code := genLoop(b, 0, prefix, rangeExpr, depth, double, 0, "", allowed) p(b, " return 0\n") p(b, "}\n\n") return code } func genLoop(b *bytes.Buffer, d int, prefix, rangeExpr string, depth, double, code int, labelSuffix string, allowed func(int) bool) int { limit := 1 if d == double { limit = 2 } for rep := 0; rep < limit; rep++ { if rep == 1 { labelSuffix = "R" } s := fmt.Sprintf("%d%s", d, labelSuffix) p(b, " o.log(`top%s`)\n", s) p(b, " l%sa := 0\n", s) p(b, "goto L%sa; L%sa: o.log(`L%sa`)\n", s, s, s) p(b, " if l%sa++; l%sa >= 2 { o.log(`loop L%sa`); return -1 }\n", s, s, s) p(b, " l%sfor := 0\n", s) p(b, "goto L%sfor; L%sfor: for f := 0; f < 1; f++ { o.log(`L%sfor`)\n", s, s, s) p(b, " if l%sfor++; l%sfor >= 2 { o.log(`loop L%sfor`); return -1 }\n", s, s, s) p(b, " l%ssw := 0\n", s) p(b, "goto L%ssw; L%ssw: switch { default: o.log(`L%ssw`)\n", s, s, s) p(b, " if l%ssw++; l%ssw >= 2 { o.log(`loop L%ssw`); return -1 }\n", s, s, s) p(b, " l%ssel := 0\n", s) p(b, "goto L%ssel; L%ssel: select { default: o.log(`L%ssel`)\n", s, s, s) p(b, " if l%ssel++; l%ssel >= 2 { o.log(`loop L%ssel`); return -1 }\n", s, s, s) p(b, " l%s := 0\n", s) p(b, "goto L%s; L%s: for %s i%s := range %s {\n", s, s, prefix, s, rangeExpr) p(b, " o.log1(`L%s top`, i%s)\n", s, s) p(b, " if l%s++; l%s >= 4 { o.log(`loop L%s`); return -1 }\n", s, s, s) printTests := func() { if code++; allowed(code) { p(b, " if code == %v { break }\n", code) } if code++; allowed(code) { p(b, " if code == %v { continue }\n", code) } if code++; allowed(code) { p(b, " switch { case code == %v: continue }\n", code) } if code++; allowed(code) { p(b, " if code == %v { return %[1]v }\n", code) } if code++; allowed(code) { p(b, " if code == %v { select { default: break } }\n", code) } if code++; allowed(code) { p(b, " if code == %v { switch { default: break } }\n", code) } if code++; allowed(code) { p(b, " if code == %v { dfr++; defer o.log1(`defer %d`, dfr) }\n", code, code) } for i := d; i > 0; i-- { suffix := labelSuffix if i < double { suffix = "" } if code++; allowed(code) { p(b, " if code == %v { break L%d%s }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { select { default: break L%d%s } }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { break L%d%s }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { break L%d%ssw }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { break L%d%ssel }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { break L%d%sfor }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { continue L%d%sfor }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { goto L%d%sa }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { goto L%d%s }\n", code, i, suffix) } if code++; allowed(code) { p(b, " if code == %v { goto L%d%sb }\n", code, i, suffix) } } } printTests() if d < depth { if rep == 1 { double = d // signal to children to use the rep=1 labels } code = genLoop(b, d+1, prefix, rangeExpr, depth, double, code, labelSuffix, allowed) printTests() } p(b, " o.log(`L%s bot`)\n", s) p(b, " }\n") p(b, " o.log(`L%ssel bot`)\n", s) p(b, " }\n") p(b, " o.log(`L%ssw bot`)\n", s) p(b, " }\n") p(b, " o.log(`L%sfor bot`)\n", s) p(b, " }\n") p(b, " o.log(`done%s`)\n", s) p(b, "goto L%sb; L%sb: o.log(`L%sb`)\n", s, s, s) } return code } var testCode = ` func %s() { all := %#v for i := 0; i < len(all); i++ { c := all[i] outFunc := run(%s, c) outSlice := run(%s, c) if !outFunc.eq(outSlice) { println("mismatch", "%[3]s", "%[4]s", c) println() println("func:") outFunc.print() println() println("slice:") outSlice.print() panic("mismatch") } } if verbose { println("did", "%[3]s", "%[4]s", len(all)) } } ` var mainCode = ` func main() { if verbose { println("main") } %s } func yield2(yield func(int)bool) { _ = yield(1) && yield(2) } var slice2 = []int{1,2} type output struct { ret int trace []any } func (o *output) log(x any) { o.trace = append(o.trace, x) } func (o *output) log1(x, y any) { o.trace = append(o.trace, x, y) } func (o *output) eq(p *output) bool{ if o.ret != p.ret || len(o.trace) != len(p.trace) { return false } for i ,x := range o.trace { if x != p.trace[i] { return false } } return true } func (o *output) print() { println("ret", o.ret, "trace-len", len(o.trace)) for i := 0; i < len(o.trace); i++ { print("#", i, " ") switch x := o.trace[i].(type) { case int: print(x) case string: print(x) default: print(x) } print("\n") } } func run(f func(*output, int)int, i int) *output { o := &output{} o.ret = f(o, i) return o } ` func skip() { const code = ` package main func main() { } ` fmt.Printf("%s\n", code) }