mirror of
https://github.com/golang/go.git
synced 2026-01-30 07:32:05 +03:00
Compare commits
118 Commits
dev.typepa
...
go1.16.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
378766af9e | ||
|
|
0551247ca3 | ||
|
|
a845a562a0 | ||
|
|
169be8e5b1 | ||
|
|
281860c4fe | ||
|
|
168bc3a76e | ||
|
|
831d491ad7 | ||
|
|
9364c89e26 | ||
|
|
f1f3923d2e | ||
|
|
d0aebe3e74 | ||
|
|
99950270f3 | ||
|
|
44a3fb49d9 | ||
|
|
caced3b213 | ||
|
|
98ef91b38e | ||
|
|
8faefcbfce | ||
|
|
8a12f5d6e8 | ||
|
|
b29e772caf | ||
|
|
0f9838eeb1 | ||
|
|
266ee22f9c | ||
|
|
5a93142cec | ||
|
|
f2b0149e57 | ||
|
|
f6103e9b56 | ||
|
|
7da96592c4 | ||
|
|
3729a67f31 | ||
|
|
23991f50b3 | ||
|
|
88407a8dd9 | ||
|
|
631b56767c | ||
|
|
d19c5bdb24 | ||
|
|
900443349b | ||
|
|
8c9c148772 | ||
|
|
1a6281d950 | ||
|
|
cfe182c673 | ||
|
|
c580180744 | ||
|
|
4548fcc8df | ||
|
|
7d57324030 | ||
|
|
552410fec2 | ||
|
|
170a72e58b | ||
|
|
021fc241c9 | ||
|
|
8226cb06aa | ||
|
|
6c480017ae | ||
|
|
0d530843be | ||
|
|
d66b2112bd | ||
|
|
fa6aa87222 | ||
|
|
a6ca6d90b3 | ||
|
|
16ab7e49d4 | ||
|
|
37c117f2bf | ||
|
|
4c62fd3677 | ||
|
|
8b6ae9be12 | ||
|
|
3d5afa9610 | ||
|
|
0fb1e1438b | ||
|
|
accf363d5d | ||
|
|
ae7943e11b | ||
|
|
ed8cbbc3ae | ||
|
|
bc51e93027 | ||
|
|
58bc454a11 | ||
|
|
fb052db03a | ||
|
|
a91ed836c5 | ||
|
|
cb4cd9e177 | ||
|
|
d4ee0255f2 | ||
|
|
fd129a6b0e | ||
|
|
7677616a26 | ||
|
|
0d6115c352 | ||
|
|
f2222d8284 | ||
|
|
c9f27b8d31 | ||
|
|
dbf69b7da4 | ||
|
|
40b97d6921 | ||
|
|
1613be8481 | ||
|
|
0410005dc4 | ||
|
|
895fb1bb6f | ||
|
|
df6a737cc8 | ||
|
|
9210eaf7dc | ||
|
|
305fa952c2 | ||
|
|
c7248a0c94 | ||
|
|
04cd717a26 | ||
|
|
87ffba35dd | ||
|
|
ce04f86bd3 | ||
|
|
7e709791c2 | ||
|
|
ea0537f2fc | ||
|
|
e67a58b7cb | ||
|
|
d4adea20f0 | ||
|
|
f12cf7694f | ||
|
|
9baddd3f21 | ||
|
|
96139f2599 | ||
|
|
887c0d890f | ||
|
|
3a45c13094 | ||
|
|
2940614c63 | ||
|
|
1d967ab95c | ||
|
|
9c7463ca90 | ||
|
|
ac59d7abb9 | ||
|
|
33fb47921f | ||
|
|
902d16e97b | ||
|
|
f39c4deee8 | ||
|
|
0da04a662a | ||
|
|
3979fb9af9 | ||
|
|
5993fbbd48 | ||
|
|
6e04188440 | ||
|
|
b5c1b5aa07 | ||
|
|
e9e0473681 | ||
|
|
634d28d78c | ||
|
|
d86e53e896 | ||
|
|
3068d55c2f | ||
|
|
a9ba734e4d | ||
|
|
047ca22916 | ||
|
|
2b7243a62f | ||
|
|
a9547ad8ad | ||
|
|
292abd96ae | ||
|
|
88f91b709e | ||
|
|
4fd2617cd8 | ||
|
|
e0bd146a13 | ||
|
|
ca9cd629fb | ||
|
|
18e5d75ffb | ||
|
|
ddeae6b248 | ||
|
|
b7e0eb49d8 | ||
|
|
0b8c416688 | ||
|
|
1a7e9af153 | ||
|
|
f21be2fdc6 | ||
|
|
e34168e634 | ||
|
|
3e06467282 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,7 +37,6 @@ _testmain.go
|
||||
/src/cmd/internal/objabi/zbootstrap.go
|
||||
/src/go/build/zcgo.go
|
||||
/src/go/doc/headscan
|
||||
/src/internal/buildcfg/zbootstrap.go
|
||||
/src/runtime/internal/sys/zversion.go
|
||||
/src/unicode/maketables
|
||||
/test.out
|
||||
|
||||
7
AUTHORS
7
AUTHORS
@@ -41,7 +41,7 @@ Aeneas Rekkas (arekkas) <aeneas@ory.am>
|
||||
Afanasev Stanislav <phpprogger@gmail.com>
|
||||
Agis Anastasopoulos <agis.anast@gmail.com>
|
||||
Agniva De Sarker <agnivade@yahoo.co.in>
|
||||
Ahmed W. Mones <oneofone@gmail.com>
|
||||
Ahmed Wahed <oneofone@gmail.com>
|
||||
Ahmet Soormally <ahmet@mangomm.co.uk>
|
||||
Ahmy Yulrizka <yulrizka@gmail.com>
|
||||
Aiden Scandella <ai@uber.com>
|
||||
@@ -145,7 +145,7 @@ Andy Davis <andy@bigandian.com>
|
||||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com> <panjf2000@golangcn.org> <i@andypan.me>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Anfernee Yongkun Gui <anfernee.gui@gmail.com>
|
||||
Angelo Bulfone <mbulfone@gmail.com>
|
||||
@@ -195,7 +195,7 @@ Ayanamist Yang <ayanamist@gmail.com>
|
||||
Aymerick Jéhanne <aymerick@jehanne.org>
|
||||
Azat Kaumov <kaumov.a.r@gmail.com>
|
||||
Baiju Muthukadan <baiju.m.mail@gmail.com>
|
||||
Baokun Lee <nototon@gmail.com> <bk@golangcn.org>
|
||||
Baokun Lee <nototon@gmail.com>
|
||||
Bartosz Grzybowski <melkorm@gmail.com>
|
||||
Bastian Ike <bastian.ike@gmail.com>
|
||||
Ben Burkert <ben@benburkert.com>
|
||||
@@ -1425,7 +1425,6 @@ Wèi Cōngruì <crvv.mail@gmail.com>
|
||||
Wei Fu <fhfuwei@163.com>
|
||||
Wei Guangjing <vcc.163@gmail.com>
|
||||
Weichao Tang <tevic.tt@gmail.com>
|
||||
Weixie Cui <cuiweixie@gmail.com> <523516579@qq.com>
|
||||
Wembley G. Leach, Jr <wembley.gl@gmail.com>
|
||||
Will Faught <will.faught@gmail.com>
|
||||
Will Storey <will@summercat.com>
|
||||
|
||||
145
CONTRIBUTORS
145
CONTRIBUTORS
@@ -33,7 +33,6 @@ Aaron Jacobs <jacobsa@google.com>
|
||||
Aaron Jensen <jensen.aaro@gmail.com>
|
||||
Aaron Kemp <kemp.aaron@gmail.com>
|
||||
Aaron Patterson <tenderlove@ruby-lang.org>
|
||||
Aaron Sheah <aaronsheah@gmail.com>
|
||||
Aaron Stein <aaronstein12@gmail.com>
|
||||
Aaron Torres <tcboox@gmail.com>
|
||||
Aaron Zinman <aaron@azinman.com>
|
||||
@@ -48,7 +47,6 @@ Adam Harvey <aharvey@php.net>
|
||||
Adam Kisala <adam.kisala@gmail.com>
|
||||
Adam Langley <agl@golang.org>
|
||||
Adam Medzinski <adam.medzinski@gmail.com>
|
||||
Adam Mitha <adam.mitha@gmail.com>
|
||||
Adam Shannon <adamkshannon@gmail.com>
|
||||
Adam Shelton <aashelt90@gmail.com>
|
||||
Adam Sindelar <adamsh@google.com>
|
||||
@@ -56,8 +54,6 @@ Adam Thomason <athomason@gmail.com>
|
||||
Adam Williams <pwnfactory@gmail.com>
|
||||
Adam Woodbeck <adam@woodbeck.net>
|
||||
Adarsh Ravichandran <adarshravichandran91@gmail.com>
|
||||
Adel Rodríguez <adel.rodriguez@leftfieldlabs.com>
|
||||
Adin Scannell <ascannell@google.com>
|
||||
Aditya Harindar <aditya.harindar@gmail.com>
|
||||
Aditya Mukerjee <dev@chimeracoder.net>
|
||||
Adrian Hesketh <adrianhesketh@hushmail.com>
|
||||
@@ -71,8 +67,7 @@ Aeneas Rekkas (arekkas) <aeneas@ory.am>
|
||||
Afanasev Stanislav <phpprogger@gmail.com>
|
||||
Agis Anastasopoulos <agis.anast@gmail.com>
|
||||
Agniva De Sarker <agnivade@yahoo.co.in>
|
||||
Ahmed W. Mones <oneofone@gmail.com>
|
||||
Ahmet Aktürk <aakturk000@gmail.com>
|
||||
Ahmed Wahed <oneofone@gmail.com>
|
||||
Ahmet Alp Balkan <ahmetb@google.com>
|
||||
Ahmet Soormally <ahmet@mangomm.co.uk>
|
||||
Ahmy Yulrizka <yulrizka@gmail.com>
|
||||
@@ -97,13 +92,11 @@ Alberto Bertogli <albertito@blitiri.com.ar>
|
||||
Alberto Donizetti <alb.donizetti@gmail.com>
|
||||
Alberto García Hierro <alberto@garciahierro.com> <alberto.garcia.hierro@gmail.com>
|
||||
Alec Benzer <alec.benzer@gmail.com>
|
||||
Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
Aleksa Sarai <cyphar@cyphar.com>
|
||||
Aleksandar Dezelin <dezelin@gmail.com>
|
||||
Aleksandr Lukinykh <a.lukinykh@xsolla.com>
|
||||
Aleksandr Razumov <ar@cydev.ru>
|
||||
Alekseev Artem <a.artem060@gmail.com>
|
||||
Aleksei Tirman <aleksei.tirman@jetbrains.com>
|
||||
Alessandro Arzilli <alessandro.arzilli@gmail.com>
|
||||
Alessandro Baffa <alessandro.baffa@gmail.com>
|
||||
Alex A Skinner <alex@lx.lc>
|
||||
@@ -172,7 +165,6 @@ Ali Rizvi-Santiago <arizvisa@gmail.com>
|
||||
Aliaksandr Valialkin <valyala@gmail.com>
|
||||
Alice Merrick <amerrick@google.com>
|
||||
Alif Rachmawadi <subosito@gmail.com>
|
||||
Allan Guwatudde <guwats10@gmail.com>
|
||||
Allan Simon <allan.simon@supinfo.com>
|
||||
Allen Li <ayatane@google.com>
|
||||
Alok Menghrajani <alok.menghrajani@gmail.com>
|
||||
@@ -180,7 +172,6 @@ Alwin Doss <alwindoss84@gmail.com>
|
||||
Aman Gupta <aman@tmm1.net>
|
||||
Amarjeet Anand <amarjeetanandsingh@gmail.com>
|
||||
Amir Mohammad Saied <amir@gluegadget.com>
|
||||
Amit Kumar <mittalmailbox@gmail.com>
|
||||
Amr Mohammed <merodiro@gmail.com>
|
||||
Amrut Joshi <amrut.joshi@gmail.com>
|
||||
An Long <aisk1988@gmail.com>
|
||||
@@ -194,7 +185,6 @@ André Carvalho <asantostc@gmail.com>
|
||||
André Martins <aanm90@gmail.com>
|
||||
Andre Nathan <andrenth@gmail.com>
|
||||
Andrea Nodari <andrea.nodari91@gmail.com>
|
||||
Andrea Simonini <andrea.simonini@gmail.com>
|
||||
Andrea Spadaccini <spadaccio@google.com>
|
||||
Andreas Auernhammer <aead@mail.de>
|
||||
Andreas Jellinghaus <andreas@ionisiert.de> <anj@google.com>
|
||||
@@ -250,11 +240,10 @@ Andy Davis <andy@bigandian.com>
|
||||
Andy Finkenstadt <afinkenstadt@zynga.com>
|
||||
Andy Lindeman <andy@lindeman.io>
|
||||
Andy Maloney <asmaloney@gmail.com>
|
||||
Andy Pan <panjf2000@gmail.com> <panjf2000@golangcn.org> <i@andypan.me>
|
||||
Andy Pan <panjf2000@gmail.com>
|
||||
Andy Walker <walkeraj@gmail.com>
|
||||
Andy Wang <cbeuw.andy@gmail.com>
|
||||
Andy Williams <andy@andy.xyz>
|
||||
Andy Zhao <andyzhao@google.com>
|
||||
Andzej Maciusovic <andzej.maciusovic@gmail.com>
|
||||
Anfernee Yongkun Gui <anfernee.gui@gmail.com>
|
||||
Angelo Bulfone <mbulfone@gmail.com>
|
||||
@@ -280,7 +269,6 @@ Anton Kuklin <anton.a.kuklin@gmail.com>
|
||||
Antonin Amand <antonin.amand@gmail.com>
|
||||
Antonio Antelo <aantelov87@gmail.com>
|
||||
Antonio Bibiano <antbbn@gmail.com>
|
||||
Antonio Garcia <garcia.olais@gmail.com>
|
||||
Antonio Huete Jimenez <tuxillo@quantumachine.net>
|
||||
Antonio Murdaca <runcom@redhat.com>
|
||||
Antonio Troina <thoeni@gmail.com>
|
||||
@@ -304,10 +292,8 @@ Artem Khvastunov <artem.khvastunov@jetbrains.com>
|
||||
Artem Kolin <artemkaxboy@gmail.com>
|
||||
Arthur Fabre <arthur@arthurfabre.com>
|
||||
Arthur Khashaev <arthur@khashaev.ru>
|
||||
Artur M. Wolff <artur.m.wolff@gmail.com>
|
||||
Artyom Pervukhin <artyom.pervukhin@gmail.com>
|
||||
Arvindh Rajesh Tamilmani <art@a-30.net>
|
||||
Ashish Bhate <ab.listsubs@gmail.com>
|
||||
Ashish Gandhi <ag@ashishgandhi.org>
|
||||
Asim Shankar <asimshankar@gmail.com>
|
||||
Assel Meher <asselmeher@gmail.com>
|
||||
@@ -335,11 +321,10 @@ Azat Kaumov <kaumov.a.r@gmail.com>
|
||||
Baiju Muthukadan <baiju.m.mail@gmail.com>
|
||||
Balaram Makam <bmakam.qdt@qualcommdatacenter.com>
|
||||
Balazs Lecz <leczb@google.com>
|
||||
Baokun Lee <nototon@gmail.com> <bk@golangcn.org>
|
||||
Baokun Lee <nototon@gmail.com>
|
||||
Barnaby Keene <accounts@southcla.ws>
|
||||
Bartosz Grzybowski <melkorm@gmail.com>
|
||||
Bartosz Oler <brtsz@google.com>
|
||||
Bassam Ojeil <bojeil@google.com>
|
||||
Bastian Ike <bastian.ike@gmail.com>
|
||||
Ben Burkert <ben@benburkert.com>
|
||||
Ben Cartwright-Cox <Ben@Benjojo.co.uk>
|
||||
@@ -347,7 +332,6 @@ Ben Eitzen <eitzenb@golang.org>
|
||||
Ben Fried <ben.fried@gmail.com>
|
||||
Ben Haines <bhainesva@gmail.com>
|
||||
Ben Hoyt <benhoyt@gmail.com>
|
||||
Ben Hutchings <ben.hutchings@essensium.com>
|
||||
Ben Kraft <benkraft@khanacademy.org>
|
||||
Ben Laurie <ben@links.org> <benl@google.com>
|
||||
Ben Lubar <ben.lubar@gmail.com>
|
||||
@@ -446,7 +430,6 @@ Carl Henrik Lunde <chlunde@ifi.uio.no>
|
||||
Carl Jackson <carl@stripe.com>
|
||||
Carl Johnson <me@carlmjohnson.net>
|
||||
Carl Mastrangelo <notcarl@google.com>
|
||||
Carl Menezes <carleeto@gmail.com>
|
||||
Carl Shapiro <cshapiro@google.com> <cshapiro@golang.org>
|
||||
Carlisia Campos <carlisia@grokkingtech.io>
|
||||
Carlo Alberto Ferraris <cafxx@strayorange.com>
|
||||
@@ -460,7 +443,6 @@ Carlos Iriarte <ciriarte@gmail.com>
|
||||
Carlos Souza <carloshrsouza@gmail.com>
|
||||
Carolyn Van Slyck <me@carolynvanslyck.com>
|
||||
Carrie Bynon <cbynon@gmail.com>
|
||||
Carson Hoffman <c@rsonhoffman.com>
|
||||
Cary Hull <chull@google.com>
|
||||
Case Nelson <case.nelson@gmail.com>
|
||||
Casey Callendrello <squeed@gmail.com>
|
||||
@@ -480,12 +462,11 @@ Charles Kenney <charlesc.kenney@gmail.com>
|
||||
Charles L. Dorian <cldorian@gmail.com>
|
||||
Charles Lee <zombie.fml@gmail.com>
|
||||
Charles Weill <weill@google.com>
|
||||
Charlie Moog <moogcharlie@gmail.com>
|
||||
Charlotte Brandhorst-Satzkorn <catzkorn@gmail.com>
|
||||
Chauncy Cullitan <chauncyc@google.com>
|
||||
Chen Zhidong <njutczd@gmail.com>
|
||||
Chen Zhihan <energiehund@gmail.com>
|
||||
Cherry Mui <cherryyz@google.com>
|
||||
Cherry Zhang <cherryyz@google.com>
|
||||
Chew Choon Keat <choonkeat@gmail.com>
|
||||
Chiawen Chen <golopot@gmail.com>
|
||||
Chirag Sukhala <cchirag77@gmail.com>
|
||||
@@ -535,7 +516,6 @@ Christopher Nelson <nadiasvertex@gmail.com>
|
||||
Christopher Nielsen <m4dh4tt3r@gmail.com>
|
||||
Christopher Redden <christopher.redden@gmail.com>
|
||||
Christopher Swenson <cswenson@google.com>
|
||||
Christopher Thomas <53317512+chrisssthomas@users.noreply.github.com>
|
||||
Christopher Wedgwood <cw@f00f.org>
|
||||
Christos Zoulas <christos@zoulas.com> <zoulasc@gmail.com>
|
||||
Christy Perez <christy@linux.vnet.ibm.com>
|
||||
@@ -561,8 +541,6 @@ Cosmos Nicolaou <cnicolaou@google.com>
|
||||
Costin Chirvasuta <ctin@google.com>
|
||||
Craig Citro <craigcitro@google.com>
|
||||
Cristian Staretu <unclejacksons@gmail.com>
|
||||
Cristo García <cgg.code@gmail.com>
|
||||
cui fliter <imcusg@gmail.com>
|
||||
Cuihtlauac ALVARADO <cuihtlauac.alvarado@orange.com>
|
||||
Cuong Manh Le <cuong@orijtech.com>
|
||||
Curtis La Graff <curtis@lagraff.me>
|
||||
@@ -582,7 +560,6 @@ Dan Callahan <dan.callahan@gmail.com>
|
||||
Dan Harrington <harringtond@google.com>
|
||||
Dan Jacques <dnj@google.com>
|
||||
Dan Johnson <computerdruid@google.com>
|
||||
Dan McArdle <dmcardle@google.com>
|
||||
Dan Peterson <dpiddy@gmail.com>
|
||||
Dan Pupius <dan@medium.com>
|
||||
Dan Scales <danscales@google.com>
|
||||
@@ -634,7 +611,6 @@ Dave Russell <forfuncsake@gmail.com>
|
||||
David Anderson <danderson@google.com>
|
||||
David Barnett <dbarnett@google.com>
|
||||
David Benjamin <davidben@google.com>
|
||||
David Black <dblack@atlassian.com>
|
||||
David Bond <davidsbond93@gmail.com>
|
||||
David Brophy <dave@brophy.uk>
|
||||
David Bürgin <676c7473@gmail.com>
|
||||
@@ -678,7 +654,6 @@ Davor Kapsa <davor.kapsa@gmail.com>
|
||||
Dean Eigenmann <7621705+decanus@users.noreply.github.com>
|
||||
Dean Prichard <dean.prichard@gmail.com>
|
||||
Deepak Jois <deepak.jois@gmail.com>
|
||||
Deepak S <deepakspavoodath@gmail.com>
|
||||
Denis Bernard <db047h@gmail.com>
|
||||
Denis Brandolini <denis.brandolini@gmail.com>
|
||||
Denis Isaev <idenx@yandex.com>
|
||||
@@ -701,10 +676,8 @@ Dhiru Kholia <dhiru.kholia@gmail.com>
|
||||
Dhruvdutt Jadhav <dhruvdutt.jadhav@gmail.com>
|
||||
Di Xiao <dixiao@google.com>
|
||||
Didier Spezia <didier.06@gmail.com>
|
||||
Diego Medina <fmpwizard@gmail.com>
|
||||
Diego Siqueira <diego9889@gmail.com>
|
||||
Dieter Plaetinck <dieter@raintank.io>
|
||||
Dilyn Corner <dilyn.corner@gmail.com>
|
||||
Dimitri Sokolyuk <sokolyuk@gmail.com>
|
||||
Dimitri Tcaciuc <dtcaciuc@gmail.com>
|
||||
Dina Garmash <dgrmsh@gmail.com>
|
||||
@@ -741,7 +714,6 @@ Doug Fawley <dfawley@google.com>
|
||||
Douglas Danger Manley <doug.manley@gmail.com>
|
||||
Drew Flower <drewvanstone@gmail.com>
|
||||
Drew Hintz <adhintz@google.com>
|
||||
Drew Richardson <drewrichardson@gmail.com>
|
||||
Duco van Amstel <duco.vanamstel@gmail.com>
|
||||
Duncan Holm <mail@frou.org>
|
||||
Dustin Carlino <dcarlino@google.com>
|
||||
@@ -763,7 +735,6 @@ Egon Elbre <egonelbre@gmail.com>
|
||||
Ehren Kret <ehren.kret@gmail.com>
|
||||
Eitan Adler <lists@eitanadler.com>
|
||||
Eivind Uggedal <eivind@uggedal.com>
|
||||
El Mostafa Idrassi <el.mostafa.idrassi@gmail.com>
|
||||
Elbert Fliek <efliek@gmail.com>
|
||||
Eldar Rakhimberdin <ibeono@gmail.com>
|
||||
Elena Grahovac <elena@grahovac.me>
|
||||
@@ -771,7 +742,6 @@ Eli Bendersky <eliben@google.com>
|
||||
Elias Naur <mail@eliasnaur.com> <elias.naur@gmail.com>
|
||||
Elliot Morrison-Reed <elliotmr@gmail.com>
|
||||
Ellison Leão <ellisonleao@gmail.com>
|
||||
Elvina Yakubova <elvinayakubova@gmail.com>
|
||||
Emerson Lin <linyintor@gmail.com>
|
||||
Emil Bektimirov <lefelys@gmail.com>
|
||||
Emil Hessman <emil@hessman.se>
|
||||
@@ -797,7 +767,6 @@ Eric Rescorla <ekr@rtfm.com>
|
||||
Eric Roshan-Eisner <eric.d.eisner@gmail.com>
|
||||
Eric Rutherford <erutherford@gmail.com>
|
||||
Eric Rykwalder <e.rykwalder@gmail.com>
|
||||
Eric Wang <wangchaogo1990@gmail.com>
|
||||
Erick Tryzelaar <etryzelaar@google.com>
|
||||
Erik Aigner <aigner.erik@gmail.com>
|
||||
Erik Dubbelboer <erik@dubbelboer.com>
|
||||
@@ -809,7 +778,6 @@ Ernest Chiang <ernest_chiang@htc.com>
|
||||
Erwin Oegema <blablaechthema@hotmail.com>
|
||||
Esko Luontola <esko.luontola@gmail.com>
|
||||
Ethan Burns <eaburns@google.com>
|
||||
Ethan Hur <ethan0311@gmail.com>
|
||||
Ethan Miller <eamiller@us.ibm.com>
|
||||
Euan Kemp <euank@euank.com>
|
||||
Eugene Formanenko <mo4islona@gmail.com>
|
||||
@@ -850,7 +818,6 @@ Felix Cornelius <9767036+fcornelius@users.noreply.github.com>
|
||||
Felix Geisendörfer <haimuiba@gmail.com>
|
||||
Felix Kollmann <fk@konsorten.de>
|
||||
Ferenc Szabo <frncmx@gmail.com>
|
||||
Fernandez Ludovic <lfernandez.dev@gmail.com>
|
||||
Filip Gruszczyński <gruszczy@gmail.com>
|
||||
Filip Haglund <drathier@users.noreply.github.com>
|
||||
Filip Stanis <fstanis@google.com>
|
||||
@@ -891,7 +858,6 @@ Gabriel Nelle <tehsphinx@web.de>
|
||||
Gabriel Nicolas Avellaneda <avellaneda.gabriel@gmail.com>
|
||||
Gabriel Rosenhouse <rosenhouse@gmail.com>
|
||||
Gabriel Russell <gabriel.russell@gmail.com>
|
||||
Gabriel Vasile <gabriel.vasile0793@gmail.com>
|
||||
Gareth Paul Jones <gpj@foursquare.com>
|
||||
Garret Kelly <gdk@google.com>
|
||||
Garrick Evans <garrick@google.com>
|
||||
@@ -925,8 +891,6 @@ Gianguido Sora` <g.sora4@gmail.com>
|
||||
Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
|
||||
Giles Lean <giles.lean@pobox.com>
|
||||
Giovanni Bajo <rasky@develer.com>
|
||||
GitHub User @180909 (70465953) <734461790@qq.com>
|
||||
GitHub User @6543 (24977596) <6543@obermui.de>
|
||||
GitHub User @aca (50316549) <acadx0@gmail.com>
|
||||
GitHub User @ajnirp (1688456) <ajnirp@users.noreply.github.com>
|
||||
GitHub User @ajz01 (4744634) <ajzdenek@gmail.com>
|
||||
@@ -940,12 +904,10 @@ GitHub User @bontequero (2674999) <bontequero@gmail.com>
|
||||
GitHub User @cch123 (384546) <buaa.cch@gmail.com>
|
||||
GitHub User @chainhelen (7046329) <chainhelen@gmail.com>
|
||||
GitHub User @chanxuehong (3416908) <chanxuehong@gmail.com>
|
||||
GitHub User @Cluas (10056928) <Cluas@live.cn>
|
||||
GitHub User @cncal (23520240) <flycalvin@qq.com>
|
||||
GitHub User @DQNEO (188741) <dqneoo@gmail.com>
|
||||
GitHub User @Dreamacro (8615343) <chuainian@gmail.com>
|
||||
GitHub User @dupoxy (1143957) <dupoxy@users.noreply.github.com>
|
||||
GitHub User @EndlessCheng (7086966) <loli.con@qq.com>
|
||||
GitHub User @erifan (31343225) <eric.fang@arm.com>
|
||||
GitHub User @esell (9735165) <eujon.sellers@gmail.com>
|
||||
GitHub User @fatedier (7346661) <fatedier@gmail.com>
|
||||
@@ -954,15 +916,12 @@ GitHub User @geedchin (11672310) <geedchin@gmail.com>
|
||||
GitHub User @GrigoriyMikhalkin (3637857) <grigoriymikhalkin@gmail.com>
|
||||
GitHub User @hengwu0 (41297446) <41297446+hengwu0@users.noreply.github.com>
|
||||
GitHub User @hitzhangjie (3725760) <hit.zhangjie@gmail.com>
|
||||
GitHub User @hqpko (13887251) <whaibin01@hotmail.com>
|
||||
GitHub User @itchyny (375258) <itchyny@hatena.ne.jp>
|
||||
GitHub User @jinmiaoluo (39730824) <jinmiaoluo@icloud.com>
|
||||
GitHub User @jopbrown (6345470) <msshane2008@gmail.com>
|
||||
GitHub User @kazyshr (30496953) <kazyshr0301@gmail.com>
|
||||
GitHub User @kc1212 (1093806) <kc1212@users.noreply.github.com>
|
||||
GitHub User @komisan19 (18901496) <komiyama6219@gmail.com>
|
||||
GitHub User @Kropekk (13366453) <kamilkropiewnicki@gmail.com>
|
||||
GitHub User @lhl2617 (33488131) <l.h.lee2617@gmail.com>
|
||||
GitHub User @linguohua (3434367) <lghchinaidea@gmail.com>
|
||||
GitHub User @LotusFenn (13775899) <fenn.lotus@gmail.com>
|
||||
GitHub User @ly303550688 (11519839) <yang.liu636@gmail.com>
|
||||
@@ -977,14 +936,10 @@ GitHub User @OlgaVlPetrova (44112727) <OVPpetrova@gmail.com>
|
||||
GitHub User @pityonline (438222) <pityonline@gmail.com>
|
||||
GitHub User @po3rin (29445112) <abctail30@gmail.com>
|
||||
GitHub User @pokutuna (57545) <popopopopokutuna@gmail.com>
|
||||
GitHub User @povsister (11040951) <pov@mahou-shoujo.moe>
|
||||
GitHub User @pytimer (17105586) <lixin20101023@gmail.com>
|
||||
GitHub User @qcrao (7698088) <qcrao91@gmail.com>
|
||||
GitHub User @ramenjuniti (32011829) <ramenjuniti@gmail.com>
|
||||
GitHub User @saitarunreddy (21041941) <saitarunreddypalla@gmail.com>
|
||||
GitHub User @SataQiu (9354727) <shidaqiu2018@gmail.com>
|
||||
GitHub User @shogo-ma (9860598) <Choroma194@gmail.com>
|
||||
GitHub User @sivchari (55221074) <shibuuuu5@gmail.com>
|
||||
GitHub User @skanehira (7888591) <sho19921005@gmail.com>
|
||||
GitHub User @soolaugust (10558124) <soolaugust@gmail.com>
|
||||
GitHub User @surechen (7249331) <surechen17@gmail.com>
|
||||
@@ -992,12 +947,9 @@ GitHub User @tatsumack (4510569) <tatsu.mack@gmail.com>
|
||||
GitHub User @tell-k (26263) <ffk2005@gmail.com>
|
||||
GitHub User @tennashi (10219626) <tennashio@gmail.com>
|
||||
GitHub User @uhei (2116845) <uhei@users.noreply.github.com>
|
||||
GitHub User @uji (49834542) <ujiprog@gmail.com>
|
||||
GitHub User @unbyte (5772358) <i@shangyes.net>
|
||||
GitHub User @uropek (39370426) <uropek@gmail.com>
|
||||
GitHub User @utkarsh-extc (53217283) <utkarsh.extc@gmail.com>
|
||||
GitHub User @witchard (4994659) <witchard@hotmail.co.uk>
|
||||
GitHub User @wolf1996 (5901874) <ksgiv37@gmail.com>
|
||||
GitHub User @yah01 (12216890) <kagaminehuan@gmail.com>
|
||||
GitHub User @yuanhh (1298735) <yuan415030@gmail.com>
|
||||
GitHub User @zikaeroh (48577114) <zikaeroh@gmail.com>
|
||||
@@ -1010,7 +962,6 @@ Glenn Brown <glennb@google.com>
|
||||
Glenn Lewis <gmlewis@google.com>
|
||||
Gordon Klaus <gordon.klaus@gmail.com>
|
||||
Gordon Tyler <gordon@doxxx.net>
|
||||
Grace Han <hgrace503@gmail.com>
|
||||
Graham King <graham4king@gmail.com>
|
||||
Graham Miller <graham.miller@gmail.com>
|
||||
Grant Griffiths <ggp493@gmail.com>
|
||||
@@ -1026,12 +977,10 @@ Guilherme Caruso <gui.martinscaruso@gmail.com>
|
||||
Guilherme Garnier <guilherme.garnier@gmail.com>
|
||||
Guilherme Goncalves <guilhermeaugustosg@gmail.com>
|
||||
Guilherme Rezende <guilhermebr@gmail.com>
|
||||
Guilherme Souza <32180229+gqgs@users.noreply.github.com>
|
||||
Guillaume J. Charmes <guillaume@charmes.net>
|
||||
Guillaume Sottas <guillaumesottas@gmail.com>
|
||||
Günther Noack <gnoack@google.com>
|
||||
Guobiao Mei <meiguobiao@gmail.com>
|
||||
Guodong Li <guodongli@google.com>
|
||||
Guoliang Wang <iamwgliang@gmail.com>
|
||||
Gustav Paul <gustav.paul@gmail.com>
|
||||
Gustav Westling <gustav@westling.xyz>
|
||||
@@ -1046,7 +995,6 @@ HAMANO Tsukasa <hamano@osstech.co.jp>
|
||||
Han-Wen Nienhuys <hanwen@google.com>
|
||||
Hang Qian <hangqian90@gmail.com>
|
||||
Hanjun Kim <hallazzang@gmail.com>
|
||||
Hanlin He <hanling.he@gmail.com>
|
||||
Hanlin Shi <shihanlin9@gmail.com>
|
||||
Haoran Luo <haoran.luo@chaitin.com>
|
||||
Haosdent Huang <haosdent@gmail.com>
|
||||
@@ -1078,19 +1026,18 @@ Herbie Ong <herbie@google.com>
|
||||
Heschi Kreinick <heschi@google.com>
|
||||
Hidetatsu Yaginuma <ygnmhdtt@gmail.com>
|
||||
Hilko Bengen <bengen@hilluzination.de>
|
||||
Himanshu Kishna Srivastava <28himanshu@gmail.com>
|
||||
Hiroaki Nakamura <hnakamur@gmail.com>
|
||||
Hiromichi Ema <ema.hiro@gmail.com>
|
||||
Hironao OTSUBO <motemen@gmail.com>
|
||||
Hiroshi Ioka <hirochachacha@gmail.com>
|
||||
Hitoshi Mitake <mitake.hitoshi@gmail.com>
|
||||
Holden Huang <ttyh061@gmail.com>
|
||||
Songlin Jiang <hollowman@hollowman.ml>
|
||||
Hong Ruiqi <hongruiqi@gmail.com>
|
||||
Hongfei Tan <feilengcui008@gmail.com>
|
||||
Horacio Duran <horacio.duran@gmail.com>
|
||||
Horst Rutter <hhrutter@gmail.com>
|
||||
Hossein Sheikh Attar <hattar@google.com>
|
||||
Hossein Zolfi <hossein.zolfi@gmail.com>
|
||||
Howard Zhang <howard.zhang@arm.com>
|
||||
Hsin Tsao <tsao@google.com>
|
||||
Hsin-Ho Yeh <yhh92u@gmail.com>
|
||||
@@ -1107,14 +1054,11 @@ Ian Haken <ihaken@netflix.com>
|
||||
Ian Kent <iankent85@gmail.com>
|
||||
Ian Lance Taylor <iant@golang.org>
|
||||
Ian Leue <ian@appboy.com>
|
||||
Ian Mckay <iann0036@gmail.com>
|
||||
Ian Tay <iantay@google.com>
|
||||
Ian Woolf <btw515wolf2@gmail.com>
|
||||
Ian Zapolsky <ianzapolsky@gmail.com>
|
||||
Ibrahim AshShohail <ibra.sho@gmail.com>
|
||||
Icarus Sparry <golang@icarus.freeuk.com>
|
||||
Iccha Sethi <icchasethi@gmail.com>
|
||||
Ichinose Shogo <shogo82148@gmail.com>
|
||||
Idora Shinatose <idora.shinatose@gmail.com>
|
||||
Ignacio Hagopian <jsign.uy@gmail.com>
|
||||
Igor Bernstein <igorbernstein@google.com>
|
||||
@@ -1124,7 +1068,6 @@ Igor Vashyst <ivashyst@gmail.com>
|
||||
Igor Zhilianin <igor.zhilianin@gmail.com>
|
||||
Ikko Ashimine <eltociear@gmail.com>
|
||||
Illya Yalovyy <yalovoy@gmail.com>
|
||||
Ilya Chukov <56119080+Elias506@users.noreply.github.com>
|
||||
Ilya Sinelnikov <sidhmangh@gmail.com>
|
||||
Ilya Tocar <ilya.tocar@intel.com>
|
||||
INADA Naoki <songofacandy@gmail.com>
|
||||
@@ -1179,7 +1122,6 @@ James Cowgill <James.Cowgill@imgtec.com>
|
||||
James Craig Burley <james-github@burleyarch.com>
|
||||
James David Chalfant <james.chalfant@gmail.com>
|
||||
James Eady <jmeady@google.com>
|
||||
James Fennell <jpfennell@google.com>
|
||||
James Fysh <james.fysh@gmail.com>
|
||||
James Gray <james@james4k.com>
|
||||
James Hartig <fastest963@gmail.com>
|
||||
@@ -1236,7 +1178,6 @@ Jason Wangsadinata <jwangsadinata@gmail.com>
|
||||
Javier Kohen <jkohen@google.com>
|
||||
Javier Revillas <jrevillas@massivedynamic.io>
|
||||
Javier Segura <javism@gmail.com>
|
||||
Jay Chen <chenjie@chenjie.info>
|
||||
Jay Conrod <jayconrod@google.com>
|
||||
Jay Lee <BusyJayLee@gmail.com>
|
||||
Jay Taylor <outtatime@gmail.com>
|
||||
@@ -1259,7 +1200,6 @@ Jeff Johnson <jrjohnson@google.com>
|
||||
Jeff R. Allen <jra@nella.org> <jeff.allen@gmail.com>
|
||||
Jeff Sickel <jas@corpus-callosum.com>
|
||||
Jeff Wendling <jeff@spacemonkey.com>
|
||||
Jeff Widman <jeff@jeffwidman.com>
|
||||
Jeffrey H <jeffreyh192@gmail.com>
|
||||
Jelte Fennema <github-tech@jeltef.nl>
|
||||
Jens Frederich <jfrederich@gmail.com>
|
||||
@@ -1270,7 +1210,6 @@ Jeremy Faller <jeremy@golang.org>
|
||||
Jeremy Jackins <jeremyjackins@gmail.com>
|
||||
Jeremy Jay <jeremy@pbnjay.com>
|
||||
Jeremy Schlatter <jeremy.schlatter@gmail.com>
|
||||
Jero Bado <tokidokitalkyou@gmail.com>
|
||||
Jeroen Bobbeldijk <jerbob92@gmail.com>
|
||||
Jeroen Simonetti <jeroen@simonetti.nl>
|
||||
Jérôme Doucet <jerdct@gmail.com>
|
||||
@@ -1312,8 +1251,6 @@ Joe Richey <joerichey@google.com>
|
||||
Joe Shaw <joe@joeshaw.org>
|
||||
Joe Sylve <joe.sylve@gmail.com>
|
||||
Joe Tsai <joetsai@digital-static.net>
|
||||
Joel Courtney <euphemize@gmail.com>
|
||||
Joel Ferrier <joelferrier@google.com>
|
||||
Joel Sing <joel@sing.id.au> <jsing@google.com>
|
||||
Joël Stemmer <jstemmer@google.com>
|
||||
Joel Stemmer <stemmertech@gmail.com>
|
||||
@@ -1323,9 +1260,7 @@ Johan Euphrosine <proppy@google.com>
|
||||
Johan Jansson <johan.jansson@iki.fi>
|
||||
Johan Knutzen <johan@senri.se>
|
||||
Johan Sageryd <j@1616.se>
|
||||
Johannes Huning <johannes.huning@gmail.com>
|
||||
John Asmuth <jasmuth@gmail.com>
|
||||
John Bampton <jbampton@gmail.com>
|
||||
John Beisley <huin@google.com>
|
||||
John C Barstow <jbowtie@amathaine.com>
|
||||
John DeNero <denero@google.com>
|
||||
@@ -1334,7 +1269,6 @@ John Gibb <johngibb@gmail.com>
|
||||
John Gilik <john@jgilik.com>
|
||||
John Graham-Cumming <jgc@jgc.org> <jgrahamc@gmail.com>
|
||||
John Howard Palevich <jack.palevich@gmail.com>
|
||||
John Jago <johnjago@protonmail.com>
|
||||
John Jeffery <jjeffery@sp.com.au>
|
||||
John Jenkins <twodopeshaggy@gmail.com>
|
||||
John Leidegren <john.leidegren@gmail.com>
|
||||
@@ -1386,7 +1320,6 @@ Josa Gesell <josa@gesell.me>
|
||||
Jose Luis Vázquez González <josvazg@gmail.com>
|
||||
Joseph Bonneau <jcb@google.com>
|
||||
Joseph Holsten <joseph@josephholsten.com>
|
||||
Joseph Morag <sefim96@gmail.com>
|
||||
Josh Baum <joshbaum@google.com>
|
||||
Josh Bleecher Snyder <josharian@gmail.com>
|
||||
Josh Chorlton <jchorlton@gmail.com>
|
||||
@@ -1394,14 +1327,12 @@ Josh Deprez <josh.deprez@gmail.com>
|
||||
Josh Goebel <dreamer3@gmail.com>
|
||||
Josh Hoak <jhoak@google.com>
|
||||
Josh Holland <jrh@joshh.co.uk>
|
||||
Josh Rickmar <jrick@companyzero.com>
|
||||
Josh Roppo <joshroppo@gmail.com>
|
||||
Josh Varga <josh.varga@gmail.com>
|
||||
Joshua Bezaleel Abednego <joshua.bezaleel@gmail.com>
|
||||
Joshua Boelter <joshua.boelter@intel.com>
|
||||
Joshua Chase <jcjoshuachase@gmail.com>
|
||||
Joshua Crowgey <jcrowgey@uw.edu>
|
||||
Joshua Harshman <joshgreyhat@gmail.com>
|
||||
Joshua M. Clulow <josh.clulow@joyent.com>
|
||||
Joshua Rubin <joshua@rubixconsulting.com>
|
||||
Josselin Costanzi <josselin@costanzi.fr>
|
||||
@@ -1422,7 +1353,6 @@ Julie Qiu <julie@golang.org>
|
||||
Julien Kauffmann <julien.kauffmann@freelan.org>
|
||||
Julien Salleyron <julien.salleyron@gmail.com>
|
||||
Julien Schmidt <google@julienschmidt.com>
|
||||
Julien Tant <julien@craftyx.fr>
|
||||
Julio Montes <julio.montes@intel.com>
|
||||
Jun Zhang <jim.zoumo@gmail.com>
|
||||
Junchen Li <junchen.li@arm.com>
|
||||
@@ -1489,12 +1419,10 @@ Kenta Mori <zoncoen@gmail.com>
|
||||
Kerollos Magdy <kerolloz@yahoo.com>
|
||||
Ketan Parmar <ketanbparmar@gmail.com>
|
||||
Kevan Swanberg <kevswanberg@gmail.com>
|
||||
Kevin Albertson <kevin.albertson@mongodb.com>
|
||||
Kevin Ballard <kevin@sb.org>
|
||||
Kevin Burke <kev@inburke.com>
|
||||
Kévin Dunglas <dunglas@gmail.com>
|
||||
Kevin Gillette <extemporalgenome@gmail.com>
|
||||
Kevin Herro <kevin109104@gmail.com>
|
||||
Kevin Kirsche <kev.kirsche@gmail.com>
|
||||
Kevin Klues <klueska@gmail.com> <klueska@google.com>
|
||||
Kevin Malachowski <chowski@google.com>
|
||||
@@ -1529,7 +1457,6 @@ Koya IWAMURA <kiwamura0314@gmail.com>
|
||||
Kris Kwiatkowski <kris@cloudflare.com>
|
||||
Kris Nova <kris@nivenly.com>
|
||||
Kris Rousey <krousey@google.com>
|
||||
Krishna Birla <krishnabirla16@gmail.com>
|
||||
Kristopher Watts <traetox@gmail.com>
|
||||
Krzysztof Dąbrowski <krzysdabro@live.com>
|
||||
Kshitij Saraogi <kshitijsaraogi@gmail.com>
|
||||
@@ -1553,7 +1480,6 @@ Lajos Papp <lalyos@yahoo.com>
|
||||
Lakshay Garg <lakshay.garg.1996@gmail.com>
|
||||
Lann Martin <lannm@google.com>
|
||||
Lanre Adelowo <yo@lanre.wtf>
|
||||
Lapo Luchini <lapo@lapo.it>
|
||||
Larry Clapp <larry@theclapp.org>
|
||||
Larry Hosken <lahosken@golang.org>
|
||||
Lars Jeppesen <jeppesen.lars@gmail.com>
|
||||
@@ -1570,7 +1496,6 @@ Leigh McCulloch <leighmcc@gmail.com>
|
||||
Leo Antunes <leo@costela.net>
|
||||
Leo Rudberg <ljr@google.com>
|
||||
Leon Klingele <git@leonklingele.de>
|
||||
Leonard Wang <wangdeyu0907@gmail.com>
|
||||
Leonardo Comelli <leonardo.comelli@gmail.com>
|
||||
Leonel Quinteros <leonel.quinteros@gmail.com>
|
||||
Lev Shamardin <shamardin@gmail.com>
|
||||
@@ -1581,9 +1506,7 @@ Lily Chung <lilithkchung@gmail.com>
|
||||
Lingchao Xin <douglarek@gmail.com>
|
||||
Lion Yang <lion@aosc.xyz>
|
||||
Liz Rice <liz@lizrice.com>
|
||||
Lize Cai <lizzzcai1@gmail.com>
|
||||
Lloyd Dewolf <foolswisdom@gmail.com>
|
||||
Lluís Batlle i Rossell <viric@viric.name>
|
||||
Lorenz Bauer <lmb@cloudflare.com>
|
||||
Lorenz Brun <lorenz@brun.one>
|
||||
Lorenz Nickel <mail@lorenznickel.de>
|
||||
@@ -1608,7 +1531,6 @@ Lukasz Milewski <lmmilewski@gmail.com>
|
||||
Luke Champine <luke.champine@gmail.com>
|
||||
Luke Curley <qpingu@gmail.com>
|
||||
Luke Granger-Brown <git@lukegb.com>
|
||||
Luke Shumaker <lukeshu@datawire.io>
|
||||
Luke Young <bored-engineer@users.noreply.github.com>
|
||||
Luna Duclos <luna.duclos@palmstonegames.com>
|
||||
Luuk van Dijk <lvd@golang.org> <lvd@google.com>
|
||||
@@ -1628,7 +1550,6 @@ Mal Curtis <mal@mal.co.nz>
|
||||
Manfred Touron <m@42.am>
|
||||
Manigandan Dharmalingam <manigandan.jeff@gmail.com>
|
||||
Manish Goregaokar <manishsmail@gmail.com>
|
||||
Manlio Perillo <manlio.perillo@gmail.com>
|
||||
Manoj Dayaram <platform-dev@moovweb.com> <manoj.dayaram@moovweb.com>
|
||||
Mansour Rahimi <rahimi.mnr@gmail.com>
|
||||
Manu Garg <manugarg@google.com>
|
||||
@@ -1725,8 +1646,6 @@ Matt Joiner <anacrolix@gmail.com>
|
||||
Matt Jones <mrjones@google.com>
|
||||
Matt Juran <thepciet@gmail.com>
|
||||
Matt Layher <mdlayher@gmail.com>
|
||||
Matt Masurka <masurka@google.com>
|
||||
Matt Pearring <broskies@google.com>
|
||||
Matt Reiferson <mreiferson@gmail.com>
|
||||
Matt Robenolt <matt@ydekproductions.com>
|
||||
Matt Strong <mstrong1341@gmail.com>
|
||||
@@ -1740,12 +1659,9 @@ Matthew Denton <mdenton@skyportsystems.com>
|
||||
Matthew Holt <Matthew.Holt+git@gmail.com>
|
||||
Matthew Horsnell <matthew.horsnell@gmail.com>
|
||||
Matthew Waters <mwwaters@gmail.com>
|
||||
Matthias Frei <matthias.frei@inf.ethz.ch>
|
||||
Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
|
||||
Matthieu Olivier <olivier.matthieu@gmail.com>
|
||||
Matthijs Kooijman <matthijs@stdin.nl>
|
||||
Mattias Appelgren <mattias@ppelgren.se>
|
||||
Mauricio Alvarado <mauricio.alvarado@leftfieldlabs.com>
|
||||
Max Drosdo.www <g1ran1q@gmail.com>
|
||||
Max Riveiro <kavu13@gmail.com>
|
||||
Max Schmitt <max@schmitt.mx>
|
||||
@@ -1761,11 +1677,9 @@ Máximo Cuadros Ortiz <mcuadros@gmail.com>
|
||||
Maxwell Krohn <themax@gmail.com>
|
||||
Maya Rashish <maya@NetBSD.org>
|
||||
Mayank Kumar <krmayankk@gmail.com>
|
||||
Mehrad Sadeghi <2012.linkinpark@gmail.com>
|
||||
Meir Fischer <meirfischer@gmail.com>
|
||||
Meng Zhuo <mengzhuo1203@gmail.com> <mzh@golangcn.org>
|
||||
Mhd Sulhan <m.shulhan@gmail.com>
|
||||
Mia Zhu <CrystalZhu1025getu@gmail.com>
|
||||
Micah Stetson <micah.stetson@gmail.com>
|
||||
Michael Anthony Knyszek <mknyszek@google.com>
|
||||
Michael Brandenburg <mbrandenburg@bolste.com>
|
||||
@@ -1816,10 +1730,8 @@ Michal Franc <lam.michal.franc@gmail.com>
|
||||
Michał Łowicki <mlowicki@gmail.com>
|
||||
Michal Pristas <michal.pristas@gmail.com>
|
||||
Michal Rostecki <mrostecki@suse.de>
|
||||
Michal Stokluska <mstoklus@redhat.com>
|
||||
Michalis Kargakis <michaliskargakis@gmail.com>
|
||||
Michel Lespinasse <walken@google.com>
|
||||
Michel Levieux <mlevieux42@gmail.com>
|
||||
Michele Di Pede <michele.di.pede@gmail.com>
|
||||
Mickael Kerjean <mickael.kerjean@gmail.com>
|
||||
Mickey Reiss <mickeyreiss@gmail.com>
|
||||
@@ -1878,9 +1790,7 @@ Muir Manders <muir@mnd.rs>
|
||||
Mukesh Sharma <sharma.mukesh439@gmail.com>
|
||||
Mura Li <mura_li@castech.com.tw>
|
||||
Mykhailo Lesyk <mikhail@lesyk.org>
|
||||
Nahum Shalman <nahamu@gmail.com>
|
||||
Naman Aggarwal <aggarwal.nam@gmail.com>
|
||||
Naman Gera <namangera15@gmail.com>
|
||||
Nan Deng <monnand@gmail.com>
|
||||
Nao Yonashiro <owan.orisano@gmail.com>
|
||||
Naoki Kanatani <k12naoki@gmail.com>
|
||||
@@ -1908,7 +1818,6 @@ Neven Sajko <nsajko@gmail.com>
|
||||
Nevins Bartolomeo <nevins.bartolomeo@gmail.com>
|
||||
Niall Sheridan <nsheridan@gmail.com>
|
||||
Nic Day <nic.day@me.com>
|
||||
Nicholas Asimov <nicholas@asimov.me>
|
||||
Nicholas Katsaros <nick@nickkatsaros.com>
|
||||
Nicholas Maniscalco <nicholas@maniscalco.com>
|
||||
Nicholas Ng <nickng@nickng.io>
|
||||
@@ -1938,7 +1847,6 @@ Nik Nyby <nnyby@columbia.edu>
|
||||
Nikhil Benesch <nikhil.benesch@gmail.com>
|
||||
Nikita Gillmann <nikita@n0.is> <ng0@n0.is>
|
||||
Nikita Kryuchkov <nkryuchkov10@gmail.com>
|
||||
Nikita Melekhin <nimelehin@gmail.com>
|
||||
Nikita Vanyasin <nikita.vanyasin@gmail.com>
|
||||
Niklas Schnelle <niklas.schnelle@gmail.com>
|
||||
Niko Dziemba <niko@dziemba.com>
|
||||
@@ -1950,7 +1858,6 @@ Niranjan Godbole <niranjan8192@gmail.com>
|
||||
Nishanth Shanmugham <nishanth.gerrard@gmail.com>
|
||||
Noah Campbell <noahcampbell@gmail.com>
|
||||
Noah Goldman <noahg34@gmail.com>
|
||||
Noah Santschi-Cooney <noah@santschi-cooney.ch>
|
||||
Noble Johnson <noblepoly@gmail.com>
|
||||
Nodir Turakulov <nodir@google.com>
|
||||
Noel Georgi <git@frezbo.com>
|
||||
@@ -1987,7 +1894,6 @@ Pablo Rozas Larraondo <pablo.larraondo@anu.edu.au>
|
||||
Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
|
||||
Padraig Kitterick <padraigkitterick@gmail.com>
|
||||
Pallat Anchaleechamaikorn <yod.pallat@gmail.com>
|
||||
Pan Chenglong <1004907659@qq.com>
|
||||
Panos Georgiadis <pgeorgiadis@suse.de>
|
||||
Pantelis Sampaziotis <psampaz@gmail.com>
|
||||
Paolo Giarrusso <p.giarrusso@gmail.com>
|
||||
@@ -2041,7 +1947,6 @@ Paulo Casaretto <pcasaretto@gmail.com>
|
||||
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
|
||||
Paulo Gomes <paulo.gomes.uk@gmail.com>
|
||||
Pavel Paulau <pavel.paulau@gmail.com>
|
||||
Pavel Watson <watsonpavel@gmail.com>
|
||||
Pavel Zinovkin <pavel.zinovkin@gmail.com>
|
||||
Pavlo Sumkin <ymkins@gmail.com>
|
||||
Pawel Knap <pawelknap88@gmail.com>
|
||||
@@ -2049,8 +1954,6 @@ Pawel Szczur <filemon@google.com>
|
||||
Paweł Szulik <pawel.szulik@intel.com>
|
||||
Pei Xian Chee <luciolas1991@gmail.com>
|
||||
Pei-Ming Wu <p408865@gmail.com>
|
||||
Pen Tree <appletree2479@outlook.com>
|
||||
Peng Gao <peng.gao.dut@gmail.com>
|
||||
Percy Wegmann <ox.to.a.cart@gmail.com>
|
||||
Perry Abbott <perry.j.abbott@gmail.com>
|
||||
Petar Dambovaliev <petar.atanasov.1987@gmail.com>
|
||||
@@ -2089,7 +1992,6 @@ Philip Brown <phil@bolthole.com>
|
||||
Philip Hofer <phofer@umich.edu>
|
||||
Philip K. Warren <pkwarren@gmail.com>
|
||||
Philip Nelson <me@pnelson.ca>
|
||||
Philipp Sauter <sauterp@protonmail.com>
|
||||
Philipp Stephani <phst@google.com>
|
||||
Phillip Campbell <15082+phillc@users.noreply.github.com>
|
||||
Pierre Carru <pierre.carru@eshard.com>
|
||||
@@ -2105,7 +2007,6 @@ Poh Zi How <poh.zihow@gmail.com>
|
||||
Polina Osadcha <polliosa@google.com>
|
||||
Pontus Leitzler <leitzler@gmail.com>
|
||||
Povilas Versockas <p.versockas@gmail.com>
|
||||
Prajwal Koirala <16564273+Prajwal-Koirala@users.noreply.github.com>
|
||||
Prasanga Siripala <pj@pjebs.com.au>
|
||||
Prasanna Swaminathan <prasanna@mediamath.com>
|
||||
Prashant Agrawal <prashant.a.vjti@gmail.com>
|
||||
@@ -2126,13 +2027,11 @@ Quim Muntal <quimmuntal@gmail.com>
|
||||
Quinn Slack <sqs@sourcegraph.com>
|
||||
Quinten Yearsley <qyearsley@chromium.org>
|
||||
Quoc-Viet Nguyen <afelion@gmail.com>
|
||||
Rabin Gaire <rabingaire20@gmail.com>
|
||||
Radek Simko <radek.simko@gmail.com>
|
||||
Radek Sohlich <sohlich@gmail.com>
|
||||
Radu Berinde <radu@cockroachlabs.com>
|
||||
Rafal Jeczalik <rjeczalik@gmail.com>
|
||||
Raghavendra Nagaraj <jamdagni86@gmail.com>
|
||||
Rahul Bajaj <rahulrb0509@gmail.com>
|
||||
Rahul Chaudhry <rahulchaudhry@chromium.org>
|
||||
Rahul Wadhwani <rahulwadhwani21@gmail.com>
|
||||
Raif S. Naffah <go@naffah-raif.name>
|
||||
@@ -2142,14 +2041,12 @@ Rajender Reddy Kompally <rajenderreddykompally@gmail.com>
|
||||
Ralph Corderoy <ralph@inputplus.co.uk>
|
||||
Ramazan AYYILDIZ <rayyildiz@gmail.com>
|
||||
Ramesh Dharan <dharan@google.com>
|
||||
Randy Reddig <randy@alta.software>
|
||||
Raph Levien <raph@google.com>
|
||||
Raphael Geronimi <raphael.geronimi@gmail.com>
|
||||
Raul Silvera <rsilvera@google.com>
|
||||
Ravil Bikbulatov <weeellz12@gmail.com>
|
||||
RaviTeja Pothana <ravi.tezu@gmail.com>
|
||||
Ray Tung <rtung@thoughtworks.com>
|
||||
Ray Wu <ray@liftoff.io>
|
||||
Raymond Kazlauskas <raima220@gmail.com>
|
||||
Rebecca Stambler <rstambler@golang.org>
|
||||
Reilly Watson <reillywatson@gmail.com>
|
||||
@@ -2169,7 +2066,6 @@ Richard Eric Gavaletz <gavaletz@gmail.com>
|
||||
Richard Gibson <richard.gibson@gmail.com>
|
||||
Richard Miller <miller.research@gmail.com>
|
||||
Richard Musiol <mail@richard-musiol.de> <neelance@gmail.com>
|
||||
Richard Pickering <richard.pickering@hotmail.co.uk>
|
||||
Richard Ulmer <codesoap@mailbox.org>
|
||||
Richard Wilkes <wilkes@me.com>
|
||||
Rick Arnold <rickarnoldjr@gmail.com>
|
||||
@@ -2228,7 +2124,6 @@ Rowan Worth <sqweek@gmail.com>
|
||||
Rudi Kramer <rudi.kramer@gmail.com>
|
||||
Rui Ueyama <ruiu@google.com>
|
||||
Ruixin Bao <ruixin.bao@ibm.com>
|
||||
Ruslan Andreev <ruslan.andreev@huawei.com>
|
||||
Ruslan Nigmatullin <elessar@dropbox.com>
|
||||
Russ Cox <rsc@golang.org>
|
||||
Russell Haering <russellhaering@gmail.com>
|
||||
@@ -2246,7 +2141,6 @@ Ryan Seys <ryan@ryanseys.com>
|
||||
Ryan Slade <ryanslade@gmail.com>
|
||||
Ryan Zhang <ryan.zhang@docker.com>
|
||||
Ryoichi KATO <ryo1kato@gmail.com>
|
||||
Ryoya Sekino <ryoyasekino1993@gmail.com>
|
||||
Ryuji Iwata <qt.luigi@gmail.com>
|
||||
Ryuma Yoshida <ryuma.y1117@gmail.com>
|
||||
Ryuzo Yamamoto <ryuzo.yamamoto@gmail.com>
|
||||
@@ -2282,10 +2176,8 @@ Sardorbek Pulatov <sardorbek.pulatov@outlook.com>
|
||||
Sascha Brawer <sascha@brawer.ch>
|
||||
Sasha Lionheart <lionhearts@google.com>
|
||||
Sasha Sobol <sasha@scaledinference.com>
|
||||
Satoru Kitaguchi <rule.the.fate.myfirststory@gmail.com>
|
||||
Scott Barron <scott.barron@github.com>
|
||||
Scott Bell <scott@sctsm.com>
|
||||
Scott Cotton <scott@mindowl.com>
|
||||
Scott Crunkleton <crunk1@gmail.com>
|
||||
Scott Ferguson <scottwferg@gmail.com>
|
||||
Scott Lawrence <bytbox@gmail.com>
|
||||
@@ -2299,7 +2191,6 @@ Sean Chittenden <seanc@joyent.com>
|
||||
Sean Christopherson <sean.j.christopherson@intel.com>
|
||||
Sean Dolphin <Sean.Dolphin@kpcompass.com>
|
||||
Sean Harger <sharger@google.com>
|
||||
Sean Harrington <sean.harrington@leftfieldlabs.com>
|
||||
Sean Hildebrand <seanwhildebrand@gmail.com>
|
||||
Sean Liao <seankhliao@gmail.com>
|
||||
Sean Rees <sean@erifax.org>
|
||||
@@ -2321,7 +2212,6 @@ Sergey Dobrodey <sergey.dobrodey@synesis.ru>
|
||||
Sergey Frolov <sfrolov@google.com>
|
||||
Sergey Glushchenko <gsserge@gmail.com>
|
||||
Sergey Ivanov <ser1325@gmail.com>
|
||||
Sergey Kacheev <S.Kacheev@gmail.com>
|
||||
Sergey Lukjanov <me@slukjanov.name>
|
||||
Sergey Mishin <sergeymishine@gmail.com>
|
||||
Sergey Mudrik <sergey.mudrik@gmail.com>
|
||||
@@ -2333,7 +2223,6 @@ Serhat Giydiren <serhatgiydiren@gmail.com>
|
||||
Serhii Aheienko <serhii.aheienko@gmail.com>
|
||||
Seth Hoenig <seth.a.hoenig@gmail.com>
|
||||
Seth Vargo <sethvargo@gmail.com>
|
||||
Shaba Abhiram <shabarivas.abhiram@gmail.com>
|
||||
Shahar Kohanim <skohanim@gmail.com>
|
||||
Shailesh Suryawanshi <ss.shailesh28@gmail.com>
|
||||
Shamil Garatuev <garatuev@gmail.com>
|
||||
@@ -2361,13 +2250,9 @@ Shivakumar GN <shivakumar.gn@gmail.com>
|
||||
Shivani Singhal <shivani.singhal2804@gmail.com>
|
||||
Shivansh Rai <shivansh@freebsd.org>
|
||||
Shivashis Padhi <shivashispadhi@gmail.com>
|
||||
Shoshin Nikita <shoshin_nikita@fastmail.com>
|
||||
Shota Sugiura <s.shota.710.3506@gmail.com>
|
||||
Shubham Sharma <shubham.sha12@gmail.com>
|
||||
Shuhei Takahashi <nya@chromium.org>
|
||||
Shun Fan <sfan@google.com>
|
||||
Silvan Jegen <s.jegen@gmail.com>
|
||||
Simão Gomes Viana <simaogmv@gmail.com>
|
||||
Simarpreet Singh <simar@linux.com>
|
||||
Simon Drake <simondrake1990@gmail.com>
|
||||
Simon Ferquel <simon.ferquel@docker.com>
|
||||
@@ -2382,16 +2267,13 @@ Sina Siadat <siadat@gmail.com>
|
||||
Sjoerd Siebinga <sjoerd.siebinga@gmail.com>
|
||||
Sokolov Yura <funny.falcon@gmail.com>
|
||||
Song Gao <song@gao.io>
|
||||
Song Lim <songlim327@gmail.com>
|
||||
Songjiayang <songjiayang1@gmail.com>
|
||||
Songlin Jiang <hollowman@hollowman.ml>
|
||||
Soojin Nam <jsunam@gmail.com>
|
||||
Søren L. Hansen <soren@linux2go.dk>
|
||||
Sparrow Li <liyuancylx@gmail.com>
|
||||
Spencer Kocot <spencerkocot@gmail.com>
|
||||
Spencer Nelson <s@spenczar.com>
|
||||
Spencer Tung <spencertung@google.com>
|
||||
Spenser Black <spenserblack01@gmail.com>
|
||||
Spring Mc <heresy.mc@gmail.com>
|
||||
Srdjan Petrovic <spetrovic@google.com>
|
||||
Sridhar Venkatakrishnan <sridhar@laddoo.net>
|
||||
@@ -2442,7 +2324,6 @@ Suyash <dextrous93@gmail.com>
|
||||
Suzy Mueller <suzmue@golang.org>
|
||||
Sven Almgren <sven@tras.se>
|
||||
Sven Blumenstein <svbl@google.com>
|
||||
Sven Lee <lee1300394324@gmail.com>
|
||||
Sven Taute <sven.taute@gmail.com>
|
||||
Sylvain Zimmer <sylvain@sylvainzimmer.com>
|
||||
Syohei YOSHIDA <syohex@gmail.com>
|
||||
@@ -2525,14 +2406,12 @@ Tiwei Bie <tiwei.btw@antgroup.com>
|
||||
Tobias Assarsson <tobias.assarsson@gmail.com>
|
||||
Tobias Columbus <tobias.columbus@gmail.com> <tobias.columbus@googlemail.com>
|
||||
Tobias Klauser <tklauser@distanz.ch>
|
||||
Tobias Kohlbau <tobias@kohlbau.de>
|
||||
Toby Burress <kurin@google.com>
|
||||
Todd Kulesza <tkulesza@google.com>
|
||||
Todd Neal <todd@tneal.org>
|
||||
Todd Wang <toddwang@gmail.com>
|
||||
Tom Anthony <git@tomanthony.co.uk>
|
||||
Tom Bergan <tombergan@google.com>
|
||||
Tom Freudenberg <tom.freudenberg@4commerce.de>
|
||||
Tom Heng <zhm20070928@gmail.com>
|
||||
Tom Lanyon <tomlanyon@google.com>
|
||||
Tom Levy <tomlevy93@gmail.com>
|
||||
@@ -2561,7 +2440,6 @@ Toshiki Shima <hayabusa1419@gmail.com>
|
||||
Totoro W <tw19881113@gmail.com>
|
||||
Travis Bischel <travis.bischel@gmail.com>
|
||||
Travis Cline <travis.cline@gmail.com>
|
||||
Trevor Dixon <trevordixon@gmail.com>
|
||||
Trevor Strohman <trevor.strohman@gmail.com>
|
||||
Trey Lawrence <lawrence.trey@gmail.com>
|
||||
Trey Roessig <trey.roessig@gmail.com>
|
||||
@@ -2585,7 +2463,6 @@ Tzach Shabtay <tzachshabtay@gmail.com>
|
||||
Tzu-Chiao Yeh <su3g4284zo6y7@gmail.com>
|
||||
Tzu-Jung Lee <roylee17@currant.com>
|
||||
Udalov Max <re.udalov@gmail.com>
|
||||
Uddeshya Singh <singhuddeshyaofficial@gmail.com>
|
||||
Ugorji Nwoke <ugorji@gmail.com>
|
||||
Ulf Holm Nielsen <doktor@dyregod.dk>
|
||||
Ulrich Kunitz <uli.kunitz@gmail.com>
|
||||
@@ -2598,7 +2475,6 @@ Vadim Grek <vadimprog@gmail.com>
|
||||
Vadim Vygonets <unixdj@gmail.com>
|
||||
Val Polouchkine <vpolouch@justin.tv>
|
||||
Valentin Vidic <vvidic@valentin-vidic.from.hr>
|
||||
Vaughn Iverson <vsivsi@yahoo.com>
|
||||
Vee Zhang <veezhang@126.com> <vveezhang@gmail.com>
|
||||
Vega Garcia Luis Alfonso <vegacom@gmail.com>
|
||||
Venil Noronha <veniln@vmware.com>
|
||||
@@ -2615,7 +2491,6 @@ Vincent Batts <vbatts@hashbangbash.com> <vbatts@gmail.com>
|
||||
Vincent Vanackere <vincent.vanackere@gmail.com>
|
||||
Vinu Rajashekhar <vinutheraj@gmail.com>
|
||||
Vish Subramanian <vish@google.com>
|
||||
Vishal Dalwadi <dalwadivishal26@gmail.com>
|
||||
Vishvananda Ishaya <vishvananda@gmail.com>
|
||||
Visweswara R <r.visweswara@gmail.com>
|
||||
Vitaly Zdanevich <zdanevich.vitaly@ya.ru>
|
||||
@@ -2651,7 +2526,6 @@ Wei Guangjing <vcc.163@gmail.com>
|
||||
Wei Xiao <wei.xiao@arm.com>
|
||||
Wei Xikai <xykwei@gmail.com>
|
||||
Weichao Tang <tevic.tt@gmail.com>
|
||||
Weixie Cui <cuiweixie@gmail.com> <523516579@qq.com>
|
||||
Wembley G. Leach, Jr <wembley.gl@gmail.com>
|
||||
Wenlei (Frank) He <wlhe@google.com>
|
||||
Wenzel Lowe <lowewenzel@gmail.com>
|
||||
@@ -2667,7 +2541,6 @@ Willem van der Schyff <willemvds@gmail.com>
|
||||
William Chan <willchan@chromium.org>
|
||||
William Chang <mr.williamchang@gmail.com>
|
||||
William Josephson <wjosephson@gmail.com>
|
||||
William Langford <wlangfor@gmail.com>
|
||||
William Orr <will@worrbase.com> <ay1244@gmail.com>
|
||||
William Poussier <william.poussier@gmail.com>
|
||||
Wisdom Omuya <deafgoat@gmail.com>
|
||||
@@ -2676,7 +2549,6 @@ Xi Ruoyao <xry23333@gmail.com>
|
||||
Xia Bin <snyh@snyh.org>
|
||||
Xiangdong Ji <xiangdong.ji@arm.com>
|
||||
Xiaodong Liu <teaofmoli@gmail.com>
|
||||
Xing Gao <18340825824@163.com>
|
||||
Xing Xing <mikespook@gmail.com>
|
||||
Xingqang Bai <bxq2011hust@qq.com>
|
||||
Xu Fei <badgangkiller@gmail.com>
|
||||
@@ -2698,7 +2570,6 @@ Yasha Bubnov <girokompass@gmail.com>
|
||||
Yasser Abdolmaleki <yasser@yasser.ca>
|
||||
Yasuharu Goto <matope.ono@gmail.com>
|
||||
Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
Yasutaka Shinzaki <shinzaki@yasu26.tech>
|
||||
Yasuyuki Oka <yasuyk@gmail.com>
|
||||
Yazen Shunnar <yazen.shunnar@gmail.com>
|
||||
Yestin Sun <ylh@pdx.edu>
|
||||
@@ -2711,18 +2582,14 @@ Yorman Arias <cixtords@gmail.com>
|
||||
Yoshiyuki Kanno <nekotaroh@gmail.com> <yoshiyuki.kanno@stoic.co.jp>
|
||||
Yoshiyuki Mineo <yoshiyuki.mineo@gmail.com>
|
||||
Yosuke Akatsuka <yosuke.akatsuka@gmail.com>
|
||||
Youfu Zhang <zhangyoufu@gmail.com>
|
||||
Yu Heng Zhang <annita.zhang@cn.ibm.com>
|
||||
Yu Xuan Zhang <zyxsh@cn.ibm.com>
|
||||
Yu, Li-Yu <afg984@gmail.com>
|
||||
Yuichi Kishimoto <yk2220s@gmail.com>
|
||||
Yuichi Nishiwaki <yuichi.nishiwaki@gmail.com>
|
||||
Yuji Yaginuma <yuuji.yaginuma@gmail.com>
|
||||
Yuki Ito <mrno110y@gmail.com>
|
||||
Yuki OKUSHI <huyuumi.dev@gmail.com>
|
||||
Yuki Yugui Sonoda <yugui@google.com>
|
||||
Yukihiro Nishinaka <6elpinal@gmail.com>
|
||||
YunQiang Su <syq@debian.org>
|
||||
Yury Smolsky <yury@smolsky.by>
|
||||
Yusuke Kagiwada <block.rxckin.beats@gmail.com>
|
||||
Yuusei Kuwana <kuwana@kumama.org>
|
||||
@@ -2731,7 +2598,6 @@ Yves Junqueira <yvesj@google.com> <yves.junqueira@gmail.com>
|
||||
Zac Bergquist <zbergquist99@gmail.com>
|
||||
Zach Bintliff <zbintliff@gmail.com>
|
||||
Zach Gershman <zachgersh@gmail.com>
|
||||
Zach Hoffman <zrhoffman@apache.org>
|
||||
Zach Jones <zachj1@gmail.com>
|
||||
Zachary Amsden <zach@thundertoken.com>
|
||||
Zachary Gershman <zgershman@pivotal.io>
|
||||
@@ -2750,7 +2616,6 @@ Zhou Peng <p@ctriple.cn>
|
||||
Ziad Hatahet <hatahet@gmail.com>
|
||||
Ziheng Liu <lzhfromustc@gmail.com>
|
||||
Zorion Arrizabalaga <zorionk@gmail.com>
|
||||
Zvonimir Pavlinovic <zpavlinovic@google.com>
|
||||
Zyad A. Ali <zyad.ali.me@gmail.com>
|
||||
Максадбек Ахмедов <a.maksadbek@gmail.com>
|
||||
Максим Федосеев <max.faceless.frei@gmail.com>
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||
pkg math, const MaxFloat64 = 1.79769e+308 // 179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math, const SmallestNonzeroFloat32 = 1.4013e-45 // 17516230804060213386546619791123951641/12500000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math, const SmallestNonzeroFloat64 = 4.94066e-324 // 4940656458412465441765687928682213723651/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
pkg math/big, const MaxBase = 36
|
||||
pkg math/big, type Word uintptr
|
||||
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
||||
|
||||
195
api/go1.17.txt
195
api/go1.17.txt
@@ -1,195 +0,0 @@
|
||||
pkg archive/zip, method (*File) OpenRaw() (io.Reader, error)
|
||||
pkg archive/zip, method (*Writer) Copy(*File) error
|
||||
pkg archive/zip, method (*Writer) CreateRaw(*FileHeader) (io.Writer, error)
|
||||
pkg compress/lzw, method (*Reader) Close() error
|
||||
pkg compress/lzw, method (*Reader) Read([]uint8) (int, error)
|
||||
pkg compress/lzw, method (*Reader) Reset(io.Reader, Order, int)
|
||||
pkg compress/lzw, method (*Writer) Close() error
|
||||
pkg compress/lzw, method (*Writer) Reset(io.Writer, Order, int)
|
||||
pkg compress/lzw, method (*Writer) Write([]uint8) (int, error)
|
||||
pkg compress/lzw, type Reader struct
|
||||
pkg compress/lzw, type Writer struct
|
||||
pkg crypto/tls, method (*CertificateRequestInfo) Context() context.Context
|
||||
pkg crypto/tls, method (*ClientHelloInfo) Context() context.Context
|
||||
pkg crypto/tls, method (*Conn) HandshakeContext(context.Context) error
|
||||
pkg database/sql, method (*NullByte) Scan(interface{}) error
|
||||
pkg database/sql, method (*NullInt16) Scan(interface{}) error
|
||||
pkg database/sql, method (NullByte) Value() (driver.Value, error)
|
||||
pkg database/sql, method (NullInt16) Value() (driver.Value, error)
|
||||
pkg database/sql, type NullByte struct
|
||||
pkg database/sql, type NullByte struct, Byte uint8
|
||||
pkg database/sql, type NullByte struct, Valid bool
|
||||
pkg database/sql, type NullInt16 struct
|
||||
pkg database/sql, type NullInt16 struct, Int16 int16
|
||||
pkg database/sql, type NullInt16 struct, Valid bool
|
||||
pkg debug/elf, const SHT_MIPS_ABIFLAGS = 1879048234
|
||||
pkg debug/elf, const SHT_MIPS_ABIFLAGS SectionType
|
||||
pkg encoding/csv, method (*Reader) FieldPos(int) (int, int)
|
||||
pkg go/build, type Context struct, ToolTags []string
|
||||
pkg go/parser, const SkipObjectResolution = 64
|
||||
pkg go/parser, const SkipObjectResolution Mode
|
||||
pkg image, method (*Alpha) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Alpha) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*Alpha16) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Alpha16) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*CMYK) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*CMYK) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*Gray) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Gray) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*Gray16) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Gray16) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*NRGBA) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*NRGBA) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*NRGBA64) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*NRGBA64) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*NYCbCrA) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Paletted) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*Paletted) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*RGBA) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*RGBA) SetRGBA64(int, int, color.RGBA64)
|
||||
pkg image, method (*Uniform) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (*YCbCr) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, method (Rectangle) RGBA64At(int, int) color.RGBA64
|
||||
pkg image, type RGBA64Image interface { At, Bounds, ColorModel, RGBA64At }
|
||||
pkg image, type RGBA64Image interface, At(int, int) color.Color
|
||||
pkg image, type RGBA64Image interface, Bounds() Rectangle
|
||||
pkg image, type RGBA64Image interface, ColorModel() color.Model
|
||||
pkg image, type RGBA64Image interface, RGBA64At(int, int) color.RGBA64
|
||||
pkg image/draw, type RGBA64Image interface { At, Bounds, ColorModel, RGBA64At, Set, SetRGBA64 }
|
||||
pkg image/draw, type RGBA64Image interface, At(int, int) color.Color
|
||||
pkg image/draw, type RGBA64Image interface, Bounds() image.Rectangle
|
||||
pkg image/draw, type RGBA64Image interface, ColorModel() color.Model
|
||||
pkg image/draw, type RGBA64Image interface, RGBA64At(int, int) color.RGBA64
|
||||
pkg image/draw, type RGBA64Image interface, Set(int, int, color.Color)
|
||||
pkg image/draw, type RGBA64Image interface, SetRGBA64(int, int, color.RGBA64)
|
||||
pkg io/fs, func FileInfoToDirEntry(FileInfo) DirEntry
|
||||
pkg math, const MaxFloat64 = 1.79769e+308 // 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
|
||||
pkg math, const MaxInt = 9223372036854775807
|
||||
pkg math, const MaxInt ideal-int
|
||||
pkg math, const MaxUint = 18446744073709551615
|
||||
pkg math, const MaxUint ideal-int
|
||||
pkg math, const MinInt = -9223372036854775808
|
||||
pkg math, const MinInt ideal-int
|
||||
pkg math, const SmallestNonzeroFloat32 = 1.4013e-45 // 1/713623846352979940529142984724747568191373312
|
||||
pkg math, const SmallestNonzeroFloat64 = 4.94066e-324 // 1/202402253307310618352495346718917307049556649764142118356901358027430339567995346891960383701437124495187077864316811911389808737385793476867013399940738509921517424276566361364466907742093216341239767678472745068562007483424692698618103355649159556340810056512358769552333414615230502532186327508646006263307707741093494784
|
||||
pkg net, method (*ParseError) Temporary() bool
|
||||
pkg net, method (*ParseError) Timeout() bool
|
||||
pkg net, method (IP) IsPrivate() bool
|
||||
pkg net/http, func AllowQuerySemicolons(Handler) Handler
|
||||
pkg net/url, method (Values) Has(string) bool
|
||||
pkg reflect, func VisibleFields(Type) []StructField
|
||||
pkg reflect, method (Method) IsExported() bool
|
||||
pkg reflect, method (StructField) IsExported() bool
|
||||
pkg reflect, method (Value) CanConvert(Type) bool
|
||||
pkg runtime/cgo (darwin-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (darwin-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (darwin-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (freebsd-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (freebsd-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (freebsd-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (linux-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (linux-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (linux-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (linux-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-amd64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-arm-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-arm-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-arm-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-arm-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (netbsd-arm64-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (openbsd-386-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (openbsd-386-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (openbsd-386-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (openbsd-386-cgo), type Handle uintptr
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), func NewHandle(interface{}) Handle
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), method (Handle) Delete()
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), method (Handle) Value() interface{}
|
||||
pkg runtime/cgo (openbsd-amd64-cgo), type Handle uintptr
|
||||
pkg strconv, func QuotedPrefix(string) (string, error)
|
||||
pkg sync/atomic, method (*Value) CompareAndSwap(interface{}, interface{}) bool
|
||||
pkg sync/atomic, method (*Value) Swap(interface{}) interface{}
|
||||
pkg syscall (netbsd-386), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-386), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-386), const WEXITED = 32
|
||||
pkg syscall (netbsd-386), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-386-cgo), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-386-cgo), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-386-cgo), const WEXITED = 32
|
||||
pkg syscall (netbsd-386-cgo), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-amd64), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-amd64), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-amd64), const WEXITED = 32
|
||||
pkg syscall (netbsd-amd64), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-amd64-cgo), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-amd64-cgo), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-amd64-cgo), const WEXITED = 32
|
||||
pkg syscall (netbsd-amd64-cgo), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-arm), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-arm), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-arm), const WEXITED = 32
|
||||
pkg syscall (netbsd-arm), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-arm-cgo), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-arm-cgo), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-arm-cgo), const WEXITED = 32
|
||||
pkg syscall (netbsd-arm-cgo), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-arm64), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-arm64), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-arm64), const WEXITED = 32
|
||||
pkg syscall (netbsd-arm64), const WEXITED ideal-int
|
||||
pkg syscall (netbsd-arm64-cgo), const SYS_WAIT6 = 481
|
||||
pkg syscall (netbsd-arm64-cgo), const SYS_WAIT6 ideal-int
|
||||
pkg syscall (netbsd-arm64-cgo), const WEXITED = 32
|
||||
pkg syscall (netbsd-arm64-cgo), const WEXITED ideal-int
|
||||
pkg syscall (openbsd-386), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-386), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-386-cgo), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-386-cgo), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC = 2048
|
||||
pkg syscall (openbsd-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int
|
||||
pkg syscall (windows-386), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-386), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, AdditionalInheritedHandles []Handle
|
||||
pkg syscall (windows-amd64), type SysProcAttr struct, ParentProcess Handle
|
||||
pkg testing, method (*B) Setenv(string, string)
|
||||
pkg testing, method (*T) Setenv(string, string)
|
||||
pkg testing, type TB interface, Setenv(string, string)
|
||||
pkg text/template/parse, const SkipFuncCheck = 2
|
||||
pkg text/template/parse, const SkipFuncCheck Mode
|
||||
pkg time, const Layout = "01/02 03:04:05PM '06 -0700"
|
||||
pkg time, const Layout ideal-string
|
||||
pkg time, func UnixMicro(int64) Time
|
||||
pkg time, func UnixMilli(int64) Time
|
||||
pkg time, method (Time) GoString() string
|
||||
pkg time, method (Time) IsDST() bool
|
||||
pkg time, method (Time) UnixMicro() int64
|
||||
pkg time, method (Time) UnixMilli() int64
|
||||
@@ -1,2 +0,0 @@
|
||||
branch: dev.typeparams
|
||||
parent-branch: master
|
||||
12
doc/asm.html
12
doc/asm.html
@@ -166,7 +166,7 @@ jumps and branches.
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>SP</code>: Stack pointer: the highest address within the local stack frame.
|
||||
<code>SP</code>: Stack pointer: top of stack.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -216,7 +216,7 @@ If a Go prototype does not name its result, the expected assembly name is <code>
|
||||
The <code>SP</code> pseudo-register is a virtual stack pointer
|
||||
used to refer to frame-local variables and the arguments being
|
||||
prepared for function calls.
|
||||
It points to the highest address within the local stack frame, so references should use negative offsets
|
||||
It points to the top of the local stack frame, so references should use negative offsets
|
||||
in the range [−framesize, 0):
|
||||
<code>x-8(SP)</code>, <code>y-4(SP)</code>, and so on.
|
||||
</p>
|
||||
@@ -409,7 +409,7 @@ The linker will choose one of the duplicates to use.
|
||||
(For <code>TEXT</code> items.)
|
||||
Don't insert the preamble to check if the stack must be split.
|
||||
The frame for the routine, plus anything it calls, must fit in the
|
||||
spare space remaining in the current stack segment.
|
||||
spare space at the top of the stack segment.
|
||||
Used to protect routines such as the stack splitting code itself.
|
||||
</li>
|
||||
<li>
|
||||
@@ -460,7 +460,7 @@ Only valid on functions that declare a frame size of 0.
|
||||
<code>TOPFRAME</code> = 2048
|
||||
<br>
|
||||
(For <code>TEXT</code> items.)
|
||||
Function is the outermost frame of the call stack. Traceback should stop at this function.
|
||||
Function is the top of the call stack. Traceback should stop at this function.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -827,6 +827,10 @@ The other codes are <code>-></code> (arithmetic right shift),
|
||||
|
||||
<h3 id="arm64">ARM64</h3>
|
||||
|
||||
<p>
|
||||
The ARM64 port is in an experimental state.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<code>R18</code> is the "platform register", reserved on the Apple platform.
|
||||
To prevent accidental misuse, the register is named <code>R18_PLATFORM</code>.
|
||||
|
||||
1220
doc/go1.16.html
Normal file
1220
doc/go1.16.html
Normal file
File diff suppressed because it is too large
Load Diff
1240
doc/go1.17.html
1240
doc/go1.17.html
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of Jul 26, 2021",
|
||||
"Subtitle": "Version of Feb 10, 2021",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
@@ -490,8 +490,8 @@ After a backslash, certain single-character escapes represent special values:
|
||||
\n U+000A line feed or newline
|
||||
\r U+000D carriage return
|
||||
\t U+0009 horizontal tab
|
||||
\v U+000B vertical tab
|
||||
\\ U+005C backslash
|
||||
\v U+000b vertical tab
|
||||
\\ U+005c backslash
|
||||
\' U+0027 single quote (valid escape only within rune literals)
|
||||
\" U+0022 double quote (valid escape only within string literals)
|
||||
</pre>
|
||||
@@ -830,7 +830,7 @@ The underlying type of <code>[]B1</code>, <code>B3</code>, and <code>B4</code> i
|
||||
|
||||
<h3 id="Method_sets">Method sets</h3>
|
||||
<p>
|
||||
A type has a (possibly empty) <i>method set</i> associated with it.
|
||||
A type may have a <i>method set</i> associated with it.
|
||||
The method set of an <a href="#Interface_types">interface type</a> is its interface.
|
||||
The method set of any other type <code>T</code> consists of all
|
||||
<a href="#Method_declarations">methods</a> declared with receiver type <code>T</code>.
|
||||
@@ -3532,9 +3532,9 @@ within <code>Greeting</code>, <code>who</code> will have the value
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If the final argument is assignable to a slice type <code>[]T</code> and
|
||||
is followed by <code>...</code>, it is passed unchanged as the value
|
||||
for a <code>...T</code> parameter. In this case no new slice is created.
|
||||
If the final argument is assignable to a slice type <code>[]T</code>, it is
|
||||
passed unchanged as the value for a <code>...T</code> parameter if the argument
|
||||
is followed by <code>...</code>. In this case no new slice is created.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -3681,8 +3681,8 @@ The bitwise logical and shift operators apply to integers only.
|
||||
^ bitwise XOR integers
|
||||
&^ bit clear (AND NOT) integers
|
||||
|
||||
<< left shift integer << integer >= 0
|
||||
>> right shift integer >> integer >= 0
|
||||
<< left shift integer << unsigned integer
|
||||
>> right shift integer >> unsigned integer
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -4164,10 +4164,6 @@ in any of these cases:
|
||||
<li>
|
||||
<code>x</code> is a string and <code>T</code> is a slice of bytes or runes.
|
||||
</li>
|
||||
<li>
|
||||
<code>x</code> is a slice, <code>T</code> is a pointer to an array,
|
||||
and the slice and array types have <a href="#Type_identity">identical</a> element types.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
@@ -4318,28 +4314,6 @@ MyRunes("白鵬翔") // []rune{0x767d, 0x9d6c, 0x7fd4}
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="Conversions_from_slice_to_array_pointer">Conversions from slice to array pointer</h4>
|
||||
|
||||
<p>
|
||||
Converting a slice to an array pointer yields a pointer to the underlying array of the slice.
|
||||
If the <a href="#Length_and_capacity">length</a> of the slice is less than the length of the array,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
s := make([]byte, 2, 4)
|
||||
s0 := (*[0]byte)(s) // s0 != nil
|
||||
s1 := (*[1]byte)(s[1:]) // &s1[0] == &s[1]
|
||||
s2 := (*[2]byte)(s) // &s2[0] == &s[0]
|
||||
s4 := (*[4]byte)(s) // panics: len([4]byte) > len(s)
|
||||
|
||||
var t []string
|
||||
t0 := (*[0]string)(t) // t0 == nil
|
||||
t1 := (*[1]string)(t) // panics: len([1]string) > len(t)
|
||||
|
||||
u := make([]byte, 0)
|
||||
u0 = (*[0]byte)(u) // u0 != nil
|
||||
</pre>
|
||||
|
||||
<h3 id="Constant_expressions">Constant expressions</h3>
|
||||
|
||||
@@ -4674,7 +4648,7 @@ The following built-in functions are not permitted in statement context:
|
||||
|
||||
<pre>
|
||||
append cap complex imag len make new real
|
||||
unsafe.Add unsafe.Alignof unsafe.Offsetof unsafe.Sizeof unsafe.Slice
|
||||
unsafe.Alignof unsafe.Offsetof unsafe.Sizeof
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
@@ -4913,7 +4887,7 @@ if x := f(); x < y {
|
||||
|
||||
<p>
|
||||
"Switch" statements provide multi-way execution.
|
||||
An expression or type is compared to the "cases"
|
||||
An expression or type specifier is compared to the "cases"
|
||||
inside the "switch" to determine which branch
|
||||
to execute.
|
||||
</p>
|
||||
@@ -4957,9 +4931,9 @@ ExprSwitchCase = "case" ExpressionList | "default" .
|
||||
|
||||
<p>
|
||||
If the switch expression evaluates to an untyped constant, it is first implicitly
|
||||
<a href="#Conversions">converted</a> to its <a href="#Constants">default type</a>.
|
||||
<a href="#Conversions">converted</a> to its <a href="#Constants">default type</a>;
|
||||
if it is an untyped boolean value, it is first implicitly converted to type <code>bool</code>.
|
||||
The predeclared untyped value <code>nil</code> cannot be used as a switch expression.
|
||||
The switch expression type must be <a href="#Comparison_operators">comparable</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -5024,7 +4998,7 @@ floating point, or string constants in case expressions.
|
||||
A type switch compares types rather than values. It is otherwise similar
|
||||
to an expression switch. It is marked by a special switch expression that
|
||||
has the form of a <a href="#Type_assertions">type assertion</a>
|
||||
using the keyword <code>type</code> rather than an actual type:
|
||||
using the reserved word <code>type</code> rather than an actual type:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
@@ -6715,10 +6689,6 @@ type Pointer *ArbitraryType
|
||||
func Alignof(variable ArbitraryType) uintptr
|
||||
func Offsetof(selector ArbitraryType) uintptr
|
||||
func Sizeof(variable ArbitraryType) uintptr
|
||||
|
||||
type IntegerType int // shorthand for an integer type; it is not a real type
|
||||
func Add(ptr Pointer, len IntegerType) Pointer
|
||||
func Slice(ptr *ArbitraryType, len IntegerType) []ArbitraryType
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
@@ -6775,40 +6745,6 @@ Calls to <code>Alignof</code>, <code>Offsetof</code>, and
|
||||
<code>Sizeof</code> are compile-time constant expressions of type <code>uintptr</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>Add</code> adds <code>len</code> to <code>ptr</code>
|
||||
and returns the updated pointer <code>unsafe.Pointer(uintptr(ptr) + uintptr(len))</code>.
|
||||
The <code>len</code> argument must be of integer type or an untyped <a href="#Constants">constant</a>.
|
||||
A constant <code>len</code> argument must be <a href="#Representability">representable</a> by a value of type <code>int</code>;
|
||||
if it is an untyped constant it is given type <code>int</code>.
|
||||
The rules for <a href="/pkg/unsafe#Pointer">valid uses</a> of <code>Pointer</code> still apply.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The function <code>Slice</code> returns a slice whose underlying array starts at <code>ptr</code>
|
||||
and whose length and capacity are <code>len</code>.
|
||||
<code>Slice(ptr, len)</code> is equivalent to
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
(*[len]ArbitraryType)(unsafe.Pointer(ptr))[:]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
except that, as a special case, if <code>ptr</code>
|
||||
is <code>nil</code> and <code>len</code> is zero,
|
||||
<code>Slice</code> returns <code>nil</code>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>len</code> argument must be of integer type or an untyped <a href="#Constants">constant</a>.
|
||||
A constant <code>len</code> argument must be non-negative and <a href="#Representability">representable</a> by a value of type <code>int</code>;
|
||||
if it is an untyped constant it is given type <code>int</code>.
|
||||
At run time, if <code>len</code> is negative,
|
||||
or if <code>ptr</code> is <code>nil</code> and <code>len</code> is not zero,
|
||||
a <a href="#Run_time_panics">run-time panic</a> occurs.
|
||||
</p>
|
||||
|
||||
<h3 id="Size_and_alignment_guarantees">Size and alignment guarantees</h3>
|
||||
|
||||
<p>
|
||||
|
||||
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
@@ -14,6 +14,7 @@ import (
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -275,7 +276,7 @@ func adbCopyGoroot() error {
|
||||
if err := syscall.Flock(int(stat.Fd()), syscall.LOCK_EX); err != nil {
|
||||
return err
|
||||
}
|
||||
s, err := io.ReadAll(stat)
|
||||
s, err := ioutil.ReadAll(stat)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -293,7 +294,7 @@ func adbCopyGoroot() error {
|
||||
goroot := runtime.GOROOT()
|
||||
// Build go for android.
|
||||
goCmd := filepath.Join(goroot, "bin", "go")
|
||||
tmpGo, err := os.CreateTemp("", "go_android_exec-cmd-go-*")
|
||||
tmpGo, err := ioutil.TempFile("", "go_android_exec-cmd-go-*")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
// Issue 42580: cmd/cgo: shifting identifier position in ast
|
||||
|
||||
package errorstest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type ShortPosition struct {
|
||||
Line int
|
||||
Column int
|
||||
Visited bool
|
||||
}
|
||||
|
||||
type IdentPositionInfo map[string][]ShortPosition
|
||||
|
||||
type Visitor struct {
|
||||
identPosInfo IdentPositionInfo
|
||||
fset *token.FileSet
|
||||
t *testing.T
|
||||
}
|
||||
|
||||
func (v *Visitor) Visit(node ast.Node) ast.Visitor {
|
||||
if ident, ok := node.(*ast.Ident); ok {
|
||||
if expectedPositions, ok := v.identPosInfo[ident.Name]; ok {
|
||||
gotMatch := false
|
||||
var errorMessage strings.Builder
|
||||
for caseIndex, expectedPos := range expectedPositions {
|
||||
actualPosition := v.fset.PositionFor(ident.Pos(), true)
|
||||
errorOccured := false
|
||||
if expectedPos.Line != actualPosition.Line {
|
||||
fmt.Fprintf(&errorMessage, "wrong line number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Line, actualPosition.Line)
|
||||
errorOccured = true
|
||||
}
|
||||
if expectedPos.Column != actualPosition.Column {
|
||||
fmt.Fprintf(&errorMessage, "wrong column number for ident %s: expected: %d got: %d\n", ident.Name, expectedPos.Column, actualPosition.Column)
|
||||
errorOccured = true
|
||||
}
|
||||
if errorOccured {
|
||||
continue
|
||||
}
|
||||
gotMatch = true
|
||||
expectedPositions[caseIndex].Visited = true
|
||||
}
|
||||
|
||||
if !gotMatch {
|
||||
v.t.Errorf(errorMessage.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func TestArgumentsPositions(t *testing.T) {
|
||||
testdata, err := filepath.Abs("testdata")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
tmpPath := t.TempDir()
|
||||
|
||||
dir := filepath.Join(tmpPath, "src", "testpositions")
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("go", "tool", "cgo",
|
||||
"-srcdir", testdata,
|
||||
"-objdir", dir,
|
||||
"issue42580.go")
|
||||
cmd.Stderr = new(bytes.Buffer)
|
||||
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
t.Fatalf("%s: %v\n%s", cmd, err, cmd.Stderr)
|
||||
}
|
||||
mainProcessed, err := ioutil.ReadFile(filepath.Join(dir, "issue42580.cgo1.go"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fset := token.NewFileSet()
|
||||
f, err := parser.ParseFile(fset, "", mainProcessed, parser.AllErrors)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
expectation := IdentPositionInfo{
|
||||
"checkedPointer": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 32,
|
||||
Column: 56,
|
||||
},
|
||||
},
|
||||
"singleInnerPointerChecked": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 37,
|
||||
Column: 91,
|
||||
},
|
||||
},
|
||||
"doublePointerChecked": []ShortPosition{
|
||||
ShortPosition{
|
||||
Line: 42,
|
||||
Column: 91,
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, decl := range f.Decls {
|
||||
if fdecl, ok := decl.(*ast.FuncDecl); ok {
|
||||
ast.Walk(&Visitor{expectation, fset, t}, fdecl.Body)
|
||||
}
|
||||
}
|
||||
for ident, positions := range expectation {
|
||||
for _, position := range positions {
|
||||
if !position.Visited {
|
||||
t.Errorf("Position %d:%d missed for %s ident", position.Line, position.Column, ident)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ package errorstest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -54,7 +55,7 @@ func TestBadSymbol(t *testing.T) {
|
||||
|
||||
makeFile := func(mdir, base, source string) string {
|
||||
ret := filepath.Join(mdir, base)
|
||||
if err := os.WriteFile(ret, []byte(source), 0644); err != nil {
|
||||
if err := ioutil.WriteFile(ret, []byte(source), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return ret
|
||||
@@ -99,7 +100,7 @@ func TestBadSymbol(t *testing.T) {
|
||||
// _cgo_import.go.
|
||||
|
||||
rewrite := func(from, to string) {
|
||||
obj, err := os.ReadFile(from)
|
||||
obj, err := ioutil.ReadFile(from)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -114,7 +115,7 @@ func TestBadSymbol(t *testing.T) {
|
||||
|
||||
obj = bytes.ReplaceAll(obj, []byte(magicInput), []byte(magicReplace))
|
||||
|
||||
if err := os.WriteFile(to, obj, 0644); err != nil {
|
||||
if err := ioutil.WriteFile(to, obj, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package errorstest
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -24,7 +25,7 @@ func check(t *testing.T, file string) {
|
||||
t.Run(file, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
contents, err := os.ReadFile(path(file))
|
||||
contents, err := ioutil.ReadFile(path(file))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -40,8 +41,7 @@ func check(t *testing.T, file string) {
|
||||
if len(frags) == 1 {
|
||||
continue
|
||||
}
|
||||
frag := fmt.Sprintf(":%d:.*%s", i+1, frags[1])
|
||||
re, err := regexp.Compile(frag)
|
||||
re, err := regexp.Compile(string(frags[1]))
|
||||
if err != nil {
|
||||
t.Errorf("Invalid regexp after `ERROR HERE: `: %#q", frags[1])
|
||||
continue
|
||||
@@ -56,7 +56,7 @@ func check(t *testing.T, file string) {
|
||||
}
|
||||
|
||||
func expect(t *testing.T, file string, errors []*regexp.Regexp) {
|
||||
dir, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
dir, err := ioutil.TempDir("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -462,7 +463,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
||||
gopath = *tmp
|
||||
dir = ""
|
||||
} else {
|
||||
d, err := os.MkdirTemp("", filepath.Base(t.Name()))
|
||||
d, err := ioutil.TempDir("", filepath.Base(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -474,7 +475,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
||||
if err := os.MkdirAll(src, 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -534,10 +535,10 @@ func buildPtrTests(t *testing.T) (dir, exe string) {
|
||||
fmt.Fprintf(&cgo1, "}\n\n")
|
||||
fmt.Fprintf(&cgo1, "%s\n", ptrTestMain)
|
||||
|
||||
if err := os.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
20
misc/cgo/errors/testdata/err2.go
vendored
20
misc/cgo/errors/testdata/err2.go
vendored
@@ -40,15 +40,15 @@ func main() {
|
||||
C.foop = x // ERROR HERE
|
||||
|
||||
// issue 13129: used to output error about C.unsignedshort with CC=clang
|
||||
var x1 C.ushort
|
||||
x1 = int(0) // ERROR HERE: C\.ushort
|
||||
var x C.ushort
|
||||
x = int(0) // ERROR HERE: C\.ushort
|
||||
|
||||
// issue 13423
|
||||
_ = C.fopen() // ERROR HERE
|
||||
|
||||
// issue 13467
|
||||
var x2 rune = '✈'
|
||||
var _ rune = C.transform(x2) // ERROR HERE: C\.int
|
||||
var x rune = '✈'
|
||||
var _ rune = C.transform(x) // ERROR HERE: C\.int
|
||||
|
||||
// issue 13635: used to output error about C.unsignedchar.
|
||||
// This test tests all such types.
|
||||
@@ -91,18 +91,10 @@ func main() {
|
||||
|
||||
// issue 26745
|
||||
_ = func(i int) int {
|
||||
// typecheck reports at column 14 ('+'), but types2 reports at
|
||||
// column 10 ('C').
|
||||
// TODO(mdempsky): Investigate why, and see if types2 can be
|
||||
// updated to match typecheck behavior.
|
||||
return C.i + 1 // ERROR HERE: \b(10|14)\b
|
||||
return C.i + 1 // ERROR HERE: :13
|
||||
}
|
||||
_ = func(i int) {
|
||||
// typecheck reports at column 7 ('('), but types2 reports at
|
||||
// column 8 ('i'). The types2 position is more correct, but
|
||||
// updating typecheck here is fundamentally challenging because of
|
||||
// IR limitations.
|
||||
C.fi(i) // ERROR HERE: \b(7|8)\b
|
||||
C.fi(i) // ERROR HERE: :6
|
||||
}
|
||||
|
||||
C.fi = C.fi // ERROR HERE
|
||||
|
||||
44
misc/cgo/errors/testdata/issue42580.go
vendored
44
misc/cgo/errors/testdata/issue42580.go
vendored
@@ -1,44 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
// Issue 42580: cmd/cgo: shifting identifier position in ast
|
||||
|
||||
package cgotest
|
||||
|
||||
// typedef int (*intFunc) ();
|
||||
//
|
||||
// char* strarg = "";
|
||||
//
|
||||
// int func_with_char(char* arg, void* dummy)
|
||||
// {return 5;}
|
||||
//
|
||||
// int* get_arr(char* arg, void* dummy)
|
||||
// {return NULL;}
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
||||
// Test variables
|
||||
var (
|
||||
checkedPointer = []byte{1}
|
||||
doublePointerChecked = []byte{1}
|
||||
singleInnerPointerChecked = []byte{1}
|
||||
)
|
||||
|
||||
// This test checks the positions of variable identifiers.
|
||||
// Changing the positions of the test variables idents after this point will break the test.
|
||||
|
||||
func TestSingleArgumentCast() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(&checkedPointer[0])), unsafe.Pointer(C.strarg))
|
||||
return retcode
|
||||
}
|
||||
|
||||
func TestSingleArgumentCastRecFuncAsSimpleArg() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(C.get_arr((*C.char)(unsafe.Pointer(&singleInnerPointerChecked[0])), unsafe.Pointer(C.strarg)))), nil)
|
||||
return retcode
|
||||
}
|
||||
|
||||
func TestSingleArgumentCastRecFunc() C.int {
|
||||
retcode := C.func_with_char((*C.char)(unsafe.Pointer(C.get_arr((*C.char)(unsafe.Pointer(&doublePointerChecked[0])), unsafe.Pointer(C.strarg)))), unsafe.Pointer(C.strarg))
|
||||
return retcode
|
||||
}
|
||||
@@ -6,6 +6,7 @@ package life_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -20,7 +21,7 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := os.MkdirTemp("", "cgolife")
|
||||
GOPATH, err := ioutil.TempDir("", "cgolife")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
@@ -37,7 +38,7 @@ func testMain(m *testing.M) int {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module cgolife\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module cgolife\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ package stdio_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -20,7 +21,7 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
GOPATH, err := os.MkdirTemp("", "cgostdio")
|
||||
GOPATH, err := ioutil.TempDir("", "cgostdio")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
@@ -37,7 +38,7 @@ func testMain(m *testing.M) int {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module cgostdio\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ func testCallbackCallers(t *testing.T) {
|
||||
"runtime.cgocallbackg1",
|
||||
"runtime.cgocallbackg",
|
||||
"runtime.cgocallback",
|
||||
"runtime.systemstack_switch",
|
||||
"runtime.asmcgocall",
|
||||
"runtime.cgocall",
|
||||
"test._Cfunc_callback",
|
||||
"test.nestedCall.func1",
|
||||
|
||||
@@ -59,7 +59,6 @@ func Test28896(t *testing.T) { test28896(t) }
|
||||
func Test30065(t *testing.T) { test30065(t) }
|
||||
func Test32579(t *testing.T) { test32579(t) }
|
||||
func Test31891(t *testing.T) { test31891(t) }
|
||||
func Test45451(t *testing.T) { test45451(t) }
|
||||
func TestAlign(t *testing.T) { testAlign(t) }
|
||||
func TestAtol(t *testing.T) { testAtol(t) }
|
||||
func TestBlocking(t *testing.T) { testBlocking(t) }
|
||||
@@ -81,7 +80,6 @@ func TestNamedEnum(t *testing.T) { testNamedEnum(t) }
|
||||
func TestCastToEnum(t *testing.T) { testCastToEnum(t) }
|
||||
func TestErrno(t *testing.T) { testErrno(t) }
|
||||
func TestFpVar(t *testing.T) { testFpVar(t) }
|
||||
func TestHandle(t *testing.T) { testHandle(t) }
|
||||
func TestHelpers(t *testing.T) { testHelpers(t) }
|
||||
func TestLibgcc(t *testing.T) { testLibgcc(t) }
|
||||
func TestMultipleAssign(t *testing.T) { testMultipleAssign(t) }
|
||||
|
||||
@@ -8,8 +8,7 @@ package cgotest
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
@@ -65,7 +64,7 @@ import "C"
|
||||
func compareStatus(filter, expect string) error {
|
||||
expected := filter + expect
|
||||
pid := syscall.Getpid()
|
||||
fs, err := os.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
|
||||
fs, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to find %d tasks: %v", pid, err)
|
||||
}
|
||||
@@ -73,7 +72,7 @@ func compareStatus(filter, expect string) error {
|
||||
foundAThread := false
|
||||
for _, f := range fs {
|
||||
tf := fmt.Sprintf("/proc/%s/status", f.Name())
|
||||
d, err := os.ReadFile(tf)
|
||||
d, err := ioutil.ReadFile(tf)
|
||||
if err != nil {
|
||||
// There are a surprising number of ways this
|
||||
// can error out on linux. We've seen all of
|
||||
@@ -106,23 +105,11 @@ func compareStatus(filter, expect string) error {
|
||||
// "Pid:\t".
|
||||
}
|
||||
if strings.HasPrefix(line, filter) {
|
||||
if line == expected {
|
||||
foundAThread = true
|
||||
break
|
||||
if line != expected {
|
||||
return fmt.Errorf("%q got:%q want:%q (bad) [pid=%d file:'%s' %v]\n", tf, line, expected, pid, string(d), expectedProc)
|
||||
}
|
||||
if filter == "Groups:" && strings.HasPrefix(line, "Groups:\t") {
|
||||
// https://github.com/golang/go/issues/46145
|
||||
// Containers don't reliably output this line in sorted order so manually sort and compare that.
|
||||
a := strings.Split(line[8:], " ")
|
||||
sort.Strings(a)
|
||||
got := strings.Join(a, " ")
|
||||
if got == expected[8:] {
|
||||
foundAThread = true
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
return fmt.Errorf("%q got:%q want:%q (bad) [pid=%d file:'%s' %v]\n", tf, line, expected, pid, string(d), expectedProc)
|
||||
foundAThread = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// +build !android
|
||||
|
||||
// Test that pthread_cancel works as expected
|
||||
// (NPTL uses SIGRTMIN to implement thread cancellation)
|
||||
// (NPTL uses SIGRTMIN to implement thread cancelation)
|
||||
// See https://golang.org/issue/6997
|
||||
package cgotest
|
||||
|
||||
@@ -17,10 +17,8 @@ extern int CancelThread();
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
import "testing"
|
||||
import "time"
|
||||
|
||||
func test6997(t *testing.T) {
|
||||
r := C.StartThread()
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// Copyright 2014 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.
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
int get8148(void) {
|
||||
T t;
|
||||
t.i = 42;
|
||||
return issue8148Callback(&t);
|
||||
}
|
||||
@@ -10,7 +10,14 @@ package cgotest
|
||||
|
||||
/*
|
||||
typedef struct { int i; } T;
|
||||
int get8148(void);
|
||||
|
||||
int issue8148Callback(T*);
|
||||
|
||||
static int get() {
|
||||
T t;
|
||||
t.i = 42;
|
||||
return issue8148Callback(&t);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -20,5 +27,5 @@ func issue8148Callback(t *C.T) C.int {
|
||||
}
|
||||
|
||||
func Issue8148() int {
|
||||
return int(C.get8148())
|
||||
return int(C.get())
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
package cgotest
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -36,7 +37,7 @@ func TestCrossPackageTests(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "cgotest")
|
||||
GOPATH, err := ioutil.TempDir("", "cgotest")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +47,7 @@ func TestCrossPackageTests(t *testing.T) {
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgotest\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgotest\n"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Test that setgid does not hang on Linux.
|
||||
// Test that setgid does not hang on GNU/Linux.
|
||||
// See https://golang.org/issue/3871 for details.
|
||||
|
||||
package cgotest
|
||||
|
||||
@@ -899,10 +899,6 @@ static uint16_t issue31093F(uint16_t v) { return v; }
|
||||
// issue 32579
|
||||
typedef struct S32579 { unsigned char data[1]; } S32579;
|
||||
|
||||
// issue 37033, cgo.Handle
|
||||
extern void GoFunc37033(uintptr_t handle);
|
||||
void cFunc37033(uintptr_t handle) { GoFunc37033(handle); }
|
||||
|
||||
// issue 38649
|
||||
// Test that #define'd type aliases work.
|
||||
#define netbsd_gid unsigned int
|
||||
@@ -912,9 +908,6 @@ void cFunc37033(uintptr_t handle) { GoFunc37033(handle); }
|
||||
enum Enum40494 { X_40494 };
|
||||
union Union40494 { int x; };
|
||||
void issue40494(enum Enum40494 e, union Union40494* up) {}
|
||||
|
||||
// Issue 45451, bad handling of go:notinheap types.
|
||||
typedef struct issue45451Undefined issue45451;
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -927,7 +920,6 @@ import (
|
||||
"os/signal"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"runtime/cgo"
|
||||
"sync"
|
||||
"syscall"
|
||||
"testing"
|
||||
@@ -2238,23 +2230,6 @@ func test32579(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// issue 37033, check if cgo.Handle works properly
|
||||
|
||||
func testHandle(t *testing.T) {
|
||||
ch := make(chan int)
|
||||
|
||||
for i := 0; i < 42; i++ {
|
||||
h := cgo.NewHandle(ch)
|
||||
go func() {
|
||||
C.cFunc37033(C.uintptr_t(h))
|
||||
}()
|
||||
if v := <-ch; issue37033 != v {
|
||||
t.Fatalf("unexpected receiving value: got %d, want %d", v, issue37033)
|
||||
}
|
||||
h.Delete()
|
||||
}
|
||||
}
|
||||
|
||||
// issue 38649
|
||||
|
||||
var issue38649 C.netbsd_gid = 42
|
||||
@@ -2269,19 +2244,3 @@ var issue39877 *C.void = nil
|
||||
func Issue40494() {
|
||||
C.issue40494(C.enum_Enum40494(C.X_40494), (*C.union_Union40494)(nil))
|
||||
}
|
||||
|
||||
// Issue 45451.
|
||||
func test45451(t *testing.T) {
|
||||
var u *C.issue45451
|
||||
typ := reflect.ValueOf(u).Type().Elem()
|
||||
|
||||
// The type is undefined in C so allocating it should panic.
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
t.Error("expected panic")
|
||||
}
|
||||
}()
|
||||
|
||||
_ = reflect.New(typ)
|
||||
t.Errorf("reflect.New(%v) should have panicked", typ)
|
||||
}
|
||||
|
||||
2
misc/cgo/test/testdata/issue9400/asm_386.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_386.s
vendored
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build amd64 amd64p32
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
2
misc/cgo/test/testdata/issue9400/asm_arm.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_arm.s
vendored
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
2
misc/cgo/test/testdata/issue9400/asm_arm64.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_arm64.s
vendored
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build mips64 mips64le
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
2
misc/cgo/test/testdata/issue9400/asm_mipsx.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_mipsx.s
vendored
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build mips mipsle
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build ppc64 ppc64le
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build riscv64
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
2
misc/cgo/test/testdata/issue9400/asm_s390x.s
vendored
2
misc/cgo/test/testdata/issue9400/asm_s390x.s
vendored
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
void lockOSThreadC(void) {
|
||||
lockOSThreadCallback();
|
||||
}
|
||||
|
||||
void issue7978c(uint32_t *sync) {
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
|
||||
;
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
|
||||
;
|
||||
issue7978cb();
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
|
||||
;
|
||||
}
|
||||
|
||||
void f7665(void) {
|
||||
}
|
||||
@@ -12,7 +12,6 @@ package cgotest
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"runtime/cgo"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -27,6 +26,7 @@ import (
|
||||
extern void doAdd(int, int);
|
||||
|
||||
// issue 1328
|
||||
extern void BackIntoGo(void);
|
||||
void IntoC(void);
|
||||
|
||||
// issue 1560
|
||||
@@ -38,7 +38,11 @@ long long mysleep(int seconds);
|
||||
long long twoSleep(int);
|
||||
|
||||
// issue 3775
|
||||
void lockOSThreadC(void);
|
||||
void lockOSThreadCallback(void);
|
||||
inline static void lockOSThreadC(void)
|
||||
{
|
||||
lockOSThreadCallback();
|
||||
}
|
||||
int usleep(unsigned usec);
|
||||
|
||||
// issue 4054 part 2 - part 1 in test.go
|
||||
@@ -77,9 +81,21 @@ extern void f7665(void);
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void issue7978cb(void);
|
||||
|
||||
// use ugly atomic variable sync since that doesn't require calling back into
|
||||
// Go code or OS dependencies
|
||||
void issue7978c(uint32_t *sync);
|
||||
static void issue7978c(uint32_t *sync) {
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 0)
|
||||
;
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 2)
|
||||
;
|
||||
issue7978cb();
|
||||
__atomic_add_fetch(sync, 1, __ATOMIC_SEQ_CST);
|
||||
while(__atomic_load_n(sync, __ATOMIC_SEQ_CST) != 6)
|
||||
;
|
||||
}
|
||||
|
||||
// issue 8331 part 2 - part 1 in test.go
|
||||
// A typedef of an unnamed struct is the same struct when
|
||||
@@ -412,6 +428,9 @@ func test6907Go(t *testing.T) {
|
||||
|
||||
// issue 7665
|
||||
|
||||
//export f7665
|
||||
func f7665() {}
|
||||
|
||||
var bad7665 unsafe.Pointer = C.f7665
|
||||
var good7665 uintptr = uintptr(C.f7665)
|
||||
|
||||
@@ -539,17 +558,6 @@ func test31891(t *testing.T) {
|
||||
C.callIssue31891()
|
||||
}
|
||||
|
||||
// issue 37033, check if cgo.Handle works properly
|
||||
|
||||
var issue37033 = 42
|
||||
|
||||
//export GoFunc37033
|
||||
func GoFunc37033(handle C.uintptr_t) {
|
||||
h := cgo.Handle(handle)
|
||||
ch := h.Value().(chan int)
|
||||
ch <- issue37033
|
||||
}
|
||||
|
||||
// issue 38408
|
||||
// A typedef pointer can be used as the element type.
|
||||
// No runtime test; just make sure it compiles.
|
||||
|
||||
@@ -10,12 +10,15 @@ import (
|
||||
"debug/elf"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
@@ -52,7 +55,7 @@ func testMain(m *testing.M) int {
|
||||
// We need a writable GOPATH in which to run the tests.
|
||||
// Construct one in a temporary directory.
|
||||
var err error
|
||||
GOPATH, err = os.MkdirTemp("", "carchive_test")
|
||||
GOPATH, err = ioutil.TempDir("", "carchive_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
@@ -73,7 +76,7 @@ func testMain(m *testing.M) int {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module testcarchive\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module testcarchive\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
@@ -175,7 +178,7 @@ func genHeader(t *testing.T, header, dir string) {
|
||||
// The 'cgo' command generates a number of additional artifacts,
|
||||
// but we're only interested in the header.
|
||||
// Shunt the rest of the outputs to a temporary directory.
|
||||
objDir, err := os.MkdirTemp(GOPATH, "_obj")
|
||||
objDir, err := ioutil.TempDir(GOPATH, "_obj")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -251,7 +254,7 @@ var badLineRegexp = regexp.MustCompile(`(?m)^#line [0-9]+ "/.*$`)
|
||||
// the user and make the files change based on details of the location
|
||||
// of GOPATH.
|
||||
func checkLineComments(t *testing.T, hdrname string) {
|
||||
hdr, err := os.ReadFile(hdrname)
|
||||
hdr, err := ioutil.ReadFile(hdrname)
|
||||
if err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
t.Error(err)
|
||||
@@ -263,6 +266,173 @@ func checkLineComments(t *testing.T, hdrname string) {
|
||||
}
|
||||
}
|
||||
|
||||
// checkArchive verifies that the created library looks OK.
|
||||
// We just check a couple of things now, we can add more checks as needed.
|
||||
func checkArchive(t *testing.T, arname string) {
|
||||
t.Helper()
|
||||
|
||||
switch GOOS {
|
||||
case "aix", "darwin", "ios", "windows":
|
||||
// We don't have any checks for non-ELF libraries yet.
|
||||
if _, err := os.Stat(arname); err != nil {
|
||||
t.Errorf("archive %s does not exist: %v", arname, err)
|
||||
}
|
||||
default:
|
||||
checkELFArchive(t, arname)
|
||||
}
|
||||
}
|
||||
|
||||
// checkELFArchive checks an ELF archive.
|
||||
func checkELFArchive(t *testing.T, arname string) {
|
||||
t.Helper()
|
||||
|
||||
f, err := os.Open(arname)
|
||||
if err != nil {
|
||||
t.Errorf("archive %s does not exist: %v", arname, err)
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
// TODO(iant): put these in a shared package? But where?
|
||||
const (
|
||||
magic = "!<arch>\n"
|
||||
fmag = "`\n"
|
||||
|
||||
namelen = 16
|
||||
datelen = 12
|
||||
uidlen = 6
|
||||
gidlen = 6
|
||||
modelen = 8
|
||||
sizelen = 10
|
||||
fmaglen = 2
|
||||
hdrlen = namelen + datelen + uidlen + gidlen + modelen + sizelen + fmaglen
|
||||
)
|
||||
|
||||
type arhdr struct {
|
||||
name string
|
||||
date string
|
||||
uid string
|
||||
gid string
|
||||
mode string
|
||||
size string
|
||||
fmag string
|
||||
}
|
||||
|
||||
var magbuf [len(magic)]byte
|
||||
if _, err := io.ReadFull(f, magbuf[:]); err != nil {
|
||||
t.Errorf("%s: archive too short", arname)
|
||||
return
|
||||
}
|
||||
if string(magbuf[:]) != magic {
|
||||
t.Errorf("%s: incorrect archive magic string %q", arname, magbuf)
|
||||
}
|
||||
|
||||
off := int64(len(magic))
|
||||
for {
|
||||
if off&1 != 0 {
|
||||
var b [1]byte
|
||||
if _, err := f.Read(b[:]); err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
t.Errorf("%s: error skipping alignment byte at %d: %v", arname, off, err)
|
||||
}
|
||||
off++
|
||||
}
|
||||
|
||||
var hdrbuf [hdrlen]byte
|
||||
if _, err := io.ReadFull(f, hdrbuf[:]); err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
t.Errorf("%s: error reading archive header at %d: %v", arname, off, err)
|
||||
return
|
||||
}
|
||||
|
||||
var hdr arhdr
|
||||
hdrslice := hdrbuf[:]
|
||||
set := func(len int, ps *string) {
|
||||
*ps = string(bytes.TrimSpace(hdrslice[:len]))
|
||||
hdrslice = hdrslice[len:]
|
||||
}
|
||||
set(namelen, &hdr.name)
|
||||
set(datelen, &hdr.date)
|
||||
set(uidlen, &hdr.uid)
|
||||
set(gidlen, &hdr.gid)
|
||||
set(modelen, &hdr.mode)
|
||||
set(sizelen, &hdr.size)
|
||||
hdr.fmag = string(hdrslice[:fmaglen])
|
||||
hdrslice = hdrslice[fmaglen:]
|
||||
if len(hdrslice) != 0 {
|
||||
t.Fatalf("internal error: len(hdrslice) == %d", len(hdrslice))
|
||||
}
|
||||
|
||||
if hdr.fmag != fmag {
|
||||
t.Errorf("%s: invalid fmagic value %q at %d", arname, hdr.fmag, off)
|
||||
return
|
||||
}
|
||||
|
||||
size, err := strconv.ParseInt(hdr.size, 10, 64)
|
||||
if err != nil {
|
||||
t.Errorf("%s: error parsing size %q at %d: %v", arname, hdr.size, off, err)
|
||||
return
|
||||
}
|
||||
|
||||
off += hdrlen
|
||||
|
||||
switch hdr.name {
|
||||
case "__.SYMDEF", "/", "/SYM64/":
|
||||
// The archive symbol map.
|
||||
case "//", "ARFILENAMES/":
|
||||
// The extended name table.
|
||||
default:
|
||||
// This should be an ELF object.
|
||||
checkELFArchiveObject(t, arname, off, io.NewSectionReader(f, off, size))
|
||||
}
|
||||
|
||||
off += size
|
||||
if _, err := f.Seek(off, os.SEEK_SET); err != nil {
|
||||
t.Errorf("%s: failed to seek to %d: %v", arname, off, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// checkELFArchiveObject checks an object in an ELF archive.
|
||||
func checkELFArchiveObject(t *testing.T, arname string, off int64, obj io.ReaderAt) {
|
||||
t.Helper()
|
||||
|
||||
ef, err := elf.NewFile(obj)
|
||||
if err != nil {
|
||||
t.Errorf("%s: failed to open ELF file at %d: %v", arname, off, err)
|
||||
return
|
||||
}
|
||||
defer ef.Close()
|
||||
|
||||
// Verify section types.
|
||||
for _, sec := range ef.Sections {
|
||||
want := elf.SHT_NULL
|
||||
switch sec.Name {
|
||||
case ".text", ".data":
|
||||
want = elf.SHT_PROGBITS
|
||||
case ".bss":
|
||||
want = elf.SHT_NOBITS
|
||||
case ".symtab":
|
||||
want = elf.SHT_SYMTAB
|
||||
case ".strtab":
|
||||
want = elf.SHT_STRTAB
|
||||
case ".init_array":
|
||||
want = elf.SHT_INIT_ARRAY
|
||||
case ".fini_array":
|
||||
want = elf.SHT_FINI_ARRAY
|
||||
case ".preinit_array":
|
||||
want = elf.SHT_PREINIT_ARRAY
|
||||
}
|
||||
if want != elf.SHT_NULL && sec.Type != want {
|
||||
t.Errorf("%s: incorrect section type in elf file at %d for section %q: got %v want %v", arname, off, sec.Name, sec.Type, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestInstall(t *testing.T) {
|
||||
if !testWork {
|
||||
defer os.RemoveAll(filepath.Join(GOPATH, "pkg"))
|
||||
@@ -321,6 +491,7 @@ func TestEarlySignalHandler(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo2.h")
|
||||
checkArchive(t, "libgo2.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp"+exeSuffix, "main2.c", "libgo2.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -361,6 +532,7 @@ func TestSignalForwarding(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo2.h")
|
||||
checkArchive(t, "libgo2.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp"+exeSuffix, "main5.c", "libgo2.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -411,6 +583,7 @@ func TestSignalForwardingExternal(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo2.h")
|
||||
checkArchive(t, "libgo2.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp"+exeSuffix, "main5.c", "libgo2.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -528,6 +701,7 @@ func TestOsSignal(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo3.h")
|
||||
checkArchive(t, "libgo3.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp"+exeSuffix, "main3.c", "libgo3.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -565,6 +739,7 @@ func TestSigaltstack(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo4.h")
|
||||
checkArchive(t, "libgo4.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp"+exeSuffix, "main4.c", "libgo4.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -617,7 +792,7 @@ func TestExtar(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := strings.Replace(testar, "PWD", dir, 1)
|
||||
if err := os.WriteFile("testar", []byte(s), 0777); err != nil {
|
||||
if err := ioutil.WriteFile("testar", []byte(s), 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -752,6 +927,7 @@ func TestSIGPROF(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo6.h")
|
||||
checkArchive(t, "libgo6.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp6"+exeSuffix, "main6.c", "libgo6.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
@@ -775,7 +951,7 @@ func TestSIGPROF(t *testing.T) {
|
||||
// tool with -buildmode=c-archive, it passes -shared to the compiler,
|
||||
// so we override that. The go tool doesn't work this way, but Bazel
|
||||
// will likely do it in the future. And it ought to work. This test
|
||||
// was added because at one time it did not work on PPC Linux.
|
||||
// was added because at one time it did not work on PPC GNU/Linux.
|
||||
func TestCompileWithoutShared(t *testing.T) {
|
||||
// For simplicity, reuse the signal forwarding test.
|
||||
checkSignalForwardingTest(t)
|
||||
@@ -795,6 +971,7 @@ func TestCompileWithoutShared(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo2.h")
|
||||
checkArchive(t, "libgo2.a")
|
||||
|
||||
exe := "./testnoshared" + exeSuffix
|
||||
|
||||
@@ -899,6 +1076,7 @@ func TestManyCalls(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
checkLineComments(t, "libgo7.h")
|
||||
checkArchive(t, "libgo7.a")
|
||||
|
||||
ccArgs := append(cc, "-o", "testp7"+exeSuffix, "main7.c", "libgo7.a")
|
||||
if runtime.Compiler == "gccgo" {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"runtime/pprof"
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ import "C"
|
||||
|
||||
//export go_start_profile
|
||||
func go_start_profile() {
|
||||
pprof.StartCPUProfile(io.Discard)
|
||||
pprof.StartCPUProfile(ioutil.Discard)
|
||||
}
|
||||
|
||||
//export go_stop_profile
|
||||
|
||||
2
misc/cgo/testcarchive/testdata/main_unix.c
vendored
2
misc/cgo/testcarchive/testdata/main_unix.c
vendored
@@ -36,7 +36,7 @@ int install_handler() {
|
||||
return 2;
|
||||
}
|
||||
// gccgo does not set SA_ONSTACK for SIGSEGV.
|
||||
if (getenv("GCCGO") == NULL && (osa.sa_flags&SA_ONSTACK) == 0) {
|
||||
if (getenv("GCCGO") == "" && (osa.sa_flags&SA_ONSTACK) == 0) {
|
||||
fprintf(stderr, "Go runtime did not install signal handler\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"encoding/binary"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -124,7 +125,7 @@ func testMain(m *testing.M) int {
|
||||
// Copy testdata into GOPATH/src/testcshared, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "cshared_test")
|
||||
GOPATH, err := ioutil.TempDir("", "cshared_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
@@ -139,7 +140,7 @@ func testMain(m *testing.M) int {
|
||||
log.Panic(err)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
if err := os.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
@@ -259,7 +260,7 @@ func createHeaders() error {
|
||||
// The 'cgo' command generates a number of additional artifacts,
|
||||
// but we're only interested in the header.
|
||||
// Shunt the rest of the outputs to a temporary directory.
|
||||
objDir, err := os.MkdirTemp("", "testcshared_obj")
|
||||
objDir, err := ioutil.TempDir("", "testcshared_obj")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -292,60 +293,11 @@ func createHeaders() error {
|
||||
"-installsuffix", "testcshared",
|
||||
"-o", libgoname,
|
||||
filepath.Join(".", "libgo", "libgo.go")}
|
||||
if GOOS == "windows" && strings.HasSuffix(args[6], ".a") {
|
||||
args[6] = strings.TrimSuffix(args[6], ".a") + ".dll"
|
||||
}
|
||||
cmd = exec.Command(args[0], args[1:]...)
|
||||
out, err = cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("command failed: %v\n%v\n%s\n", args, err, out)
|
||||
}
|
||||
if GOOS == "windows" {
|
||||
// We can't simply pass -Wl,--out-implib, because this relies on having imports from multiple packages,
|
||||
// which results in the linkers output implib getting overwritten at each step. So instead build the
|
||||
// import library the traditional way, using a def file.
|
||||
err = os.WriteFile("libgo.def",
|
||||
[]byte("LIBRARY libgo.dll\nEXPORTS\n\tDidInitRun\n\tDidMainRun\n\tDivu\n\tFromPkg\n\t_cgo_dummy_export\n"),
|
||||
0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to write def file: %v", err)
|
||||
}
|
||||
out, err = exec.Command(cc[0], append(cc[1:], "-print-prog-name=dlltool")...).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to find dlltool path: %v\n%s\n", err, out)
|
||||
}
|
||||
args := []string{strings.TrimSpace(string(out)), "-D", args[6], "-l", libgoname, "-d", "libgo.def"}
|
||||
|
||||
// This is an unfortunate workaround for https://github.com/mstorsjo/llvm-mingw/issues/205 in which
|
||||
// we basically reimplement the contents of the dlltool.sh wrapper: https://git.io/JZFlU
|
||||
dlltoolContents, err := os.ReadFile(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to read dlltool: %v\n", err)
|
||||
}
|
||||
if bytes.HasPrefix(dlltoolContents, []byte("#!/bin/sh")) && bytes.Contains(dlltoolContents, []byte("llvm-dlltool")) {
|
||||
base, name := filepath.Split(args[0])
|
||||
args[0] = filepath.Join(base, "llvm-dlltool")
|
||||
var machine string
|
||||
switch strings.SplitN(name, "-", 2)[0] {
|
||||
case "i686":
|
||||
machine = "i386"
|
||||
case "x86_64":
|
||||
machine = "i386:x86-64"
|
||||
case "armv7":
|
||||
machine = "arm"
|
||||
case "aarch64":
|
||||
machine = "arm64"
|
||||
}
|
||||
if len(machine) > 0 {
|
||||
args = append(args, "-m", machine)
|
||||
}
|
||||
}
|
||||
|
||||
out, err = exec.Command(args[0], args[1:]...).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to run dlltool to create import library: %v\n%s\n", err, out)
|
||||
}
|
||||
}
|
||||
|
||||
if runtime.GOOS != GOOS && GOOS == "android" {
|
||||
args = append(adbCmd(), "push", libgoname, fmt.Sprintf("%s/%s", androiddir, libgoname))
|
||||
@@ -429,7 +381,7 @@ func main() {
|
||||
|
||||
srcfile := filepath.Join(tmpdir, "test.go")
|
||||
objfile := filepath.Join(tmpdir, "test.dll")
|
||||
if err := os.WriteFile(srcfile, []byte(prog), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(srcfile, []byte(prog), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
argv := []string{"build", "-buildmode=c-shared"}
|
||||
@@ -449,7 +401,7 @@ func main() {
|
||||
defer f.Close()
|
||||
section := f.Section(".edata")
|
||||
if section == nil {
|
||||
t.Skip(".edata section is not present")
|
||||
t.Fatalf(".edata section is not present")
|
||||
}
|
||||
|
||||
// TODO: deduplicate this struct from cmd/link/internal/ld/pe.go
|
||||
@@ -691,7 +643,7 @@ func TestPIE(t *testing.T) {
|
||||
|
||||
// Test that installing a second time recreates the header file.
|
||||
func TestCachedInstall(t *testing.T) {
|
||||
tmpdir, err := os.MkdirTemp("", "cshared")
|
||||
tmpdir, err := ioutil.TempDir("", "cshared")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -767,14 +719,14 @@ func TestCachedInstall(t *testing.T) {
|
||||
// copyFile copies src to dst.
|
||||
func copyFile(t *testing.T, dst, src string) {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile(src)
|
||||
data, err := ioutil.ReadFile(src)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(dst, data, 0666); err != nil {
|
||||
if err := ioutil.WriteFile(dst, data, 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -791,19 +743,14 @@ func TestGo2C2Go(t *testing.T) {
|
||||
|
||||
t.Parallel()
|
||||
|
||||
tmpdir, err := os.MkdirTemp("", "cshared-TestGo2C2Go")
|
||||
tmpdir, err := ioutil.TempDir("", "cshared-TestGo2C2Go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmpdir)
|
||||
|
||||
lib := filepath.Join(tmpdir, "libtestgo2c2go."+libSuffix)
|
||||
var env []string
|
||||
if GOOS == "windows" && strings.HasSuffix(lib, ".a") {
|
||||
env = append(env, "CGO_LDFLAGS=-Wl,--out-implib,"+lib, "CGO_LDFLAGS_ALLOW=.*")
|
||||
lib = strings.TrimSuffix(lib, ".a") + ".dll"
|
||||
}
|
||||
run(t, env, "go", "build", "-buildmode=c-shared", "-o", lib, "./go2c2go/go")
|
||||
run(t, nil, "go", "build", "-buildmode=c-shared", "-o", lib, "./go2c2go/go")
|
||||
|
||||
cgoCflags := os.Getenv("CGO_CFLAGS")
|
||||
if cgoCflags != "" {
|
||||
|
||||
@@ -6,6 +6,7 @@ package testgodefs
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -33,7 +34,7 @@ func TestGoDefs(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
gopath, err := os.MkdirTemp("", "testgodefs-gopath")
|
||||
gopath, err := ioutil.TempDir("", "testgodefs-gopath")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -57,20 +58,20 @@ func TestGoDefs(t *testing.T) {
|
||||
t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
main, err := os.ReadFile(filepath.Join("testdata", "main.go"))
|
||||
main, err := ioutil.ReadFile(filepath.Join("testdata", "main.go"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -30,28 +31,15 @@ func TestMain(m *testing.M) {
|
||||
os.Exit(testMain(m))
|
||||
}
|
||||
|
||||
// tmpDir is used to cleanup logged commands -- s/tmpDir/$TMPDIR/
|
||||
var tmpDir string
|
||||
|
||||
// prettyPrintf prints lines with tmpDir sanitized.
|
||||
func prettyPrintf(format string, args ...interface{}) {
|
||||
s := fmt.Sprintf(format, args...)
|
||||
if tmpDir != "" {
|
||||
s = strings.ReplaceAll(s, tmpDir, "$TMPDIR")
|
||||
}
|
||||
fmt.Print(s)
|
||||
}
|
||||
|
||||
func testMain(m *testing.M) int {
|
||||
// Copy testdata into GOPATH/src/testplugin, along with a go.mod file
|
||||
// declaring the same path.
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "plugin_test")
|
||||
GOPATH, err := ioutil.TempDir("", "plugin_test")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
defer os.RemoveAll(GOPATH)
|
||||
tmpDir = GOPATH
|
||||
|
||||
modRoot := filepath.Join(GOPATH, "src", "testplugin")
|
||||
altRoot := filepath.Join(GOPATH, "alt", "src", "testplugin")
|
||||
@@ -62,20 +50,14 @@ func testMain(m *testing.M) int {
|
||||
if err := overlayDir(dstRoot, srcRoot); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
prettyPrintf("mkdir -p %s\n", dstRoot)
|
||||
prettyPrintf("rsync -a %s/ %s\n", srcRoot, dstRoot)
|
||||
|
||||
if err := os.WriteFile(filepath.Join(dstRoot, "go.mod"), []byte("module testplugin\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(dstRoot, "go.mod"), []byte("module testplugin\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
prettyPrintf("echo 'module testplugin' > %s/go.mod\n", dstRoot)
|
||||
}
|
||||
|
||||
os.Setenv("GOPATH", filepath.Join(GOPATH, "alt"))
|
||||
if err := os.Chdir(altRoot); err != nil {
|
||||
log.Panic(err)
|
||||
} else {
|
||||
prettyPrintf("cd %s\n", altRoot)
|
||||
}
|
||||
os.Setenv("PWD", altRoot)
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o", filepath.Join(modRoot, "plugin-mismatch.so"), "./plugin-mismatch")
|
||||
@@ -83,8 +65,6 @@ func testMain(m *testing.M) int {
|
||||
os.Setenv("GOPATH", GOPATH)
|
||||
if err := os.Chdir(modRoot); err != nil {
|
||||
log.Panic(err)
|
||||
} else {
|
||||
prettyPrintf("cd %s\n", modRoot)
|
||||
}
|
||||
os.Setenv("PWD", modRoot)
|
||||
|
||||
@@ -92,14 +72,13 @@ func testMain(m *testing.M) int {
|
||||
|
||||
goCmd(nil, "build", "-buildmode=plugin", "./plugin1")
|
||||
goCmd(nil, "build", "-buildmode=plugin", "./plugin2")
|
||||
so, err := os.ReadFile("plugin2.so")
|
||||
so, err := ioutil.ReadFile("plugin2.so")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := os.WriteFile("plugin2-dup.so", so, 0444); err != nil {
|
||||
if err := ioutil.WriteFile("plugin2-dup.so", so, 0444); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
prettyPrintf("cp plugin2.so plugin2-dup.so\n")
|
||||
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o=sub/plugin1.so", "./sub/plugin1")
|
||||
goCmd(nil, "build", "-buildmode=plugin", "-o=unnamed1.so", "./unnamed1/main.go")
|
||||
@@ -116,53 +95,8 @@ func goCmd(t *testing.T, op string, args ...string) {
|
||||
run(t, "go", append([]string{op, "-gcflags", gcflags}, args...)...)
|
||||
}
|
||||
|
||||
// escape converts a string to something suitable for a shell command line.
|
||||
func escape(s string) string {
|
||||
s = strings.Replace(s, "\\", "\\\\", -1)
|
||||
s = strings.Replace(s, "'", "\\'", -1)
|
||||
// Conservative guess at characters that will force quoting
|
||||
if s == "" || strings.ContainsAny(s, "\\ ;#*&$~?!|[]()<>{}`") {
|
||||
s = "'" + s + "'"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// asCommandLine renders cmd as something that could be copy-and-pasted into a command line
|
||||
func asCommandLine(cwd string, cmd *exec.Cmd) string {
|
||||
s := "("
|
||||
if cmd.Dir != "" && cmd.Dir != cwd {
|
||||
s += "cd" + escape(cmd.Dir) + ";"
|
||||
}
|
||||
for _, e := range cmd.Env {
|
||||
if !strings.HasPrefix(e, "PATH=") &&
|
||||
!strings.HasPrefix(e, "HOME=") &&
|
||||
!strings.HasPrefix(e, "USER=") &&
|
||||
!strings.HasPrefix(e, "SHELL=") {
|
||||
s += " "
|
||||
s += escape(e)
|
||||
}
|
||||
}
|
||||
// These EVs are relevant to this test.
|
||||
for _, e := range os.Environ() {
|
||||
if strings.HasPrefix(e, "PWD=") ||
|
||||
strings.HasPrefix(e, "GOPATH=") ||
|
||||
strings.HasPrefix(e, "LD_LIBRARY_PATH=") {
|
||||
s += " "
|
||||
s += escape(e)
|
||||
}
|
||||
}
|
||||
for _, a := range cmd.Args {
|
||||
s += " "
|
||||
s += escape(a)
|
||||
}
|
||||
s += " )"
|
||||
return s
|
||||
}
|
||||
|
||||
func run(t *testing.T, bin string, args ...string) string {
|
||||
cmd := exec.Command(bin, args...)
|
||||
cmdLine := asCommandLine(".", cmd)
|
||||
prettyPrintf("%s\n", cmdLine)
|
||||
cmd.Stderr = new(strings.Builder)
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
@@ -263,17 +197,6 @@ func TestIssue25756(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test with main using -buildmode=pie with plugin for issue #43228
|
||||
func TestIssue25756pie(t *testing.T) {
|
||||
if os.Getenv("GO_BUILDER_NAME") == "darwin-arm64-11_0-toothrot" {
|
||||
t.Skip("broken on darwin/arm64 builder in sharded mode; see issue 46239")
|
||||
}
|
||||
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "life.so", "./issue25756/plugin")
|
||||
goCmd(t, "build", "-buildmode=pie", "-o", "issue25756pie.exe", "./issue25756/main.go")
|
||||
run(t, "./issue25756pie.exe")
|
||||
}
|
||||
|
||||
func TestMethod(t *testing.T) {
|
||||
// Exported symbol's method must be live.
|
||||
goCmd(t, "build", "-buildmode=plugin", "-o", "plugin.so", "./method/plugin.go")
|
||||
|
||||
2
misc/cgo/testplugin/testdata/method2/main.go
vendored
2
misc/cgo/testplugin/testdata/method2/main.go
vendored
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
var t p.T
|
||||
|
||||
type I interface{ M() }
|
||||
type I interface { M() }
|
||||
|
||||
func main() {
|
||||
pl, err := plugin.Open("method2.so")
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -35,7 +36,7 @@ func requireOvercommit(t *testing.T) {
|
||||
|
||||
overcommit.Once.Do(func() {
|
||||
var out []byte
|
||||
out, overcommit.err = os.ReadFile("/proc/sys/vm/overcommit_memory")
|
||||
out, overcommit.err = ioutil.ReadFile("/proc/sys/vm/overcommit_memory")
|
||||
if overcommit.err != nil {
|
||||
return
|
||||
}
|
||||
@@ -312,14 +313,14 @@ int main() {
|
||||
`)
|
||||
|
||||
func (c *config) checkCSanitizer() (skip bool, err error) {
|
||||
dir, err := os.MkdirTemp("", c.sanitizer)
|
||||
dir, err := ioutil.TempDir("", c.sanitizer)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("failed to create temp directory: %v", err)
|
||||
}
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
src := filepath.Join(dir, "return0.c")
|
||||
if err := os.WriteFile(src, cMain, 0600); err != nil {
|
||||
if err := ioutil.WriteFile(src, cMain, 0600); err != nil {
|
||||
return false, fmt.Errorf("failed to write C source file: %v", err)
|
||||
}
|
||||
|
||||
@@ -417,7 +418,7 @@ func (d *tempDir) Join(name string) string {
|
||||
|
||||
func newTempDir(t *testing.T) *tempDir {
|
||||
t.Helper()
|
||||
dir, err := os.MkdirTemp("", filepath.Dir(t.Name()))
|
||||
dir, err := ioutil.TempDir("", filepath.Dir(t.Name()))
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create temp dir: %v", err)
|
||||
}
|
||||
@@ -439,14 +440,3 @@ func hangProneCmd(name string, arg ...string) *exec.Cmd {
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
// mSanSupported is a copy of the function cmd/internal/sys.MSanSupported,
|
||||
// because the internal pacakage can't be used here.
|
||||
func mSanSupported(goos, goarch string) bool {
|
||||
switch goos {
|
||||
case "linux":
|
||||
return goarch == "amd64" || goarch == "arm64"
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ package sanitizers_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@@ -19,12 +19,6 @@ func TestShared(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
GOARCH, err := goEnv("GOARCH")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
libExt := "so"
|
||||
if GOOS == "darwin" {
|
||||
libExt = "dylib"
|
||||
@@ -47,11 +41,6 @@ func TestShared(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
tc := tc
|
||||
name := strings.TrimSuffix(tc.src, ".go")
|
||||
//The memory sanitizer tests require support for the -msan option.
|
||||
if tc.sanitizer == "memory" && !mSanSupported(GOOS, GOARCH) {
|
||||
t.Logf("skipping %s test on %s/%s; -msan option is not supported.", name, GOOS, GOARCH)
|
||||
continue
|
||||
}
|
||||
t.Run(name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
config := configure(tc.sanitizer)
|
||||
@@ -64,7 +53,7 @@ func TestShared(t *testing.T) {
|
||||
mustRun(t, config.goCmd("build", "-buildmode=c-shared", "-o", lib, srcPath(tc.src)))
|
||||
|
||||
cSrc := dir.Join("main.c")
|
||||
if err := os.WriteFile(cSrc, cMain, 0600); err != nil {
|
||||
if err := ioutil.WriteFile(cSrc, cMain, 0600); err != nil {
|
||||
t.Fatalf("failed to write C source file: %v", err)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,19 +10,6 @@ import (
|
||||
)
|
||||
|
||||
func TestMSAN(t *testing.T) {
|
||||
goos, err := goEnv("GOOS")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
goarch, err := goEnv("GOARCH")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The msan tests require support for the -msan option.
|
||||
if !mSanSupported(goos, goarch) {
|
||||
t.Skipf("skipping on %s/%s; -msan option is not supported.", goos, goarch)
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
requireOvercommit(t)
|
||||
config := configure("memory")
|
||||
@@ -42,7 +29,6 @@ func TestMSAN(t *testing.T) {
|
||||
{src: "msan5.go"},
|
||||
{src: "msan6.go"},
|
||||
{src: "msan7.go"},
|
||||
{src: "msan8.go"},
|
||||
{src: "msan_fail.go", wantErr: true},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
|
||||
109
misc/cgo/testsanitizers/testdata/msan8.go
vendored
109
misc/cgo/testsanitizers/testdata/msan8.go
vendored
@@ -1,109 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
package main
|
||||
|
||||
/*
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sanitizer/msan_interface.h>
|
||||
|
||||
// cgoTracebackArg is the type of the argument passed to msanGoTraceback.
|
||||
struct cgoTracebackArg {
|
||||
uintptr_t context;
|
||||
uintptr_t sigContext;
|
||||
uintptr_t* buf;
|
||||
uintptr_t max;
|
||||
};
|
||||
|
||||
// msanGoTraceback is registered as the cgo traceback function.
|
||||
// This will be called when a signal occurs.
|
||||
void msanGoTraceback(void* parg) {
|
||||
struct cgoTracebackArg* arg = (struct cgoTracebackArg*)(parg);
|
||||
arg->buf[0] = 0;
|
||||
}
|
||||
|
||||
// msanGoWait will be called with all registers undefined as far as
|
||||
// msan is concerned. It just waits for a signal.
|
||||
// Because the registers are msan-undefined, the signal handler will
|
||||
// be invoked with all registers msan-undefined.
|
||||
__attribute__((noinline))
|
||||
void msanGoWait(unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a6) {
|
||||
sigset_t mask;
|
||||
|
||||
sigemptyset(&mask);
|
||||
sigsuspend(&mask);
|
||||
}
|
||||
|
||||
// msanGoSignalThread is the thread ID of the msanGoLoop thread.
|
||||
static pthread_t msanGoSignalThread;
|
||||
|
||||
// msanGoSignalThreadSet is used to record that msanGoSignalThread
|
||||
// has been initialized. This is accessed atomically.
|
||||
static int32_t msanGoSignalThreadSet;
|
||||
|
||||
// uninit is explicitly poisoned, so that we can make all registers
|
||||
// undefined by calling msanGoWait.
|
||||
static unsigned long uninit;
|
||||
|
||||
// msanGoLoop loops calling msanGoWait, with the arguments passed
|
||||
// such that msan thinks that they are undefined. msan permits
|
||||
// undefined values to be used as long as they are not used to
|
||||
// for conditionals or for memory access.
|
||||
void msanGoLoop() {
|
||||
int i;
|
||||
|
||||
msanGoSignalThread = pthread_self();
|
||||
__atomic_store_n(&msanGoSignalThreadSet, 1, __ATOMIC_SEQ_CST);
|
||||
|
||||
// Force uninit to be undefined for msan.
|
||||
__msan_poison(&uninit, sizeof uninit);
|
||||
for (i = 0; i < 100; i++) {
|
||||
msanGoWait(uninit, uninit, uninit, uninit, uninit, uninit);
|
||||
}
|
||||
}
|
||||
|
||||
// msanGoReady returns whether msanGoSignalThread is set.
|
||||
int msanGoReady() {
|
||||
return __atomic_load_n(&msanGoSignalThreadSet, __ATOMIC_SEQ_CST) != 0;
|
||||
}
|
||||
|
||||
// msanGoSendSignal sends a signal to the msanGoLoop thread.
|
||||
void msanGoSendSignal() {
|
||||
pthread_kill(msanGoSignalThread, SIGWINCH);
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
runtime.SetCgoTraceback(0, C.msanGoTraceback, nil, nil)
|
||||
|
||||
c := make(chan bool)
|
||||
go func() {
|
||||
defer func() { c <- true }()
|
||||
C.msanGoLoop()
|
||||
}()
|
||||
|
||||
for C.msanGoReady() == 0 {
|
||||
time.Sleep(time.Microsecond)
|
||||
}
|
||||
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
case <-c:
|
||||
break loop
|
||||
default:
|
||||
C.msanGoSendSignal()
|
||||
time.Sleep(time.Microsecond)
|
||||
}
|
||||
}
|
||||
}
|
||||
4
misc/cgo/testsanitizers/testdata/tsan9.go
vendored
4
misc/cgo/testsanitizers/testdata/tsan9.go
vendored
@@ -44,7 +44,7 @@ void spin() {
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"runtime/pprof"
|
||||
"time"
|
||||
)
|
||||
@@ -60,7 +60,7 @@ func goSpin() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
pprof.StartCPUProfile(io.Discard)
|
||||
pprof.StartCPUProfile(ioutil.Discard)
|
||||
go C.spin()
|
||||
goSpin()
|
||||
pprof.StopCPUProfile()
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -89,7 +90,7 @@ func goCmd(t *testing.T, args ...string) string {
|
||||
|
||||
// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit).
|
||||
func testMain(m *testing.M) (int, error) {
|
||||
workDir, err := os.MkdirTemp("", "shared_test")
|
||||
workDir, err := ioutil.TempDir("", "shared_test")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -176,7 +177,7 @@ func cloneTestdataModule(gopath string) (string, error) {
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
return "", err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return modRoot, nil
|
||||
@@ -317,7 +318,7 @@ func TestShlibnameFiles(t *testing.T) {
|
||||
}
|
||||
for _, pkg := range pkgs {
|
||||
shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname")
|
||||
contentsb, err := os.ReadFile(shlibnamefile)
|
||||
contentsb, err := ioutil.ReadFile(shlibnamefile)
|
||||
if err != nil {
|
||||
t.Errorf("error reading shlibnamefile for %s: %v", pkg, err)
|
||||
continue
|
||||
@@ -790,7 +791,7 @@ func resetFileStamps() {
|
||||
// It also sets the time of the file, so that we can see if it is rewritten.
|
||||
func touch(t *testing.T, path string) (cleanup func()) {
|
||||
t.Helper()
|
||||
data, err := os.ReadFile(path)
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -836,14 +837,14 @@ func touch(t *testing.T, path string) (cleanup func()) {
|
||||
// user-writable.
|
||||
perm := fi.Mode().Perm() | 0200
|
||||
|
||||
if err := os.WriteFile(path, data, perm); err != nil {
|
||||
if err := ioutil.WriteFile(path, data, perm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Chtimes(path, nearlyNew, nearlyNew); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return func() {
|
||||
if err := os.WriteFile(path, old, perm); err != nil {
|
||||
if err := ioutil.WriteFile(path, old, perm); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
2
misc/cgo/testshared/testdata/depBase/asm.s
vendored
2
misc/cgo/testshared/testdata/depBase/asm.s
vendored
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build gc
|
||||
// +build !gccgo
|
||||
|
||||
package depBase
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
package so_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -36,7 +37,7 @@ func requireTestSOSupported(t *testing.T) {
|
||||
func TestSO(t *testing.T) {
|
||||
requireTestSOSupported(t)
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "cgosotest")
|
||||
GOPATH, err := ioutil.TempDir("", "cgosotest")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +47,7 @@ func TestSO(t *testing.T) {
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
@@ -79,10 +80,6 @@ func TestSO(t *testing.T) {
|
||||
case "windows":
|
||||
ext = "dll"
|
||||
args = append(args, "-DEXPORT_DLL")
|
||||
// At least in mingw-clang it is not permitted to just name a .dll
|
||||
// on the command line. You must name the corresponding import
|
||||
// library instead, even though the dll is used when the executable is run.
|
||||
args = append(args, "-Wl,-out-implib,libcgosotest.a")
|
||||
case "aix":
|
||||
ext = "so.1"
|
||||
}
|
||||
|
||||
2
misc/cgo/testso/testdata/cgoso.go
vendored
2
misc/cgo/testso/testdata/cgoso.go
vendored
@@ -14,7 +14,7 @@ package cgosotest
|
||||
#cgo solaris LDFLAGS: -L. -lcgosotest
|
||||
#cgo netbsd LDFLAGS: -L. libcgosotest.so
|
||||
#cgo darwin LDFLAGS: -L. libcgosotest.dylib
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.a
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.dll
|
||||
#cgo aix LDFLAGS: -L. -l cgosotest
|
||||
|
||||
void init(void);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
package so_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -36,7 +37,7 @@ func requireTestSOSupported(t *testing.T) {
|
||||
func TestSO(t *testing.T) {
|
||||
requireTestSOSupported(t)
|
||||
|
||||
GOPATH, err := os.MkdirTemp("", "cgosotest")
|
||||
GOPATH, err := ioutil.TempDir("", "cgosotest")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +47,7 @@ func TestSO(t *testing.T) {
|
||||
if err := overlayDir(modRoot, "testdata"); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module cgosotest\n"), 0666); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
@@ -79,10 +80,6 @@ func TestSO(t *testing.T) {
|
||||
case "windows":
|
||||
ext = "dll"
|
||||
args = append(args, "-DEXPORT_DLL")
|
||||
// At least in mingw-clang it is not permitted to just name a .dll
|
||||
// on the command line. You must name the corresponding import
|
||||
// library instead, even though the dll is used when the executable is run.
|
||||
args = append(args, "-Wl,-out-implib,libcgosotest.a")
|
||||
case "aix":
|
||||
ext = "so.1"
|
||||
}
|
||||
|
||||
2
misc/cgo/testsovar/testdata/cgoso.go
vendored
2
misc/cgo/testsovar/testdata/cgoso.go
vendored
@@ -18,7 +18,7 @@ package cgosotest
|
||||
#cgo solaris LDFLAGS: -L. -lcgosotest
|
||||
#cgo netbsd LDFLAGS: -L. libcgosotest.so
|
||||
#cgo darwin LDFLAGS: -L. libcgosotest.dylib
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.a
|
||||
#cgo windows LDFLAGS: -L. libcgosotest.dll
|
||||
#cgo aix LDFLAGS: -L. -l cgosotest
|
||||
|
||||
#include "cgoso_c.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<a href="#" url="https://golang.org/pkg/">pkg</a> id/name:</small>
|
||||
<form style='margin: 0' id='navform'><nobr><input id="inputbox" size=10 tabindex=1 /><input type="submit" value="go" /></nobr></form>
|
||||
<small>Also: <a href="#" url="https://build.golang.org">buildbots</a>
|
||||
<a href="#" url="https://github.com/golang/go">GitHub</a>
|
||||
<a href="#" url="https://github.com/golang/go">Github</a>
|
||||
</small>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"bytes"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
@@ -37,7 +38,7 @@ func main() {
|
||||
fmt.Println("# will be overwritten when running Go programs.")
|
||||
for _, mp := range mps {
|
||||
fmt.Println()
|
||||
f, err := os.CreateTemp("", "go_ios_detect_")
|
||||
f, err := ioutil.TempFile("", "go_ios_detect_")
|
||||
check(err)
|
||||
fname := f.Name()
|
||||
defer os.Remove(fname)
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
"fmt"
|
||||
"go/build"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
@@ -78,7 +79,7 @@ func main() {
|
||||
|
||||
func runMain() (int, error) {
|
||||
var err error
|
||||
tmpdir, err = os.MkdirTemp("", "go_ios_exec_")
|
||||
tmpdir, err = ioutil.TempDir("", "go_ios_exec_")
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
@@ -204,13 +205,13 @@ func assembleApp(appdir, bin string) error {
|
||||
}
|
||||
|
||||
entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist")
|
||||
if err := os.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
|
||||
if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist(pkgpath)), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -144,7 +144,7 @@ func doCrawl(url string) error {
|
||||
if res.StatusCode != 200 {
|
||||
return errors.New(res.Status)
|
||||
}
|
||||
slurp, err := io.ReadAll(res.Body)
|
||||
slurp, err := ioutil.ReadAll(res.Body)
|
||||
res.Body.Close()
|
||||
if err != nil {
|
||||
log.Fatalf("Error reading %s body: %v", url, err)
|
||||
|
||||
@@ -13,6 +13,7 @@ package reboot_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -22,7 +23,7 @@ import (
|
||||
|
||||
func TestExperimentToolID(t *testing.T) {
|
||||
// Set up GOROOT
|
||||
goroot, err := os.MkdirTemp("", "experiment-goroot")
|
||||
goroot, err := ioutil.TempDir("", "experiment-goroot")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -33,13 +34,13 @@ func TestExperimentToolID(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filepath.Join(goroot, "VERSION"), []byte("go1.999"), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(goroot, "VERSION"), []byte("go1.999"), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
env := append(os.Environ(), "GOROOT=", "GOROOT_BOOTSTRAP="+runtime.GOROOT())
|
||||
|
||||
// Use a clean cache.
|
||||
gocache, err := os.MkdirTemp("", "experiment-gocache")
|
||||
gocache, err := ioutil.TempDir("", "experiment-gocache")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
package reboot_test
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@@ -15,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func TestRepeatBootstrap(t *testing.T) {
|
||||
goroot, err := os.MkdirTemp("", "reboot-goroot")
|
||||
goroot, err := ioutil.TempDir("", "reboot-goroot")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -26,7 +27,7 @@ func TestRepeatBootstrap(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.WriteFile(filepath.Join(goroot, "VERSION"), []byte(runtime.Version()), 0666); err != nil {
|
||||
if err := ioutil.WriteFile(filepath.Join(goroot, "VERSION"), []byte(runtime.Version()), 0666); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -993,13 +993,13 @@
|
||||
</style>
|
||||
<div style="padding-right: 200px">
|
||||
<div style="float:right; border-style: solid; border-width: 1px; padding:20px">
|
||||
X no feedback<br>
|
||||
0 uninitialized<br>
|
||||
. premonomorphic<br>
|
||||
1 monomorphic<br>
|
||||
^ recompute handler<br>
|
||||
P polymorphic<br>
|
||||
N megamorphic<br>
|
||||
X no feedback<br/>
|
||||
0 uninitialized<br/>
|
||||
. premonomorphic<br/>
|
||||
1 monomorphic<br/>
|
||||
^ recompute handler<br/>
|
||||
P polymorphic<br/>
|
||||
N megamorphic<br/>
|
||||
G generic
|
||||
</div>
|
||||
</div>
|
||||
@@ -3596,7 +3596,7 @@
|
||||
<div id="pipeline_per_frame_container">
|
||||
<div class="subtitle">Graphics Pipeline and Raster Tasks</div>
|
||||
<div class="description">
|
||||
When raster tasks are completed in comparison to the rest of the graphics pipeline.<br>
|
||||
When raster tasks are completed in comparison to the rest of the graphics pipeline.<br/>
|
||||
Only pages where raster tasks are completed after beginFrame is issued are included.
|
||||
</div>
|
||||
<tr-v-ui-raster-visualization id="rasterVisualization">
|
||||
|
||||
@@ -296,8 +296,8 @@
|
||||
setInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);
|
||||
},
|
||||
|
||||
// func walltime() (sec int64, nsec int32)
|
||||
"runtime.walltime": (sp) => {
|
||||
// func walltime1() (sec int64, nsec int32)
|
||||
"runtime.walltime1": (sp) => {
|
||||
sp >>>= 0;
|
||||
const msec = (new Date).getTime();
|
||||
setInt64(sp + 8, msec / 1000);
|
||||
@@ -401,7 +401,6 @@
|
||||
storeValue(sp + 56, result);
|
||||
this.mem.setUint8(sp + 64, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 56, err);
|
||||
this.mem.setUint8(sp + 64, 0);
|
||||
}
|
||||
@@ -418,7 +417,6 @@
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
@@ -435,7 +433,6 @@
|
||||
storeValue(sp + 40, result);
|
||||
this.mem.setUint8(sp + 48, 1);
|
||||
} catch (err) {
|
||||
sp = this._inst.exports.getsp() >>> 0; // see comment above
|
||||
storeValue(sp + 40, err);
|
||||
this.mem.setUint8(sp + 48, 0);
|
||||
}
|
||||
@@ -567,6 +564,13 @@
|
||||
offset += 8;
|
||||
});
|
||||
|
||||
// The linker guarantees global data starts from at least wasmMinDataAddr.
|
||||
// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.
|
||||
const wasmMinDataAddr = 4096 + 8192;
|
||||
if (offset >= wasmMinDataAddr) {
|
||||
throw new Error("total length of command line and environment variables exceeds limit");
|
||||
}
|
||||
|
||||
this._inst.exports.run(argc, argv);
|
||||
if (this.exited) {
|
||||
this._resolveExitPromise();
|
||||
|
||||
2
robots.txt
Normal file
2
robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || linux || dragonfly || openbsd || solaris
|
||||
// +build aix linux dragonfly openbsd solaris
|
||||
|
||||
package tar
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin || freebsd || netbsd
|
||||
// +build darwin freebsd netbsd
|
||||
|
||||
package tar
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || linux || darwin || dragonfly || freebsd || openbsd || netbsd || solaris
|
||||
// +build aix linux darwin dragonfly freebsd openbsd netbsd solaris
|
||||
|
||||
package tar
|
||||
|
||||
@@ -262,11 +262,16 @@ func TestFileInfoHeaderDir(t *testing.T) {
|
||||
func TestFileInfoHeaderSymlink(t *testing.T) {
|
||||
testenv.MustHaveSymlink(t)
|
||||
|
||||
tmpdir := t.TempDir()
|
||||
tmpdir, err := os.MkdirTemp("", "TestFileInfoHeaderSymlink")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tmpdir)
|
||||
|
||||
link := filepath.Join(tmpdir, "link")
|
||||
target := tmpdir
|
||||
if err := os.Symlink(target, link); err != nil {
|
||||
err = os.Symlink(target, link)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
fi, err := os.Lstat(link)
|
||||
|
||||
@@ -52,9 +52,12 @@ type File struct {
|
||||
FileHeader
|
||||
zip *Reader
|
||||
zipr io.ReaderAt
|
||||
zipsize int64
|
||||
headerOffset int64
|
||||
zip64 bool // zip64 extended information extra field presence
|
||||
descErr error // error reading the data descriptor during init
|
||||
}
|
||||
|
||||
func (f *File) hasDataDescriptor() bool {
|
||||
return f.Flags&0x8 != 0
|
||||
}
|
||||
|
||||
// OpenReader will open the Zip file specified by name and return a ReadCloser.
|
||||
@@ -102,7 +105,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
// indicate it contains up to 1 << 128 - 1 files. Since each file has a
|
||||
// header which will be _at least_ 30 bytes we can safely preallocate
|
||||
// if (data size / 30) >= end.directoryRecords.
|
||||
if (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
if end.directorySize < uint64(size) && (uint64(size)-end.directorySize)/30 >= end.directoryRecords {
|
||||
z.File = make([]*File, 0, end.directoryRecords)
|
||||
}
|
||||
z.Comment = end.comment
|
||||
@@ -117,7 +120,7 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
// a bad one, and then only report an ErrFormat or UnexpectedEOF if
|
||||
// the file count modulo 65536 is incorrect.
|
||||
for {
|
||||
f := &File{zip: z, zipr: r}
|
||||
f := &File{zip: z, zipr: r, zipsize: size}
|
||||
err = readDirectoryHeader(f, buf)
|
||||
if err == ErrFormat || err == io.ErrUnexpectedEOF {
|
||||
break
|
||||
@@ -125,7 +128,6 @@ func (z *Reader) init(r io.ReaderAt, size int64) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f.readDataDescriptor()
|
||||
z.File = append(z.File, f)
|
||||
}
|
||||
if uint16(len(z.File)) != uint16(end.directoryRecords) { // only compare 16 bits here
|
||||
@@ -186,68 +188,26 @@ func (f *File) Open() (io.ReadCloser, error) {
|
||||
return nil, ErrAlgorithm
|
||||
}
|
||||
var rc io.ReadCloser = dcomp(r)
|
||||
var desr io.Reader
|
||||
if f.hasDataDescriptor() {
|
||||
desr = io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, dataDescriptorLen)
|
||||
}
|
||||
rc = &checksumReader{
|
||||
rc: rc,
|
||||
hash: crc32.NewIEEE(),
|
||||
f: f,
|
||||
desr: desr,
|
||||
}
|
||||
return rc, nil
|
||||
}
|
||||
|
||||
// OpenRaw returns a Reader that provides access to the File's contents without
|
||||
// decompression.
|
||||
func (f *File) OpenRaw() (io.Reader, error) {
|
||||
bodyOffset, err := f.findBodyOffset()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset, int64(f.CompressedSize64))
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (f *File) readDataDescriptor() {
|
||||
if !f.hasDataDescriptor() {
|
||||
return
|
||||
}
|
||||
|
||||
bodyOffset, err := f.findBodyOffset()
|
||||
if err != nil {
|
||||
f.descErr = err
|
||||
return
|
||||
}
|
||||
|
||||
// In section 4.3.9.2 of the spec: "However ZIP64 format MAY be used
|
||||
// regardless of the size of a file. When extracting, if the zip64
|
||||
// extended information extra field is present for the file the
|
||||
// compressed and uncompressed sizes will be 8 byte values."
|
||||
//
|
||||
// Historically, this package has used the compressed and uncompressed
|
||||
// sizes from the central directory to determine if the package is
|
||||
// zip64.
|
||||
//
|
||||
// For this case we allow either the extra field or sizes to determine
|
||||
// the data descriptor length.
|
||||
zip64 := f.zip64 || f.isZip64()
|
||||
n := int64(dataDescriptorLen)
|
||||
if zip64 {
|
||||
n = dataDescriptor64Len
|
||||
}
|
||||
size := int64(f.CompressedSize64)
|
||||
r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, n)
|
||||
dd, err := readDataDescriptor(r, zip64)
|
||||
if err != nil {
|
||||
f.descErr = err
|
||||
return
|
||||
}
|
||||
f.CRC32 = dd.crc32
|
||||
}
|
||||
|
||||
type checksumReader struct {
|
||||
rc io.ReadCloser
|
||||
hash hash.Hash32
|
||||
nread uint64 // number of bytes read so far
|
||||
f *File
|
||||
err error // sticky error
|
||||
desr io.Reader // if non-nil, where to read the data descriptor
|
||||
err error // sticky error
|
||||
}
|
||||
|
||||
func (r *checksumReader) Stat() (fs.FileInfo, error) {
|
||||
@@ -268,12 +228,12 @@ func (r *checksumReader) Read(b []byte) (n int, err error) {
|
||||
if r.nread != r.f.UncompressedSize64 {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
if r.f.hasDataDescriptor() {
|
||||
if r.f.descErr != nil {
|
||||
if r.f.descErr == io.EOF {
|
||||
if r.desr != nil {
|
||||
if err1 := readDataDescriptor(r.desr, r.f); err1 != nil {
|
||||
if err1 == io.EOF {
|
||||
err = io.ErrUnexpectedEOF
|
||||
} else {
|
||||
err = r.f.descErr
|
||||
err = err1
|
||||
}
|
||||
} else if r.hash.Sum32() != r.f.CRC32 {
|
||||
err = ErrChecksum
|
||||
@@ -384,8 +344,6 @@ parseExtras:
|
||||
|
||||
switch fieldTag {
|
||||
case zip64ExtraID:
|
||||
f.zip64 = true
|
||||
|
||||
// update directory values from the zip64 extra block.
|
||||
// They should only be consulted if the sizes read earlier
|
||||
// are maxed out.
|
||||
@@ -485,9 +443,8 @@ parseExtras:
|
||||
return nil
|
||||
}
|
||||
|
||||
func readDataDescriptor(r io.Reader, zip64 bool) (*dataDescriptor, error) {
|
||||
// Create enough space for the largest possible size
|
||||
var buf [dataDescriptor64Len]byte
|
||||
func readDataDescriptor(r io.Reader, f *File) error {
|
||||
var buf [dataDescriptorLen]byte
|
||||
|
||||
// The spec says: "Although not originally assigned a
|
||||
// signature, the value 0x08074b50 has commonly been adopted
|
||||
@@ -497,9 +454,10 @@ func readDataDescriptor(r io.Reader, zip64 bool) (*dataDescriptor, error) {
|
||||
// descriptors and should account for either case when reading
|
||||
// ZIP files to ensure compatibility."
|
||||
//
|
||||
// First read just those 4 bytes to see if the signature exists.
|
||||
// dataDescriptorLen includes the size of the signature but
|
||||
// first read just those 4 bytes to see if it exists.
|
||||
if _, err := io.ReadFull(r, buf[:4]); err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
off := 0
|
||||
maybeSig := readBuf(buf[:4])
|
||||
@@ -508,28 +466,21 @@ func readDataDescriptor(r io.Reader, zip64 bool) (*dataDescriptor, error) {
|
||||
// bytes.
|
||||
off += 4
|
||||
}
|
||||
|
||||
end := dataDescriptorLen - 4
|
||||
if zip64 {
|
||||
end = dataDescriptor64Len - 4
|
||||
if _, err := io.ReadFull(r, buf[off:12]); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.ReadFull(r, buf[off:end]); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b := readBuf(buf[:end])
|
||||
|
||||
out := &dataDescriptor{
|
||||
crc32: b.uint32(),
|
||||
b := readBuf(buf[:12])
|
||||
if b.uint32() != f.CRC32 {
|
||||
return ErrChecksum
|
||||
}
|
||||
|
||||
if zip64 {
|
||||
out.compressedSize = b.uint64()
|
||||
out.uncompressedSize = b.uint64()
|
||||
} else {
|
||||
out.compressedSize = uint64(b.uint32())
|
||||
out.uncompressedSize = uint64(b.uint32())
|
||||
}
|
||||
return out, nil
|
||||
// The two sizes that follow here can be either 32 bits or 64 bits
|
||||
// but the spec is not very clear on this and different
|
||||
// interpretations has been made causing incompatibilities. We
|
||||
// already have the sizes from the central directory so we can
|
||||
// just ignore these.
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) {
|
||||
@@ -741,6 +692,9 @@ func (r *Reader) initFileList() {
|
||||
for _, file := range r.File {
|
||||
isDir := len(file.Name) > 0 && file.Name[len(file.Name)-1] == '/'
|
||||
name := toValidName(file.Name)
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
for dir := path.Dir(name); dir != "."; dir = path.Dir(dir) {
|
||||
dirs[dir] = true
|
||||
}
|
||||
@@ -782,8 +736,11 @@ func fileEntryLess(x, y string) bool {
|
||||
func (r *Reader) Open(name string) (fs.File, error) {
|
||||
r.initFileList()
|
||||
|
||||
if !fs.ValidPath(name) {
|
||||
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrInvalid}
|
||||
}
|
||||
e := r.openLookup(name)
|
||||
if e == nil || !fs.ValidPath(name) {
|
||||
if e == nil {
|
||||
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
|
||||
}
|
||||
if e.isDir {
|
||||
@@ -797,7 +754,7 @@ func (r *Reader) Open(name string) (fs.File, error) {
|
||||
}
|
||||
|
||||
func split(name string) (dir, elem string, isDir bool) {
|
||||
if name[len(name)-1] == '/' {
|
||||
if len(name) > 0 && name[len(name)-1] == '/' {
|
||||
isDir = true
|
||||
name = name[:len(name)-1]
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -499,15 +500,9 @@ func TestReader(t *testing.T) {
|
||||
func readTestZip(t *testing.T, zt ZipTest) {
|
||||
var z *Reader
|
||||
var err error
|
||||
var raw []byte
|
||||
if zt.Source != nil {
|
||||
rat, size := zt.Source()
|
||||
z, err = NewReader(rat, size)
|
||||
raw = make([]byte, size)
|
||||
if _, err := rat.ReadAt(raw, 0); err != nil {
|
||||
t.Errorf("ReadAt error=%v", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
path := filepath.Join("testdata", zt.Name)
|
||||
if zt.Obscured {
|
||||
@@ -525,12 +520,6 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
||||
defer rc.Close()
|
||||
z = &rc.Reader
|
||||
}
|
||||
var err2 error
|
||||
raw, err2 = os.ReadFile(path)
|
||||
if err2 != nil {
|
||||
t.Errorf("ReadFile(%s) error=%v", path, err2)
|
||||
return
|
||||
}
|
||||
}
|
||||
if err != zt.Error {
|
||||
t.Errorf("error=%v, want %v", err, zt.Error)
|
||||
@@ -557,7 +546,7 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
||||
|
||||
// test read of each file
|
||||
for i, ft := range zt.File {
|
||||
readTestFile(t, zt, ft, z.File[i], raw)
|
||||
readTestFile(t, zt, ft, z.File[i])
|
||||
}
|
||||
if t.Failed() {
|
||||
return
|
||||
@@ -569,7 +558,7 @@ func readTestZip(t *testing.T, zt ZipTest) {
|
||||
for i := 0; i < 5; i++ {
|
||||
for j, ft := range zt.File {
|
||||
go func(j int, ft ZipTestFile) {
|
||||
readTestFile(t, zt, ft, z.File[j], raw)
|
||||
readTestFile(t, zt, ft, z.File[j])
|
||||
done <- true
|
||||
}(j, ft)
|
||||
n++
|
||||
@@ -586,7 +575,7 @@ func equalTimeAndZone(t1, t2 time.Time) bool {
|
||||
return t1.Equal(t2) && name1 == name2 && offset1 == offset2
|
||||
}
|
||||
|
||||
func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File, raw []byte) {
|
||||
func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) {
|
||||
if f.Name != ft.Name {
|
||||
t.Errorf("name=%q, want %q", f.Name, ft.Name)
|
||||
}
|
||||
@@ -606,31 +595,6 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File, raw []byte)
|
||||
t.Errorf("%v: UncompressedSize=%#x does not match UncompressedSize64=%#x", f.Name, size, f.UncompressedSize64)
|
||||
}
|
||||
|
||||
// Check that OpenRaw returns the correct byte segment
|
||||
rw, err := f.OpenRaw()
|
||||
if err != nil {
|
||||
t.Errorf("%v: OpenRaw error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
start, err := f.DataOffset()
|
||||
if err != nil {
|
||||
t.Errorf("%v: DataOffset error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
got, err := io.ReadAll(rw)
|
||||
if err != nil {
|
||||
t.Errorf("%v: OpenRaw ReadAll error=%v", f.Name, err)
|
||||
return
|
||||
}
|
||||
end := uint64(start) + f.CompressedSize64
|
||||
want := raw[start:end]
|
||||
if !bytes.Equal(got, want) {
|
||||
t.Logf("got %q", got)
|
||||
t.Logf("want %q", want)
|
||||
t.Errorf("%v: OpenRaw returned unexpected bytes", f.Name)
|
||||
return
|
||||
}
|
||||
|
||||
r, err := f.Open()
|
||||
if err != nil {
|
||||
t.Errorf("%v", err)
|
||||
@@ -813,8 +777,8 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) {
|
||||
// "archive/zip"
|
||||
// "bytes"
|
||||
// "io"
|
||||
// "io/ioutil"
|
||||
// "log"
|
||||
// "os"
|
||||
// )
|
||||
//
|
||||
// type zeros struct{}
|
||||
@@ -1202,127 +1166,14 @@ func TestCVE202127919(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("Error reading file: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadDataDescriptor(t *testing.T) {
|
||||
tests := []struct {
|
||||
desc string
|
||||
in []byte
|
||||
zip64 bool
|
||||
want *dataDescriptor
|
||||
wantErr error
|
||||
}{{
|
||||
desc: "valid 32 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, // compressed size
|
||||
0x08, 0x09, 0x0a, 0x0b, // uncompressed size
|
||||
},
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x07060504,
|
||||
uncompressedSize: 0x0b0a0908,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 32 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, // compressed size
|
||||
0x08, 0x09, 0x0a, 0x0b, // uncompressed size
|
||||
},
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x07060504,
|
||||
uncompressedSize: 0x0b0a0908,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 64 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // uncompressed size
|
||||
},
|
||||
zip64: true,
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x0b0a090807060504,
|
||||
uncompressedSize: 0x131211100f0e0d0c,
|
||||
},
|
||||
}, {
|
||||
desc: "valid 64 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, // uncompressed size
|
||||
},
|
||||
zip64: true,
|
||||
want: &dataDescriptor{
|
||||
crc32: 0x03020100,
|
||||
compressedSize: 0x0b0a090807060504,
|
||||
uncompressedSize: 0x131211100f0e0d0c,
|
||||
},
|
||||
}, {
|
||||
desc: "invalid 32 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, // unexpected end
|
||||
},
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 32 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, // unexpected end
|
||||
},
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 64 bit with signature",
|
||||
in: []byte{
|
||||
0x50, 0x4b, 0x07, 0x08, // signature
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // unexpected end
|
||||
},
|
||||
zip64: true,
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}, {
|
||||
desc: "invalid 64 bit without signature",
|
||||
in: []byte{
|
||||
0x00, 0x01, 0x02, 0x03, // crc32
|
||||
0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, // compressed size
|
||||
0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, // unexpected end
|
||||
},
|
||||
zip64: true,
|
||||
wantErr: io.ErrUnexpectedEOF,
|
||||
}}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
r := bytes.NewReader(test.in)
|
||||
|
||||
desc, err := readDataDescriptor(r, test.zip64)
|
||||
if err != test.wantErr {
|
||||
t.Fatalf("got err %v; want nil", err)
|
||||
}
|
||||
if test.want == nil {
|
||||
return
|
||||
}
|
||||
if desc == nil {
|
||||
t.Fatalf("got nil DataDescriptor; want non-nil")
|
||||
}
|
||||
if desc.crc32 != test.want.crc32 {
|
||||
t.Errorf("got CRC32 %#x; want %#x", desc.crc32, test.want.crc32)
|
||||
}
|
||||
if desc.compressedSize != test.want.compressedSize {
|
||||
t.Errorf("got CompressedSize %#x; want %#x", desc.compressedSize, test.want.compressedSize)
|
||||
}
|
||||
if desc.uncompressedSize != test.want.uncompressedSize {
|
||||
t.Errorf("got UncompressedSize %#x; want %#x", desc.uncompressedSize, test.want.uncompressedSize)
|
||||
}
|
||||
})
|
||||
if len(r.File) != 1 {
|
||||
t.Fatalf("No entries in the file list")
|
||||
}
|
||||
if r.File[0].Name != "../test.txt" {
|
||||
t.Errorf("Unexpected entry name: %s", r.File[0].Name)
|
||||
}
|
||||
if _, err := r.File[0].Open(); err != nil {
|
||||
t.Errorf("Error opening file: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1384,3 +1235,139 @@ func TestCVE202133196(t *testing.T) {
|
||||
t.Errorf("Archive has unexpected number of files, got %d, want 5", len(r.File))
|
||||
}
|
||||
}
|
||||
|
||||
func TestCVE202139293(t *testing.T) {
|
||||
// directory size is so large, that the check in Reader.init
|
||||
// overflows when subtracting from the archive size, causing
|
||||
// the pre-allocation check to be bypassed.
|
||||
data := []byte{
|
||||
0x50, 0x4b, 0x06, 0x06, 0x05, 0x06, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
|
||||
0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0xff, 0x50, 0xfe, 0x00, 0xff, 0x00, 0x3a, 0x00, 0x00, 0x00, 0xff,
|
||||
}
|
||||
_, err := NewReader(bytes.NewReader(data), int64(len(data)))
|
||||
if err != ErrFormat {
|
||||
t.Fatalf("unexpected error, got: %v, want: %v", err, ErrFormat)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCVE202141772(t *testing.T) {
|
||||
// Archive contains a file whose name is exclusively made up of '/', '\'
|
||||
// characters, or "../", "..\" paths, which would previously cause a panic.
|
||||
//
|
||||
// Length Method Size Cmpr Date Time CRC-32 Name
|
||||
// -------- ------ ------- ---- ---------- ----- -------- ----
|
||||
// 0 Stored 0 0% 08-05-2021 18:32 00000000 /
|
||||
// 0 Stored 0 0% 09-14-2021 12:59 00000000 //
|
||||
// 0 Stored 0 0% 09-14-2021 12:59 00000000 \
|
||||
// 11 Stored 11 0% 09-14-2021 13:04 0d4a1185 /test.txt
|
||||
// -------- ------- --- -------
|
||||
// 11 11 0% 4 files
|
||||
data := []byte{
|
||||
0x50, 0x4b, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x08,
|
||||
0x00, 0x00, 0x06, 0x94, 0x05, 0x53, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2f, 0x50,
|
||||
0x4b, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x78, 0x67, 0x2e, 0x53, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x50,
|
||||
0x4b, 0x03, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x78, 0x67, 0x2e, 0x53, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x5c, 0x50, 0x4b,
|
||||
0x03, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x91, 0x68, 0x2e, 0x53, 0x85, 0x11, 0x4a, 0x0d,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x2f, 0x74, 0x65, 0x73,
|
||||
0x74, 0x2e, 0x74, 0x78, 0x74, 0x68, 0x65, 0x6c,
|
||||
0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64,
|
||||
0x50, 0x4b, 0x01, 0x02, 0x14, 0x03, 0x0a, 0x00,
|
||||
0x00, 0x08, 0x00, 0x00, 0x06, 0x94, 0x05, 0x53,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
|
||||
0xed, 0x41, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x50,
|
||||
0x4b, 0x01, 0x02, 0x3f, 0x00, 0x0a, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x78, 0x67, 0x2e, 0x53, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
|
||||
0x00, 0x1f, 0x00, 0x00, 0x00, 0x2f, 0x2f, 0x0a,
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x18, 0x00, 0x93, 0x98, 0x25, 0x57, 0x25,
|
||||
0xa9, 0xd7, 0x01, 0x93, 0x98, 0x25, 0x57, 0x25,
|
||||
0xa9, 0xd7, 0x01, 0x93, 0x98, 0x25, 0x57, 0x25,
|
||||
0xa9, 0xd7, 0x01, 0x50, 0x4b, 0x01, 0x02, 0x3f,
|
||||
0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
|
||||
0x67, 0x2e, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00,
|
||||
0x00, 0x5c, 0x0a, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x93, 0x98,
|
||||
0x25, 0x57, 0x25, 0xa9, 0xd7, 0x01, 0x93, 0x98,
|
||||
0x25, 0x57, 0x25, 0xa9, 0xd7, 0x01, 0x93, 0x98,
|
||||
0x25, 0x57, 0x25, 0xa9, 0xd7, 0x01, 0x50, 0x4b,
|
||||
0x01, 0x02, 0x3f, 0x00, 0x0a, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x91, 0x68, 0x2e, 0x53, 0x85, 0x11,
|
||||
0x4a, 0x0d, 0x0b, 0x00, 0x00, 0x00, 0x0b, 0x00,
|
||||
0x00, 0x00, 0x09, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x5e, 0x00, 0x00, 0x00, 0x2f, 0x74, 0x65, 0x73,
|
||||
0x74, 0x2e, 0x74, 0x78, 0x74, 0x0a, 0x00, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18,
|
||||
0x00, 0xa9, 0x80, 0x51, 0x01, 0x26, 0xa9, 0xd7,
|
||||
0x01, 0x31, 0xd1, 0x57, 0x01, 0x26, 0xa9, 0xd7,
|
||||
0x01, 0xdf, 0x48, 0x85, 0xf9, 0x25, 0xa9, 0xd7,
|
||||
0x01, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x04, 0x00, 0x31, 0x01, 0x00,
|
||||
0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
}
|
||||
r, err := NewReader(bytes.NewReader([]byte(data)), int64(len(data)))
|
||||
if err != nil {
|
||||
t.Fatalf("Error reading the archive: %v", err)
|
||||
}
|
||||
entryNames := []string{`/`, `//`, `\`, `/test.txt`}
|
||||
var names []string
|
||||
for _, f := range r.File {
|
||||
names = append(names, f.Name)
|
||||
if _, err := f.Open(); err != nil {
|
||||
t.Errorf("Error opening %q: %v", f.Name, err)
|
||||
}
|
||||
if _, err := r.Open(f.Name); err == nil {
|
||||
t.Errorf("Opening %q with fs.FS API succeeded", f.Name)
|
||||
}
|
||||
}
|
||||
if !reflect.DeepEqual(names, entryNames) {
|
||||
t.Errorf("Unexpected file entries: %q", names)
|
||||
}
|
||||
if _, err := r.Open(""); err == nil {
|
||||
t.Errorf("Opening %q with fs.FS API succeeded", "")
|
||||
}
|
||||
if _, err := r.Open("test.txt"); err != nil {
|
||||
t.Errorf("Error opening %q with fs.FS API: %v", "test.txt", err)
|
||||
}
|
||||
dirEntries, err := fs.ReadDir(r, ".")
|
||||
if err != nil {
|
||||
t.Fatalf("Error reading the root directory: %v", err)
|
||||
}
|
||||
if len(dirEntries) != 1 || dirEntries[0].Name() != "test.txt" {
|
||||
t.Errorf("Unexpected directory entries")
|
||||
for _, dirEntry := range dirEntries {
|
||||
_, err := r.Open(dirEntry.Name())
|
||||
t.Logf("%q (Open error: %v)", dirEntry.Name(), err)
|
||||
}
|
||||
t.FailNow()
|
||||
}
|
||||
info, err := dirEntries[0].Info()
|
||||
if err != nil {
|
||||
t.Fatalf("Error reading info entry: %v", err)
|
||||
}
|
||||
if name := info.Name(); name != "test.txt" {
|
||||
t.Errorf("Inconsistent name in info entry: %v", name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ const (
|
||||
directoryHeaderLen = 46 // + filename + extra + comment
|
||||
directoryEndLen = 22 // + comment
|
||||
dataDescriptorLen = 16 // four uint32: descriptor signature, crc32, compressed size, size
|
||||
dataDescriptor64Len = 24 // two uint32: signature, crc32 | two uint64: compressed size, size
|
||||
dataDescriptor64Len = 24 // descriptor with 8 byte sizes
|
||||
directory64LocLen = 20 //
|
||||
directory64EndLen = 56 // + extra
|
||||
|
||||
@@ -315,10 +315,6 @@ func (h *FileHeader) isZip64() bool {
|
||||
return h.CompressedSize64 >= uint32max || h.UncompressedSize64 >= uint32max
|
||||
}
|
||||
|
||||
func (f *FileHeader) hasDataDescriptor() bool {
|
||||
return f.Flags&0x8 != 0
|
||||
}
|
||||
|
||||
func msdosModeToFileMode(m uint32) (mode fs.FileMode) {
|
||||
if m&msdosDir != 0 {
|
||||
mode = fs.ModeDir | 0777
|
||||
@@ -345,9 +341,11 @@ func fileModeToUnixMode(mode fs.FileMode) uint32 {
|
||||
case fs.ModeSocket:
|
||||
m = s_IFSOCK
|
||||
case fs.ModeDevice:
|
||||
m = s_IFBLK
|
||||
case fs.ModeDevice | fs.ModeCharDevice:
|
||||
m = s_IFCHR
|
||||
if mode&fs.ModeCharDevice != 0 {
|
||||
m = s_IFCHR
|
||||
} else {
|
||||
m = s_IFBLK
|
||||
}
|
||||
}
|
||||
if mode&fs.ModeSetuid != 0 {
|
||||
m |= s_ISUID
|
||||
@@ -390,11 +388,3 @@ func unixModeToFileMode(m uint32) fs.FileMode {
|
||||
}
|
||||
return mode
|
||||
}
|
||||
|
||||
// dataDescriptor holds the data descriptor that optionally follows the file
|
||||
// contents in the zip file.
|
||||
type dataDescriptor struct {
|
||||
crc32 uint32
|
||||
compressedSize uint64
|
||||
uncompressedSize uint64
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ type Writer struct {
|
||||
type header struct {
|
||||
*FileHeader
|
||||
offset uint64
|
||||
raw bool
|
||||
}
|
||||
|
||||
// NewWriter returns a new Writer writing a zip file to w.
|
||||
@@ -246,31 +245,22 @@ func detectUTF8(s string) (valid, require bool) {
|
||||
return true, require
|
||||
}
|
||||
|
||||
// prepare performs the bookkeeping operations required at the start of
|
||||
// CreateHeader and CreateRaw.
|
||||
func (w *Writer) prepare(fh *FileHeader) error {
|
||||
if w.last != nil && !w.last.closed {
|
||||
if err := w.last.close(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
|
||||
// See https://golang.org/issue/11144 confusion.
|
||||
return errors.New("archive/zip: invalid duplicate FileHeader")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateHeader adds a file to the zip archive using the provided FileHeader
|
||||
// for the file metadata. Writer takes ownership of fh and may mutate
|
||||
// its fields. The caller must not modify fh after calling CreateHeader.
|
||||
//
|
||||
// This returns a Writer to which the file contents should be written.
|
||||
// The file's contents must be written to the io.Writer before the next
|
||||
// call to Create, CreateHeader, CreateRaw, or Close.
|
||||
// call to Create, CreateHeader, or Close.
|
||||
func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
||||
if err := w.prepare(fh); err != nil {
|
||||
return nil, err
|
||||
if w.last != nil && !w.last.closed {
|
||||
if err := w.last.close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh {
|
||||
// See https://golang.org/issue/11144 confusion.
|
||||
return nil, errors.New("archive/zip: invalid duplicate FileHeader")
|
||||
}
|
||||
|
||||
// The ZIP format has a sad state of affairs regarding character encoding.
|
||||
@@ -375,7 +365,7 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
||||
ow = fw
|
||||
}
|
||||
w.dir = append(w.dir, h)
|
||||
if err := writeHeader(w.cw, h); err != nil {
|
||||
if err := writeHeader(w.cw, fh); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If we're creating a directory, fw is nil.
|
||||
@@ -383,7 +373,7 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
|
||||
return ow, nil
|
||||
}
|
||||
|
||||
func writeHeader(w io.Writer, h *header) error {
|
||||
func writeHeader(w io.Writer, h *FileHeader) error {
|
||||
const maxUint16 = 1<<16 - 1
|
||||
if len(h.Name) > maxUint16 {
|
||||
return errLongName
|
||||
@@ -400,20 +390,9 @@ func writeHeader(w io.Writer, h *header) error {
|
||||
b.uint16(h.Method)
|
||||
b.uint16(h.ModifiedTime)
|
||||
b.uint16(h.ModifiedDate)
|
||||
// In raw mode (caller does the compression), the values are either
|
||||
// written here or in the trailing data descriptor based on the header
|
||||
// flags.
|
||||
if h.raw && !h.hasDataDescriptor() {
|
||||
b.uint32(h.CRC32)
|
||||
b.uint32(uint32(min64(h.CompressedSize64, uint32max)))
|
||||
b.uint32(uint32(min64(h.UncompressedSize64, uint32max)))
|
||||
} else {
|
||||
// When this package handle the compression, these values are
|
||||
// always written to the trailing data descriptor.
|
||||
b.uint32(0) // crc32
|
||||
b.uint32(0) // compressed size
|
||||
b.uint32(0) // uncompressed size
|
||||
}
|
||||
b.uint32(0) // since we are writing a data descriptor crc32,
|
||||
b.uint32(0) // compressed size,
|
||||
b.uint32(0) // and uncompressed size should be zero
|
||||
b.uint16(uint16(len(h.Name)))
|
||||
b.uint16(uint16(len(h.Extra)))
|
||||
if _, err := w.Write(buf[:]); err != nil {
|
||||
@@ -426,65 +405,6 @@ func writeHeader(w io.Writer, h *header) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func min64(x, y uint64) uint64 {
|
||||
if x < y {
|
||||
return x
|
||||
}
|
||||
return y
|
||||
}
|
||||
|
||||
// CreateRaw adds a file to the zip archive using the provided FileHeader and
|
||||
// returns a Writer to which the file contents should be written. The file's
|
||||
// contents must be written to the io.Writer before the next call to Create,
|
||||
// CreateHeader, CreateRaw, or Close.
|
||||
//
|
||||
// In contrast to CreateHeader, the bytes passed to Writer are not compressed.
|
||||
func (w *Writer) CreateRaw(fh *FileHeader) (io.Writer, error) {
|
||||
if err := w.prepare(fh); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fh.CompressedSize = uint32(min64(fh.CompressedSize64, uint32max))
|
||||
fh.UncompressedSize = uint32(min64(fh.UncompressedSize64, uint32max))
|
||||
|
||||
h := &header{
|
||||
FileHeader: fh,
|
||||
offset: uint64(w.cw.count),
|
||||
raw: true,
|
||||
}
|
||||
w.dir = append(w.dir, h)
|
||||
if err := writeHeader(w.cw, h); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if strings.HasSuffix(fh.Name, "/") {
|
||||
w.last = nil
|
||||
return dirWriter{}, nil
|
||||
}
|
||||
|
||||
fw := &fileWriter{
|
||||
header: h,
|
||||
zipw: w.cw,
|
||||
}
|
||||
w.last = fw
|
||||
return fw, nil
|
||||
}
|
||||
|
||||
// Copy copies the file f (obtained from a Reader) into w. It copies the raw
|
||||
// form directly bypassing decompression, compression, and validation.
|
||||
func (w *Writer) Copy(f *File) error {
|
||||
r, err := f.OpenRaw()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fw, err := w.CreateRaw(&f.FileHeader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(fw, r)
|
||||
return err
|
||||
}
|
||||
|
||||
// RegisterCompressor registers or overrides a custom compressor for a specific
|
||||
// method ID. If a compressor for a given method is not found, Writer will
|
||||
// default to looking up the compressor at the package level.
|
||||
@@ -526,9 +446,6 @@ func (w *fileWriter) Write(p []byte) (int, error) {
|
||||
if w.closed {
|
||||
return 0, errors.New("zip: write to closed file")
|
||||
}
|
||||
if w.raw {
|
||||
return w.zipw.Write(p)
|
||||
}
|
||||
w.crc32.Write(p)
|
||||
return w.rawCount.Write(p)
|
||||
}
|
||||
@@ -538,9 +455,6 @@ func (w *fileWriter) close() error {
|
||||
return errors.New("zip: file closed twice")
|
||||
}
|
||||
w.closed = true
|
||||
if w.raw {
|
||||
return w.writeDataDescriptor()
|
||||
}
|
||||
if err := w.comp.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -560,33 +474,26 @@ func (w *fileWriter) close() error {
|
||||
fh.UncompressedSize = uint32(fh.UncompressedSize64)
|
||||
}
|
||||
|
||||
return w.writeDataDescriptor()
|
||||
}
|
||||
|
||||
func (w *fileWriter) writeDataDescriptor() error {
|
||||
if !w.hasDataDescriptor() {
|
||||
return nil
|
||||
}
|
||||
// Write data descriptor. This is more complicated than one would
|
||||
// think, see e.g. comments in zipfile.c:putextended() and
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588.
|
||||
// The approach here is to write 8 byte sizes if needed without
|
||||
// adding a zip64 extra in the local header (too late anyway).
|
||||
var buf []byte
|
||||
if w.isZip64() {
|
||||
if fh.isZip64() {
|
||||
buf = make([]byte, dataDescriptor64Len)
|
||||
} else {
|
||||
buf = make([]byte, dataDescriptorLen)
|
||||
}
|
||||
b := writeBuf(buf)
|
||||
b.uint32(dataDescriptorSignature) // de-facto standard, required by OS X
|
||||
b.uint32(w.CRC32)
|
||||
if w.isZip64() {
|
||||
b.uint64(w.CompressedSize64)
|
||||
b.uint64(w.UncompressedSize64)
|
||||
b.uint32(fh.CRC32)
|
||||
if fh.isZip64() {
|
||||
b.uint64(fh.CompressedSize64)
|
||||
b.uint64(fh.UncompressedSize64)
|
||||
} else {
|
||||
b.uint32(w.CompressedSize)
|
||||
b.uint32(w.UncompressedSize)
|
||||
b.uint32(fh.CompressedSize)
|
||||
b.uint32(fh.UncompressedSize)
|
||||
}
|
||||
_, err := w.zipw.Write(buf)
|
||||
return err
|
||||
|
||||
@@ -6,10 +6,8 @@ package zip
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/flate"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"hash/crc32"
|
||||
"io"
|
||||
"io/fs"
|
||||
"math/rand"
|
||||
@@ -59,18 +57,6 @@ var writeTests = []WriteTest{
|
||||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeSymlink,
|
||||
},
|
||||
{
|
||||
Name: "device",
|
||||
Data: []byte("device file"),
|
||||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeDevice,
|
||||
},
|
||||
{
|
||||
Name: "chardevice",
|
||||
Data: []byte("char device file"),
|
||||
Method: Deflate,
|
||||
Mode: 0755 | fs.ModeDevice | fs.ModeCharDevice,
|
||||
},
|
||||
}
|
||||
|
||||
func TestWriter(t *testing.T) {
|
||||
@@ -367,171 +353,6 @@ func TestWriterDirAttributes(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriterCopy(t *testing.T) {
|
||||
// make a zip file
|
||||
buf := new(bytes.Buffer)
|
||||
w := NewWriter(buf)
|
||||
for _, wt := range writeTests {
|
||||
testCreate(t, w, &wt)
|
||||
}
|
||||
if err := w.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read it back
|
||||
src, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, wt := range writeTests {
|
||||
testReadFile(t, src.File[i], &wt)
|
||||
}
|
||||
|
||||
// make a new zip file copying the old compressed data.
|
||||
buf2 := new(bytes.Buffer)
|
||||
dst := NewWriter(buf2)
|
||||
for _, f := range src.File {
|
||||
if err := dst.Copy(f); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if err := dst.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read the new one back
|
||||
r, err := NewReader(bytes.NewReader(buf2.Bytes()), int64(buf2.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, wt := range writeTests {
|
||||
testReadFile(t, r.File[i], &wt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriterCreateRaw(t *testing.T) {
|
||||
files := []struct {
|
||||
name string
|
||||
content []byte
|
||||
method uint16
|
||||
flags uint16
|
||||
crc32 uint32
|
||||
uncompressedSize uint64
|
||||
compressedSize uint64
|
||||
}{
|
||||
{
|
||||
name: "small store w desc",
|
||||
content: []byte("gophers"),
|
||||
method: Store,
|
||||
flags: 0x8,
|
||||
},
|
||||
{
|
||||
name: "small deflate wo desc",
|
||||
content: bytes.Repeat([]byte("abcdefg"), 2048),
|
||||
method: Deflate,
|
||||
},
|
||||
}
|
||||
|
||||
// write a zip file
|
||||
archive := new(bytes.Buffer)
|
||||
w := NewWriter(archive)
|
||||
|
||||
for i := range files {
|
||||
f := &files[i]
|
||||
f.crc32 = crc32.ChecksumIEEE(f.content)
|
||||
size := uint64(len(f.content))
|
||||
f.uncompressedSize = size
|
||||
f.compressedSize = size
|
||||
|
||||
var compressedContent []byte
|
||||
if f.method == Deflate {
|
||||
var buf bytes.Buffer
|
||||
w, err := flate.NewWriter(&buf, flate.BestSpeed)
|
||||
if err != nil {
|
||||
t.Fatalf("flate.NewWriter err = %v", err)
|
||||
}
|
||||
_, err = w.Write(f.content)
|
||||
if err != nil {
|
||||
t.Fatalf("flate Write err = %v", err)
|
||||
}
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("flate Writer.Close err = %v", err)
|
||||
}
|
||||
compressedContent = buf.Bytes()
|
||||
f.compressedSize = uint64(len(compressedContent))
|
||||
}
|
||||
|
||||
h := &FileHeader{
|
||||
Name: f.name,
|
||||
Method: f.method,
|
||||
Flags: f.flags,
|
||||
CRC32: f.crc32,
|
||||
CompressedSize64: f.compressedSize,
|
||||
UncompressedSize64: f.uncompressedSize,
|
||||
}
|
||||
w, err := w.CreateRaw(h)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if compressedContent != nil {
|
||||
_, err = w.Write(compressedContent)
|
||||
} else {
|
||||
_, err = w.Write(f.content)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("%s Write got %v; want nil", f.name, err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := w.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// read it back
|
||||
r, err := NewReader(bytes.NewReader(archive.Bytes()), int64(archive.Len()))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for i, want := range files {
|
||||
got := r.File[i]
|
||||
if got.Name != want.name {
|
||||
t.Errorf("got Name %s; want %s", got.Name, want.name)
|
||||
}
|
||||
if got.Method != want.method {
|
||||
t.Errorf("%s: got Method %#x; want %#x", want.name, got.Method, want.method)
|
||||
}
|
||||
if got.Flags != want.flags {
|
||||
t.Errorf("%s: got Flags %#x; want %#x", want.name, got.Flags, want.flags)
|
||||
}
|
||||
if got.CRC32 != want.crc32 {
|
||||
t.Errorf("%s: got CRC32 %#x; want %#x", want.name, got.CRC32, want.crc32)
|
||||
}
|
||||
if got.CompressedSize64 != want.compressedSize {
|
||||
t.Errorf("%s: got CompressedSize64 %d; want %d", want.name, got.CompressedSize64, want.compressedSize)
|
||||
}
|
||||
if got.UncompressedSize64 != want.uncompressedSize {
|
||||
t.Errorf("%s: got UncompressedSize64 %d; want %d", want.name, got.UncompressedSize64, want.uncompressedSize)
|
||||
}
|
||||
|
||||
r, err := got.Open()
|
||||
if err != nil {
|
||||
t.Errorf("%s: Open err = %v", got.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
buf, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Errorf("%s: ReadAll err = %v", got.Name, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if !bytes.Equal(buf, want.content) {
|
||||
t.Errorf("%v: ReadAll returned unexpected bytes", got.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func testCreate(t *testing.T, w *Writer, wt *WriteTest) {
|
||||
header := &FileHeader{
|
||||
Name: wt.Name,
|
||||
@@ -557,15 +378,15 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
|
||||
testFileMode(t, f, wt.Mode)
|
||||
rc, err := f.Open()
|
||||
if err != nil {
|
||||
t.Fatalf("opening %s: %v", f.Name, err)
|
||||
t.Fatal("opening:", err)
|
||||
}
|
||||
b, err := io.ReadAll(rc)
|
||||
if err != nil {
|
||||
t.Fatalf("reading %s: %v", f.Name, err)
|
||||
t.Fatal("reading:", err)
|
||||
}
|
||||
err = rc.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("closing %s: %v", f.Name, err)
|
||||
t.Fatal("closing:", err)
|
||||
}
|
||||
if !bytes.Equal(b, wt.Data) {
|
||||
t.Errorf("File contents %q, want %q", b, wt.Data)
|
||||
|
||||
@@ -670,8 +670,7 @@ func (b *Writer) WriteByte(c byte) error {
|
||||
// WriteRune writes a single Unicode code point, returning
|
||||
// the number of bytes written and any error.
|
||||
func (b *Writer) WriteRune(r rune) (size int, err error) {
|
||||
// Compare as uint32 to correctly handle negative runes.
|
||||
if uint32(r) < utf8.RuneSelf {
|
||||
if r < utf8.RuneSelf {
|
||||
err = b.WriteByte(byte(r))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
||||
@@ -534,20 +534,6 @@ func TestReadWriteRune(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteInvalidRune(t *testing.T) {
|
||||
// Invalid runes, including negative ones, should be written as the
|
||||
// replacement character.
|
||||
for _, r := range []rune{-1, utf8.MaxRune + 1} {
|
||||
var buf bytes.Buffer
|
||||
w := NewWriter(&buf)
|
||||
w.WriteRune(r)
|
||||
w.Flush()
|
||||
if s := buf.String(); s != "\uFFFD" {
|
||||
t.Errorf("WriteRune(%d) wrote %q, not replacement character", r, s)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadStringAllocs(t *testing.T) {
|
||||
r := strings.NewReader(" foo foo 42 42 42 42 42 42 42 42 4.2 4.2 4.2 4.2\n")
|
||||
buf := NewReader(r)
|
||||
|
||||
@@ -48,8 +48,7 @@ type Scanner struct {
|
||||
// and the next token to return to the user, if any, plus an error, if any.
|
||||
//
|
||||
// Scanning stops if the function returns an error, in which case some of
|
||||
// the input may be discarded. If that error is ErrFinalToken, scanning
|
||||
// stops with no error.
|
||||
// the input may be discarded.
|
||||
//
|
||||
// Otherwise, the Scanner advances the input. If the token is not nil,
|
||||
// the Scanner returns it to the user. If the token is nil, the
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package bytes_test
|
||||
|
||||
@@ -275,8 +275,7 @@ func (b *Buffer) WriteByte(c byte) error {
|
||||
// included to match bufio.Writer's WriteRune. The buffer is grown as needed;
|
||||
// if it becomes too large, WriteRune will panic with ErrTooLarge.
|
||||
func (b *Buffer) WriteRune(r rune) (n int, err error) {
|
||||
// Compare as uint32 to correctly handle negative runes.
|
||||
if uint32(r) < utf8.RuneSelf {
|
||||
if r < utf8.RuneSelf {
|
||||
b.WriteByte(byte(r))
|
||||
return 1, nil
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ package bytes_test
|
||||
|
||||
import (
|
||||
. "bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"testing"
|
||||
@@ -388,16 +387,6 @@ func TestRuneIO(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteInvalidRune(t *testing.T) {
|
||||
// Invalid runes, including negative ones, should be written as
|
||||
// utf8.RuneError.
|
||||
for _, r := range []rune{-1, utf8.MaxRune + 1} {
|
||||
var buf Buffer
|
||||
buf.WriteRune(r)
|
||||
check(t, fmt.Sprintf("TestWriteInvalidRune (%d)", r), &buf, "\uFFFD")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNext(t *testing.T) {
|
||||
b := []byte{0, 1, 2, 3, 4}
|
||||
tmp := make([]byte, 5)
|
||||
|
||||
@@ -215,7 +215,8 @@ func main() {
|
||||
}
|
||||
optional := fileFeatures(*nextFile)
|
||||
exception := fileFeatures(*exceptFile)
|
||||
fail = !compareAPI(bw, features, required, optional, exception, *allowNew)
|
||||
fail = !compareAPI(bw, features, required, optional, exception,
|
||||
*allowNew && strings.Contains(runtime.Version(), "devel"))
|
||||
}
|
||||
|
||||
// export emits the exported package features.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
// The run program is invoked via the dist tool.
|
||||
@@ -10,11 +9,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
exec "internal/execabs"
|
||||
"internal/goversion"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -46,7 +42,6 @@ func main() {
|
||||
apiDir := filepath.Join(goroot, "api")
|
||||
out, err := exec.Command(goCmd(), "tool", "api",
|
||||
"-c", findAPIDirFiles(apiDir),
|
||||
allowNew(apiDir),
|
||||
"-next", filepath.Join(apiDir, "next.txt"),
|
||||
"-except", filepath.Join(apiDir, "except.txt")).CombinedOutput()
|
||||
if err != nil {
|
||||
@@ -75,35 +70,3 @@ func findAPIDirFiles(apiDir string) string {
|
||||
}
|
||||
return strings.Join(apiFiles, ",")
|
||||
}
|
||||
|
||||
// allowNew returns the -allow_new flag to use for the 'go tool api' invocation.
|
||||
func allowNew(apiDir string) string {
|
||||
// Verify that the api/go1.n.txt for previous Go version exists.
|
||||
// It definitely should, otherwise it's a signal that the logic below may be outdated.
|
||||
if _, err := os.Stat(filepath.Join(apiDir, fmt.Sprintf("go1.%d.txt", goversion.Version-1))); err != nil {
|
||||
log.Fatalln("Problem with api file for previous release:", err)
|
||||
}
|
||||
|
||||
// See whether the api/go1.n.txt for this Go version has been created.
|
||||
// (As of April 2021, it gets created during the release of the first Beta.)
|
||||
_, err := os.Stat(filepath.Join(apiDir, fmt.Sprintf("go1.%d.txt", goversion.Version)))
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
// It doesn't exist, so we're in development or before Beta 1.
|
||||
// At this stage, unmentioned API additions are deemed okay.
|
||||
// (They will be quietly shown in API check output, but the test won't fail).
|
||||
return "-allow_new=true"
|
||||
} else if err == nil {
|
||||
// The api/go1.n.txt for this Go version has been created,
|
||||
// so we're definitely past Beta 1 in the release cycle.
|
||||
//
|
||||
// From this point, enforce that api/go1.n.txt is an accurate and complete
|
||||
// representation of what's going into the release by failing API check if
|
||||
// there are API additions (a month into the freeze, there shouldn't be many).
|
||||
//
|
||||
// See golang.org/issue/43956.
|
||||
return "-allow_new=false"
|
||||
} else {
|
||||
log.Fatal(err)
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
@@ -109,10 +109,6 @@ func archX86(linkArch *obj.LinkArch) *Arch {
|
||||
register["SB"] = RSB
|
||||
register["FP"] = RFP
|
||||
register["PC"] = RPC
|
||||
if linkArch == &x86.Linkamd64 {
|
||||
// Alias g to R14
|
||||
register["g"] = x86.REGG
|
||||
}
|
||||
// Register prefix not used on this architecture.
|
||||
|
||||
instructions := make(map[string]obj.As)
|
||||
|
||||
@@ -147,16 +147,7 @@ func arm64RegisterNumber(name string, n int16) (int16, bool) {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// ARM64RegisterShift constructs an ARM64 register with shift operation.
|
||||
func ARM64RegisterShift(reg, op, count int16) (int64, error) {
|
||||
// the base register of shift operations must be general register.
|
||||
if reg > arm64.REG_R31 || reg < arm64.REG_R0 {
|
||||
return 0, errors.New("invalid register for shift operation")
|
||||
}
|
||||
return int64(reg&31)<<16 | int64(op)<<22 | int64(uint16(count)), nil
|
||||
}
|
||||
|
||||
// ARM64RegisterExtension constructs an ARM64 register with extension or arrangement.
|
||||
// ARM64RegisterExtension parses an ARM64 register with extension or arrangement.
|
||||
func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, isIndex bool) error {
|
||||
Rnum := (reg & 31) + int16(num<<5)
|
||||
if isAmount {
|
||||
@@ -164,163 +155,154 @@ func ARM64RegisterExtension(a *obj.Addr, ext string, reg, num int16, isAmount, i
|
||||
return errors.New("index shift amount is out of range")
|
||||
}
|
||||
}
|
||||
if reg <= arm64.REG_R31 && reg >= arm64.REG_R0 {
|
||||
switch ext {
|
||||
case "UXTB":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_UXTB + Rnum
|
||||
case "UXTH":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_UXTH + Rnum
|
||||
case "UXTW":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
// effective address of memory is a base register value and an offset register value.
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_UXTW + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_UXTW + Rnum
|
||||
}
|
||||
case "UXTX":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_UXTX + Rnum
|
||||
case "SXTB":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_SXTB + Rnum
|
||||
case "SXTH":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_SXTH + Rnum
|
||||
case "SXTW":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_SXTW + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_SXTW + Rnum
|
||||
}
|
||||
case "SXTX":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_SXTX + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_SXTX + Rnum
|
||||
}
|
||||
case "LSL":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Index = arm64.REG_LSL + Rnum
|
||||
default:
|
||||
return errors.New("unsupported general register extension type: " + ext)
|
||||
|
||||
switch ext {
|
||||
case "UXTB":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
} else if reg <= arm64.REG_V31 && reg >= arm64.REG_V0 {
|
||||
switch ext {
|
||||
case "B8":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_8B & 15) << 5)
|
||||
case "B16":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_16B & 15) << 5)
|
||||
case "H4":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_4H & 15) << 5)
|
||||
case "H8":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_8H & 15) << 5)
|
||||
case "S2":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_2S & 15) << 5)
|
||||
case "S4":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_4S & 15) << 5)
|
||||
case "D1":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_1D & 15) << 5)
|
||||
case "D2":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_2D & 15) << 5)
|
||||
case "Q1":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_1Q & 15) << 5)
|
||||
case "B":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_B & 15) << 5)
|
||||
a.Index = num
|
||||
case "H":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_H & 15) << 5)
|
||||
a.Index = num
|
||||
case "S":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_S & 15) << 5)
|
||||
a.Index = num
|
||||
case "D":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_D & 15) << 5)
|
||||
a.Index = num
|
||||
default:
|
||||
return errors.New("unsupported simd register extension type: " + ext)
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
} else {
|
||||
return errors.New("invalid register and extension combination")
|
||||
a.Reg = arm64.REG_UXTB + Rnum
|
||||
case "UXTH":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_UXTH + Rnum
|
||||
case "UXTW":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
// effective address of memory is a base register value and an offset register value.
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_UXTW + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_UXTW + Rnum
|
||||
}
|
||||
case "UXTX":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_UXTX + Rnum
|
||||
case "SXTB":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_SXTB + Rnum
|
||||
case "SXTH":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
return errors.New("invalid shift for the register offset addressing mode")
|
||||
}
|
||||
a.Reg = arm64.REG_SXTH + Rnum
|
||||
case "SXTW":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_SXTW + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_SXTW + Rnum
|
||||
}
|
||||
case "SXTX":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
if a.Type == obj.TYPE_MEM {
|
||||
a.Index = arm64.REG_SXTX + Rnum
|
||||
} else {
|
||||
a.Reg = arm64.REG_SXTX + Rnum
|
||||
}
|
||||
case "LSL":
|
||||
if !isAmount {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Index = arm64.REG_LSL + Rnum
|
||||
case "B8":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_8B & 15) << 5)
|
||||
case "B16":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_16B & 15) << 5)
|
||||
case "H4":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_4H & 15) << 5)
|
||||
case "H8":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_8H & 15) << 5)
|
||||
case "S2":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_2S & 15) << 5)
|
||||
case "S4":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_4S & 15) << 5)
|
||||
case "D1":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_1D & 15) << 5)
|
||||
case "D2":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_2D & 15) << 5)
|
||||
case "Q1":
|
||||
if isIndex {
|
||||
return errors.New("invalid register extension")
|
||||
}
|
||||
a.Reg = arm64.REG_ARNG + (reg & 31) + ((arm64.ARNG_1Q & 15) << 5)
|
||||
case "B":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_B & 15) << 5)
|
||||
a.Index = num
|
||||
case "H":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_H & 15) << 5)
|
||||
a.Index = num
|
||||
case "S":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_S & 15) << 5)
|
||||
a.Index = num
|
||||
case "D":
|
||||
if !isIndex {
|
||||
return nil
|
||||
}
|
||||
a.Reg = arm64.REG_ELEM + (reg & 31) + ((arm64.ARNG_D & 15) << 5)
|
||||
a.Index = num
|
||||
default:
|
||||
return errors.New("unsupported register extension type: " + ext)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ARM64RegisterArrangement constructs an ARM64 vector register arrangement.
|
||||
// ARM64RegisterArrangement parses an ARM64 vector register arrangement.
|
||||
func ARM64RegisterArrangement(reg int16, name, arng string) (int64, error) {
|
||||
var curQ, curSize uint16
|
||||
if name[0] != 'V' {
|
||||
|
||||
@@ -134,14 +134,6 @@ func (p *Parser) asmText(operands [][]lex.Token) {
|
||||
next++
|
||||
}
|
||||
|
||||
// Issue an error if we see a function defined as ABIInternal
|
||||
// without NOSPLIT. In ABIInternal, obj needs to know the function
|
||||
// signature in order to construct the morestack path, so this
|
||||
// currently isn't supported for asm functions.
|
||||
if nameAddr.Sym.ABI() == obj.ABIInternal && flag&obj.NOSPLIT == 0 {
|
||||
p.errorf("TEXT %q: ABIInternal requires NOSPLIT", name)
|
||||
}
|
||||
|
||||
// Next operand is the frame and arg size.
|
||||
// Bizarre syntax: $frameSize-argSize is two words, not subtraction.
|
||||
// Both frameSize and argSize must be simple integers; only frameSize
|
||||
@@ -807,11 +799,22 @@ func (p *Parser) asmInstruction(op obj.As, cond string, a []obj.Addr) {
|
||||
p.errorf("can't handle %s instruction with 4 operands", op)
|
||||
return
|
||||
case 5:
|
||||
if p.arch.Family == sys.PPC64 {
|
||||
if p.arch.Family == sys.PPC64 && arch.IsPPC64RLD(op) {
|
||||
// Always reg, reg, con, con, reg. (con, con is a 'mask').
|
||||
prog.From = a[0]
|
||||
// Second arg is always a register type on ppc64.
|
||||
prog.Reg = p.getRegister(prog, op, &a[1])
|
||||
prog.SetRestArgs([]obj.Addr{a[2], a[3]})
|
||||
mask1 := p.getConstant(prog, op, &a[2])
|
||||
mask2 := p.getConstant(prog, op, &a[3])
|
||||
var mask uint32
|
||||
if mask1 < mask2 {
|
||||
mask = (^uint32(0) >> uint(mask1)) & (^uint32(0) << uint(31-mask2))
|
||||
} else {
|
||||
mask = (^uint32(0) >> uint(mask2+1)) & (^uint32(0) << uint(31-(mask1-1)))
|
||||
}
|
||||
prog.SetFrom3(obj.Addr{
|
||||
Type: obj.TYPE_CONST,
|
||||
Offset: int64(mask),
|
||||
})
|
||||
prog.To = a[4]
|
||||
break
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"internal/buildcfg"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -20,6 +19,7 @@ import (
|
||||
|
||||
"cmd/asm/internal/lex"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
)
|
||||
|
||||
// An end-to-end test for the assembler: Do we print what we parse?
|
||||
@@ -36,7 +36,6 @@ func testEndToEnd(t *testing.T, goarch, file string) {
|
||||
var ok bool
|
||||
testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
|
||||
ctxt.Bso = bufio.NewWriter(os.Stdout)
|
||||
ctxt.IsAsm = true
|
||||
defer ctxt.Bso.Flush()
|
||||
failed := false
|
||||
ctxt.DiagFunc = func(format string, args ...interface{}) {
|
||||
@@ -270,7 +269,7 @@ var (
|
||||
errQuotesRE = regexp.MustCompile(`"([^"]*)"`)
|
||||
)
|
||||
|
||||
func testErrors(t *testing.T, goarch, file string, flags ...string) {
|
||||
func testErrors(t *testing.T, goarch, file string) {
|
||||
input := filepath.Join("testdata", file+".s")
|
||||
architecture, ctxt := setArch(goarch)
|
||||
lexer := lex.NewLexer(input)
|
||||
@@ -279,7 +278,6 @@ func testErrors(t *testing.T, goarch, file string, flags ...string) {
|
||||
var ok bool
|
||||
testOut = new(bytes.Buffer) // The assembler writes test output to this buffer.
|
||||
ctxt.Bso = bufio.NewWriter(os.Stdout)
|
||||
ctxt.IsAsm = true
|
||||
defer ctxt.Bso.Flush()
|
||||
failed := false
|
||||
var errBuf bytes.Buffer
|
||||
@@ -292,14 +290,6 @@ func testErrors(t *testing.T, goarch, file string, flags ...string) {
|
||||
}
|
||||
errBuf.WriteString(s)
|
||||
}
|
||||
for _, flag := range flags {
|
||||
switch flag {
|
||||
case "dynlink":
|
||||
ctxt.Flag_dynlink = true
|
||||
default:
|
||||
t.Errorf("unknown flag %s", flag)
|
||||
}
|
||||
}
|
||||
pList.Firstpc, ok = parser.Parse()
|
||||
obj.Flushplist(ctxt, pList, nil, "")
|
||||
if ok && !failed {
|
||||
@@ -368,10 +358,10 @@ func Test386EndToEnd(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestARMEndToEnd(t *testing.T) {
|
||||
defer func(old int) { buildcfg.GOARM = old }(buildcfg.GOARM)
|
||||
defer func(old int) { objabi.GOARM = old }(objabi.GOARM)
|
||||
for _, goarm := range []int{5, 6, 7} {
|
||||
t.Logf("GOARM=%d", goarm)
|
||||
buildcfg.GOARM = goarm
|
||||
objabi.GOARM = goarm
|
||||
testEndToEnd(t, "arm", "arm")
|
||||
if goarm == 6 {
|
||||
testEndToEnd(t, "arm", "armv6")
|
||||
@@ -438,10 +428,6 @@ func TestAMD64Errors(t *testing.T) {
|
||||
testErrors(t, "amd64", "amd64error")
|
||||
}
|
||||
|
||||
func TestAMD64DynLinkErrors(t *testing.T) {
|
||||
testErrors(t, "amd64", "amd64dynlinkerror", "dynlink")
|
||||
}
|
||||
|
||||
func TestMIPSEndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "mips", "mips")
|
||||
testEndToEnd(t, "mips64", "mips64")
|
||||
@@ -451,12 +437,8 @@ func TestPPC64EndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "ppc64", "ppc64")
|
||||
}
|
||||
|
||||
func TestRISCVEndToEnd(t *testing.T) {
|
||||
testEndToEnd(t, "riscv64", "riscv64")
|
||||
}
|
||||
|
||||
func TestRISCVErrors(t *testing.T) {
|
||||
testErrors(t, "riscv64", "riscv64error")
|
||||
func TestRISCVEncoder(t *testing.T) {
|
||||
testEndToEnd(t, "riscv64", "riscvenc")
|
||||
}
|
||||
|
||||
func TestS390XEndToEnd(t *testing.T) {
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
package asm
|
||||
|
||||
import (
|
||||
"internal/buildcfg"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"cmd/asm/internal/arch"
|
||||
"cmd/asm/internal/lex"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
)
|
||||
|
||||
// A simple in-out test: Do we print what we parse?
|
||||
|
||||
func setArch(goarch string) (*arch.Arch, *obj.Link) {
|
||||
buildcfg.GOOS = "linux" // obj can handle this OS for all architectures.
|
||||
buildcfg.GOARCH = goarch
|
||||
objabi.GOOS = "linux" // obj can handle this OS for all architectures.
|
||||
objabi.GOARCH = goarch
|
||||
architecture := arch.Set(goarch)
|
||||
if architecture == nil {
|
||||
panic("asm: unrecognized architecture " + goarch)
|
||||
@@ -259,7 +259,6 @@ var amd64OperandTests = []operandTest{
|
||||
{"R15", "R15"},
|
||||
{"R8", "R8"},
|
||||
{"R9", "R9"},
|
||||
{"g", "R14"},
|
||||
{"SI", "SI"},
|
||||
{"SP", "SP"},
|
||||
{"X0", "X0"},
|
||||
|
||||
@@ -305,7 +305,7 @@ func (p *Parser) pseudo(word string, operands [][]lex.Token) bool {
|
||||
// references and writes symabis information to w.
|
||||
//
|
||||
// The symabis format is documented at
|
||||
// cmd/compile/internal/ssagen.ReadSymABIs.
|
||||
// cmd/compile/internal/gc.readSymABIs.
|
||||
func (p *Parser) symDefRef(w io.Writer, word string, operands [][]lex.Token) {
|
||||
switch word {
|
||||
case "TEXT":
|
||||
@@ -689,11 +689,7 @@ func (p *Parser) registerShift(name string, prefix rune) int64 {
|
||||
p.errorf("unexpected %s in register shift", tok.String())
|
||||
}
|
||||
if p.arch.Family == sys.ARM64 {
|
||||
off, err := arch.ARM64RegisterShift(r1, op, count)
|
||||
if err != nil {
|
||||
p.errorf(err.Error())
|
||||
}
|
||||
return off
|
||||
return int64(r1&31)<<16 | int64(op)<<22 | int64(uint16(count))
|
||||
} else {
|
||||
return int64((r1 & 15) | op<<5 | count)
|
||||
}
|
||||
@@ -1003,18 +999,15 @@ func (p *Parser) registerIndirect(a *obj.Addr, prefix rune) {
|
||||
p.errorf("unimplemented two-register form")
|
||||
}
|
||||
a.Index = r1
|
||||
if scale != 0 && scale != 1 && p.arch.Family == sys.ARM64 {
|
||||
// Support (R1)(R2) (no scaling) and (R1)(R2*1).
|
||||
p.errorf("arm64 doesn't support scaled register format")
|
||||
if scale == 0 && p.arch.Family == sys.ARM64 {
|
||||
// scale is 1 by default for ARM64
|
||||
a.Scale = 1
|
||||
} else {
|
||||
a.Scale = int16(scale)
|
||||
}
|
||||
}
|
||||
p.get(')')
|
||||
} else if scale != 0 {
|
||||
if p.arch.Family == sys.ARM64 {
|
||||
p.errorf("arm64 doesn't support scaled register format")
|
||||
}
|
||||
// First (R) was missing, all we have is (R*scale).
|
||||
a.Reg = 0
|
||||
a.Index = r1
|
||||
|
||||
@@ -25,13 +25,11 @@ func tokenize(s string) [][]lex.Token {
|
||||
|
||||
func TestErroneous(t *testing.T) {
|
||||
|
||||
type errtest struct {
|
||||
tests := []struct {
|
||||
pseudo string
|
||||
operands string
|
||||
expected string
|
||||
}
|
||||
|
||||
nonRuntimeTests := []errtest{
|
||||
}{
|
||||
{"TEXT", "", "expect two or three operands for TEXT"},
|
||||
{"TEXT", "%", "expect two or three operands for TEXT"},
|
||||
{"TEXT", "1, 1", "TEXT symbol \"<erroneous symbol>\" must be a symbol(SB)"},
|
||||
@@ -60,44 +58,23 @@ func TestErroneous(t *testing.T) {
|
||||
{"PCDATA", "1", "expect two operands for PCDATA"},
|
||||
}
|
||||
|
||||
runtimeTests := []errtest{
|
||||
{"TEXT", "foo<ABIInternal>(SB),0", "TEXT \"foo\": ABIInternal requires NOSPLIT"},
|
||||
}
|
||||
|
||||
testcats := []struct {
|
||||
compilingRuntime bool
|
||||
tests []errtest
|
||||
}{
|
||||
{
|
||||
compilingRuntime: false,
|
||||
tests: nonRuntimeTests,
|
||||
},
|
||||
{
|
||||
compilingRuntime: true,
|
||||
tests: runtimeTests,
|
||||
},
|
||||
}
|
||||
|
||||
// Note these errors should be independent of the architecture.
|
||||
// Just run the test with amd64.
|
||||
parser := newParser("amd64")
|
||||
var buf bytes.Buffer
|
||||
parser.errorWriter = &buf
|
||||
|
||||
for _, cat := range testcats {
|
||||
for _, test := range cat.tests {
|
||||
parser.compilingRuntime = cat.compilingRuntime
|
||||
parser.errorCount = 0
|
||||
parser.lineNum++
|
||||
if !parser.pseudo(test.pseudo, tokenize(test.operands)) {
|
||||
t.Fatalf("Wrong pseudo-instruction: %s", test.pseudo)
|
||||
}
|
||||
errorLine := buf.String()
|
||||
if test.expected != errorLine {
|
||||
t.Errorf("Unexpected error %q; expected %q", errorLine, test.expected)
|
||||
}
|
||||
buf.Reset()
|
||||
for _, test := range tests {
|
||||
parser.errorCount = 0
|
||||
parser.lineNum++
|
||||
if !parser.pseudo(test.pseudo, tokenize(test.operands)) {
|
||||
t.Fatalf("Wrong pseudo-instruction: %s", test.pseudo)
|
||||
}
|
||||
errorLine := buf.String()
|
||||
if test.expected != errorLine {
|
||||
t.Errorf("Unexpected error %q; expected %q", errorLine, test.expected)
|
||||
}
|
||||
buf.Reset()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
// Test to make sure that if we use R15 after it is clobbered by
|
||||
// a global variable access while dynamic linking, we get an error.
|
||||
// See issue 43661.
|
||||
|
||||
TEXT ·a1(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVL $0, R15
|
||||
RET
|
||||
TEXT ·a2(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVQ $0, R15
|
||||
RET
|
||||
TEXT ·a3(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORL R15, R15
|
||||
RET
|
||||
TEXT ·a4(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORQ R15, R15
|
||||
RET
|
||||
TEXT ·a5(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
XORL R15, R15
|
||||
RET
|
||||
TEXT ·a6(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
POPQ R15
|
||||
PUSHQ R15
|
||||
RET
|
||||
TEXT ·a7(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
MOVQ R15, AX // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a8(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
ADDQ AX, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a9(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
RET
|
||||
TEXT ·a10(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JEQ one
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
one:
|
||||
RET
|
||||
TEXT ·a11(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JEQ one
|
||||
JMP two
|
||||
one:
|
||||
ORQ R15, R15 // ERROR "when dynamic linking, R15 is clobbered by a global variable access and is used here"
|
||||
two:
|
||||
RET
|
||||
TEXT ·a12(SB), 0, $0-0
|
||||
CMPL runtime·writeBarrier(SB), $0
|
||||
JMP one
|
||||
two:
|
||||
ORQ R15, R15
|
||||
RET
|
||||
one:
|
||||
MOVL $0, R15
|
||||
JMP two
|
||||
129
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
129
src/cmd/asm/internal/asm/testdata/arm64.s
vendored
@@ -64,16 +64,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
CMN R1.SXTX<<2, R10 // 5fe921ab
|
||||
CMPW R2.UXTH<<3, R11 // 7f2d226b
|
||||
CMNW R1.SXTB, R9 // 3f81212b
|
||||
ADD R1<<1, RSP, R3 // e367218b
|
||||
ADDW R1<<2, R3, RSP // 7f48210b
|
||||
SUB R1<<3, RSP // ff6f21cb
|
||||
SUBS R1<<4, RSP, R3 // e37321eb
|
||||
ADDS R1<<1, RSP, R4 // e46721ab
|
||||
CMP R1<<2, RSP // ff6b21eb
|
||||
CMN R1<<3, RSP // ff6f21ab
|
||||
ADDS R1<<1, ZR, R4 // e40701ab
|
||||
ADD R3<<50, ZR, ZR // ffcb038b
|
||||
CMP R4<<24, ZR // ff6304eb
|
||||
CMPW $0x60060, R2 // CMPW $393312, R2 // 1b0c8052db00a0725f001b6b
|
||||
CMPW $40960, R0 // 1f284071
|
||||
CMPW $27745, R2 // 3b8c8d525f001b6b
|
||||
@@ -89,7 +79,7 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
CMP R1<<33, R2
|
||||
CMP R22.SXTX, RSP // ffe336eb
|
||||
CMP $0x22220000, RSP // CMP $572653568, RSP // 5b44a4d2ff633beb
|
||||
CMPW $0x22220000, RSP // CMPW $572653568, RSP // 5b44a452ff433b6b
|
||||
CMPW $0x22220000, RSP // CMPW $572653568, RSP // 5b44a452ff633b6b
|
||||
CCMN MI, ZR, R1, $4 // e44341ba
|
||||
// MADD Rn,Rm,Ra,Rd
|
||||
MADD R1, R2, R3, R4 // 6408019b
|
||||
@@ -217,18 +207,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VUADDW2 V9.B16, V12.H8, V14.H8 // 8e11296e
|
||||
VUADDW2 V13.H8, V20.S4, V30.S4 // 9e126d6e
|
||||
VUADDW2 V21.S4, V24.D2, V29.D2 // 1d13b56e
|
||||
VUMAX V3.B8, V2.B8, V1.B8 // 4164232e
|
||||
VUMAX V3.B16, V2.B16, V1.B16 // 4164236e
|
||||
VUMAX V3.H4, V2.H4, V1.H4 // 4164632e
|
||||
VUMAX V3.H8, V2.H8, V1.H8 // 4164636e
|
||||
VUMAX V3.S2, V2.S2, V1.S2 // 4164a32e
|
||||
VUMAX V3.S4, V2.S4, V1.S4 // 4164a36e
|
||||
VUMIN V3.B8, V2.B8, V1.B8 // 416c232e
|
||||
VUMIN V3.B16, V2.B16, V1.B16 // 416c236e
|
||||
VUMIN V3.H4, V2.H4, V1.H4 // 416c632e
|
||||
VUMIN V3.H8, V2.H8, V1.H8 // 416c636e
|
||||
VUMIN V3.S2, V2.S2, V1.S2 // 416ca32e
|
||||
VUMIN V3.S4, V2.S4, V1.S4 // 416ca36e
|
||||
FCCMPS LT, F1, F2, $1 // 41b4211e
|
||||
FMADDS F1, F3, F2, F4 // 440c011f
|
||||
FMADDD F4, F5, F4, F4 // 8414441f
|
||||
@@ -374,10 +352,6 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
MOVD $1, ZR
|
||||
MOVD $1, R1
|
||||
MOVK $1, R1
|
||||
MOVD $0x1000100010001000, RSP // MOVD $1152939097061330944, RSP // ff8304b2
|
||||
MOVW $0x10001000, RSP // MOVW $268439552, RSP // ff830432
|
||||
ADDW $0x10001000, R1 // ADDW $268439552, R1 // fb83043221001b0b
|
||||
ADDW $0x22220000, RSP, R3 // ADDW $572653568, RSP, R3 // 5b44a452e3433b0b
|
||||
|
||||
// move a large constant to a Vd.
|
||||
VMOVS $0x80402010, V11 // VMOVS $2151686160, V11
|
||||
@@ -406,13 +380,13 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
// LD1/ST1
|
||||
VLD1 (R8), [V1.B16, V2.B16] // 01a1404c
|
||||
VLD1.P (R3), [V31.H8, V0.H8] // 7fa4df4c
|
||||
VLD1.P (R8)(R20), [V21.B16, V22.B16] // 15a1d44c
|
||||
VLD1.P (R8)(R20), [V21.B16, V22.B16] // VLD1.P (R8)(R20*1), [V21.B16,V22.B16] // 15a1d44c
|
||||
VLD1.P 64(R1), [V5.B16, V6.B16, V7.B16, V8.B16] // 2520df4c
|
||||
VLD1.P 1(R0), V4.B[15] // 041cdf4d
|
||||
VLD1.P 2(R0), V4.H[7] // 0458df4d
|
||||
VLD1.P 4(R0), V4.S[3] // 0490df4d
|
||||
VLD1.P 8(R0), V4.D[1] // 0484df4d
|
||||
VLD1.P (R0)(R1), V4.D[1] // 0484c14d
|
||||
VLD1.P (R0)(R1), V4.D[1] // VLD1.P (R0)(R1*1), V4.D[1] // 0484c14d
|
||||
VLD1 (R0), V4.D[1] // 0484404d
|
||||
VST1.P [V4.S4, V5.S4], 32(R1) // 24a89f4c
|
||||
VST1 [V0.S4, V1.S4], (R0) // 00a8004c
|
||||
@@ -420,29 +394,29 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VLD1.P 24(R30), [V3.S2,V4.S2,V5.S2] // c36bdf0c
|
||||
VLD2 (R29), [V23.H8, V24.H8] // b787404c
|
||||
VLD2.P 16(R0), [V18.B8, V19.B8] // 1280df0c
|
||||
VLD2.P (R1)(R2), [V15.S2, V16.S2] // 2f88c20c
|
||||
VLD2.P (R1)(R2), [V15.S2, V16.S2] // VLD2.P (R1)(R2*1), [V15.S2,V16.S2] // 2f88c20c
|
||||
VLD3 (R27), [V11.S4, V12.S4, V13.S4] // 6b4b404c
|
||||
VLD3.P 48(RSP), [V11.S4, V12.S4, V13.S4] // eb4bdf4c
|
||||
VLD3.P (R30)(R2), [V14.D2, V15.D2, V16.D2] // ce4fc24c
|
||||
VLD3.P (R30)(R2), [V14.D2, V15.D2, V16.D2] // VLD3.P (R30)(R2*1), [V14.D2,V15.D2,V16.D2] // ce4fc24c
|
||||
VLD4 (R15), [V10.H4, V11.H4, V12.H4, V13.H4] // ea05400c
|
||||
VLD4.P 32(R24), [V31.B8, V0.B8, V1.B8, V2.B8] // 1f03df0c
|
||||
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // ae09c90c
|
||||
VLD4.P (R13)(R9), [V14.S2, V15.S2, V16.S2, V17.S2] // VLD4.P (R13)(R9*1), [V14.S2,V15.S2,V16.S2,V17.S2] // ae09c90c
|
||||
VLD1R (R1), [V9.B8] // 29c0400d
|
||||
VLD1R.P (R1), [V9.B8] // 29c0df0d
|
||||
VLD1R.P 1(R1), [V2.B8] // 22c0df0d
|
||||
VLD1R.P 2(R1), [V2.H4] // 22c4df0d
|
||||
VLD1R (R0), [V0.B16] // 00c0404d
|
||||
VLD1R.P (R0), [V0.B16] // 00c0df4d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // efc5c10d
|
||||
VLD1R.P (R15)(R1), [V15.H4] // VLD1R.P (R15)(R1*1), [V15.H4] // efc5c10d
|
||||
VLD2R (R15), [V15.H4, V16.H4] // efc5600d
|
||||
VLD2R.P 16(R0), [V0.D2, V1.D2] // 00ccff4d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD2R.P (R0)(R5), [V31.D1, V0.D1] // VLD2R.P (R0)(R5*1), [V31.D1, V0.D1] // 1fcce50d
|
||||
VLD3R (RSP), [V31.S2, V0.S2, V1.S2] // ffeb400d
|
||||
VLD3R.P 6(R15), [V15.H4, V16.H4, V17.H4] // efe5df0d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD3R.P (R15)(R6), [V15.H8, V16.H8, V17.H8] // VLD3R.P (R15)(R6*1), [V15.H8, V16.H8, V17.H8] // efe5c64d
|
||||
VLD4R (R0), [V0.B8, V1.B8, V2.B8, V3.B8] // 00e0600d
|
||||
VLD4R.P 16(RSP), [V31.S4, V0.S4, V1.S4, V2.S4] // ffebff4d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VLD4R.P (R15)(R9), [V15.H4, V16.H4, V17.H4, V18.H4] // VLD4R.P (R15)(R9*1), [V15.H4, V16.H4, V17.H4, V18.H4] // efe5e90d
|
||||
VST1.P [V24.S2], 8(R2) // 58789f0c
|
||||
VST1 [V29.S2, V30.S2], (R29) // bdab000c
|
||||
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
|
||||
@@ -450,17 +424,17 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VST1.P V4.H[7], 2(R0) // 04589f4d
|
||||
VST1.P V4.S[3], 4(R0) // 04909f4d
|
||||
VST1.P V4.D[1], 8(R0) // 04849f4d
|
||||
VST1.P V4.D[1], (R0)(R1) // 0484814d
|
||||
VST1.P V4.D[1], (R0)(R1) // VST1.P V4.D[1], (R0)(R1*1) // 0484814d
|
||||
VST1 V4.D[1], (R0) // 0484004d
|
||||
VST2 [V22.H8, V23.H8], (R23) // f686004c
|
||||
VST2.P [V14.H4, V15.H4], 16(R17) // 2e869f0c
|
||||
VST2.P [V14.H4, V15.H4], (R3)(R17) // 6e84910c
|
||||
VST2.P [V14.H4, V15.H4], (R3)(R17) // VST2.P [V14.H4,V15.H4], (R3)(R17*1) // 6e84910c
|
||||
VST3 [V1.D2, V2.D2, V3.D2], (R11) // 614d004c
|
||||
VST3.P [V18.S4, V19.S4, V20.S4], 48(R25) // 324b9f4c
|
||||
VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7) // 7340870c
|
||||
VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7) // VST3.P [V19.B8, V20.B8, V21.B8], (R3)(R7*1) // 7340870c
|
||||
VST4 [V22.D2, V23.D2, V24.D2, V25.D2], (R3) // 760c004c
|
||||
VST4.P [V14.D2, V15.D2, V16.D2, V17.D2], 64(R15) // ee0d9f4c
|
||||
VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23) // 7800970c
|
||||
VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23) // VST4.P [V24.B8, V25.B8, V26.B8, V27.B8], (R3)(R23*1) // 7800970c
|
||||
|
||||
// pre/post-indexed
|
||||
FMOVS.P F20, 4(R0) // 144400bc
|
||||
@@ -547,30 +521,29 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
|
||||
// shifted or extended register offset.
|
||||
MOVD (R2)(R6.SXTW), R4 // 44c866f8
|
||||
MOVD (R3)(R6), R5 // 656866f8
|
||||
MOVD (R3)(R6*1), R5 // 656866f8
|
||||
MOVD (R2)(R6), R4 // 446866f8
|
||||
MOVD (R3)(R6), R5 // MOVD (R3)(R6*1), R5 // 656866f8
|
||||
MOVD (R2)(R6), R4 // MOVD (R2)(R6*1), R4 // 446866f8
|
||||
MOVWU (R19)(R20<<2), R20 // 747a74b8
|
||||
MOVD (R2)(R6<<3), R4 // 447866f8
|
||||
MOVD (R3)(R7.SXTX<<3), R8 // 68f867f8
|
||||
MOVWU (R5)(R4.UXTW), R10 // aa4864b8
|
||||
MOVBU (R3)(R9.UXTW), R8 // 68486938
|
||||
MOVBU (R5)(R8), R10 // aa686838
|
||||
MOVBU (R5)(R8), R10 // MOVBU (R5)(R8*1), R10 // aa686838
|
||||
MOVHU (R2)(R7.SXTW<<1), R11 // 4bd86778
|
||||
MOVHU (R1)(R2<<1), R5 // 25786278
|
||||
MOVB (R9)(R3.UXTW), R6 // 2649a338
|
||||
MOVB (R10)(R6), R15 // 4f69a638
|
||||
MOVB (R10)(R6), R15 // MOVB (R10)(R6*1), R15 // 4f69a638
|
||||
MOVB (R29)(R30<<0), R14 // ae7bbe38
|
||||
MOVB (R29)(R30), R14 // ae6bbe38
|
||||
MOVB (R29)(R30), R14 // MOVB (R29)(R30*1), R14 // ae6bbe38
|
||||
MOVH (R5)(R7.SXTX<<1), R19 // b3f8a778
|
||||
MOVH (R8)(R4<<1), R10 // 0a79a478
|
||||
MOVW (R9)(R8.SXTW<<2), R19 // 33d9a8b8
|
||||
MOVW (R1)(R4.SXTX), R11 // 2be8a4b8
|
||||
MOVW (R1)(R4.SXTX), ZR // 3fe8a4b8
|
||||
MOVW (R2)(R5), R12 // 4c68a5b8
|
||||
FMOVS (R2)(R6), F4 // 446866bc
|
||||
MOVW (R2)(R5), R12 // MOVW (R2)(R5*1), R12 // 4c68a5b8
|
||||
FMOVS (R2)(R6), F4 // FMOVS (R2)(R6*1), F4 // 446866bc
|
||||
FMOVS (R2)(R6<<2), F4 // 447866bc
|
||||
FMOVD (R2)(R6), F4 // 446866fc
|
||||
FMOVD (R2)(R6), F4 // FMOVD (R2)(R6*1), F4 // 446866fc
|
||||
FMOVD (R2)(R6<<3), F4 // 447866fc
|
||||
|
||||
MOVD R5, (R2)(R6<<3) // 457826f8
|
||||
@@ -580,16 +553,15 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
MOVW R7, (R3)(R4.SXTW) // 67c824b8
|
||||
MOVB R4, (R2)(R6.SXTX) // 44e82638
|
||||
MOVB R8, (R3)(R9.UXTW) // 68482938
|
||||
MOVB R10, (R5)(R8) // aa682838
|
||||
MOVB R10, (R5)(R8*1) // aa682838
|
||||
MOVB R10, (R5)(R8) // MOVB R10, (R5)(R8*1) // aa682838
|
||||
MOVH R11, (R2)(R7.SXTW<<1) // 4bd82778
|
||||
MOVH R5, (R1)(R2<<1) // 25782278
|
||||
MOVH R7, (R2)(R5.SXTX<<1) // 47f82578
|
||||
MOVH R8, (R3)(R6.UXTW) // 68482678
|
||||
MOVB R4, (R2)(R6.SXTX) // 44e82638
|
||||
FMOVS F4, (R2)(R6) // 446826bc
|
||||
FMOVS F4, (R2)(R6) // FMOVS F4, (R2)(R6*1) // 446826bc
|
||||
FMOVS F4, (R2)(R6<<2) // 447826bc
|
||||
FMOVD F4, (R2)(R6) // 446826fc
|
||||
FMOVD F4, (R2)(R6) // FMOVD F4, (R2)(R6*1) // 446826fc
|
||||
FMOVD F4, (R2)(R6<<3) // 447826fc
|
||||
|
||||
// vmov
|
||||
@@ -599,12 +571,9 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
|
||||
VMOV R20, V1.S[0] // 811e044e
|
||||
VMOV R20, V1.S[1] // 811e0c4e
|
||||
VMOV R1, V9.H4 // 290c020e
|
||||
VDUP R1, V9.H4 // 290c020e
|
||||
VMOV R22, V11.D2 // cb0e084e
|
||||
VDUP R22, V11.D2 // cb0e084e
|
||||
VMOV V2.B16, V4.B16 // 441ca24e
|
||||
VMOV V20.S[0], V20 // 9406045e
|
||||
VDUP V20.S[0], V20 // 9406045e
|
||||
VMOV V12.D[0], V12.D[1] // 8c05186e
|
||||
VMOV V10.S[0], V12.S[1] // 4c050c6e
|
||||
VMOV V9.H[0], V12.H[1] // 2c05066e
|
||||
@@ -1013,54 +982,6 @@ again:
|
||||
FSTPS (F3, F4), x(SB)
|
||||
FSTPS (F3, F4), x+8(SB)
|
||||
|
||||
// FLDPQ/FSTPQ
|
||||
FLDPQ -4000(R0), (F1, F2) // 1b803ed1610b40ad
|
||||
FLDPQ -1024(R0), (F1, F2) // 010860ad
|
||||
FLDPQ (R0), (F1, F2) // 010840ad
|
||||
FLDPQ 16(R0), (F1, F2) // 018840ad
|
||||
FLDPQ -16(R0), (F1, F2) // 01887fad
|
||||
FLDPQ.W 32(R0), (F1, F2) // 0108c1ad
|
||||
FLDPQ.P 32(R0), (F1, F2) // 0108c1ac
|
||||
FLDPQ 11(R0), (F1, F2) // 1b2c0091610b40ad
|
||||
FLDPQ 1024(R0), (F1, F2) // 1b001091610b40ad
|
||||
FLDPQ 4104(R0), (F1, F2)
|
||||
FLDPQ -4000(RSP), (F1, F2) // fb833ed1610b40ad
|
||||
FLDPQ -1024(RSP), (F1, F2) // e10b60ad
|
||||
FLDPQ (RSP), (F1, F2) // e10b40ad
|
||||
FLDPQ 16(RSP), (F1, F2) // e18b40ad
|
||||
FLDPQ -16(RSP), (F1, F2) // e18b7fad
|
||||
FLDPQ.W 32(RSP), (F1, F2) // e10bc1ad
|
||||
FLDPQ.P 32(RSP), (F1, F2) // e10bc1ac
|
||||
FLDPQ 11(RSP), (F1, F2) // fb2f0091610b40ad
|
||||
FLDPQ 1024(RSP), (F1, F2) // fb031091610b40ad
|
||||
FLDPQ 4104(RSP), (F1, F2)
|
||||
FLDPQ -31(R0), (F1, F2) // 1b7c00d1610b40ad
|
||||
FLDPQ -4(R0), (F1, F2) // 1b1000d1610b40ad
|
||||
FLDPQ x(SB), (F1, F2)
|
||||
FLDPQ x+8(SB), (F1, F2)
|
||||
FSTPQ (F3, F4), -4000(R5) // bb803ed1631300ad
|
||||
FSTPQ (F3, F4), -1024(R5) // a31020ad
|
||||
FSTPQ (F3, F4), (R5) // a31000ad
|
||||
FSTPQ (F3, F4), 16(R5) // a39000ad
|
||||
FSTPQ (F3, F4), -16(R5) // a3903fad
|
||||
FSTPQ.W (F3, F4), 32(R5) // a31081ad
|
||||
FSTPQ.P (F3, F4), 32(R5) // a31081ac
|
||||
FSTPQ (F3, F4), 11(R5) // bb2c0091631300ad
|
||||
FSTPQ (F3, F4), 1024(R5) // bb001091631300ad
|
||||
FSTPQ (F3, F4), 4104(R5)
|
||||
FSTPQ (F3, F4), -4000(RSP) // fb833ed1631300ad
|
||||
FSTPQ (F3, F4), -1024(RSP) // e31320ad
|
||||
FSTPQ (F3, F4), (RSP) // e31300ad
|
||||
FSTPQ (F3, F4), 16(RSP) // e39300ad
|
||||
FSTPQ (F3, F4), -16(RSP) // e3933fad
|
||||
FSTPQ.W (F3, F4), 32(RSP) // e31381ad
|
||||
FSTPQ.P (F3, F4), 32(RSP) // e31381ac
|
||||
FSTPQ (F3, F4), 11(RSP) // fb2f0091631300ad
|
||||
FSTPQ (F3, F4), 1024(RSP) // fb031091631300ad
|
||||
FSTPQ (F3, F4), 4104(RSP)
|
||||
FSTPQ (F3, F4), x(SB)
|
||||
FSTPQ (F3, F4), x+8(SB)
|
||||
|
||||
// System Register
|
||||
MSR $1, SPSel // bf4100d5
|
||||
MSR $9, DAIFSet // df4903d5
|
||||
|
||||
46
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
46
src/cmd/asm/internal/asm/testdata/arm64enc.s
vendored
@@ -188,7 +188,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
MOVBU 2916(R24), R3 // 03936d39
|
||||
MOVBU (R19)(R14<<0), R23 // 777a6e38
|
||||
MOVBU (R2)(R8.SXTX), R19 // 53e86838
|
||||
MOVBU (R27)(R23), R14 // 6e6b7738
|
||||
MOVBU (R27)(R23), R14 // MOVBU (R27)(R23*1), R14 // 6e6b7738
|
||||
MOVHU.P 107(R14), R13 // cdb54678
|
||||
MOVHU.W 192(R3), R2 // 620c4c78
|
||||
MOVHU 6844(R4), R19 // 93787579
|
||||
@@ -201,9 +201,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
MOVB 997(R9), R23 // 37958f39
|
||||
//TODO MOVBW (R2<<1)(R21), R15 // af7ae238
|
||||
//TODO MOVBW (R26)(R0), R21 // 1568fa38
|
||||
MOVB (R5)(R15), R16 // b068af38
|
||||
MOVB (R5)(R15), R16 // MOVB (R5)(R15*1), R16 // b068af38
|
||||
MOVB (R19)(R26.SXTW), R19 // 73caba38
|
||||
MOVB (R29)(R30), R14 // ae6bbe38
|
||||
MOVB (R29)(R30), R14 // MOVB (R29)(R30*1), R14 // ae6bbe38
|
||||
//TODO MOVHW.P 218(R22), R25 // d9a6cd78
|
||||
MOVH.P 179(R23), R5 // e5368b78
|
||||
//TODO MOVHW.W 136(R2), R27 // 5b8cc878
|
||||
@@ -357,12 +357,12 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
MOVD R25, -137(R17) // 397217f8
|
||||
MOVW R4, (R12)(R22.UXTW<<2) // 845936b8
|
||||
MOVD R27, (R5)(R15.UXTW<<3) // bb582ff8
|
||||
MOVB R2, (R10)(R16) // 42693038
|
||||
MOVB R2, (R29)(R26) // a26b3a38
|
||||
MOVB R2, (R10)(R16) // MOVB R2, (R10)(R16*1) // 42693038
|
||||
MOVB R2, (R29)(R26) // MOVB R2, (R29)(R26*1) // a26b3a38
|
||||
MOVH R11, -80(R23) // eb021b78
|
||||
MOVH R11, (R27)(R14.SXTW<<1) // 6bdb2e78
|
||||
MOVB R19, (R0)(R4) // 13682438
|
||||
MOVB R1, (R6)(R4) // c1682438
|
||||
MOVB R19, (R0)(R4) // MOVB R19, (R0)(R4*1) // 13682438
|
||||
MOVB R1, (R6)(R4) // MOVB R1, (R6)(R4*1) // c1682438
|
||||
MOVH R3, (R11)(R13<<1) // 63792d78
|
||||
//TODO STTR 55(R4), R29 // 9d7803b8
|
||||
//TODO STTR 124(R5), R25 // b9c807f8
|
||||
@@ -669,7 +669,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
VCMEQ V24.S4, V13.S4, V12.S4 // ac8db86e
|
||||
VCNT V13.B8, V11.B8 // ab59200e
|
||||
VMOV V31.B[15], V18 // f2071f5e
|
||||
VDUP V31.B[15], V18 // f2071f5e
|
||||
VDUP V31.B[13], V20.B16 // f4071b4e
|
||||
VEOR V4.B8, V18.B8, V7.B8 // 471e242e
|
||||
VEXT $4, V2.B8, V1.B8, V3.B8 // 2320022e
|
||||
@@ -680,28 +679,27 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
VLD1 (R24), [V18.D1, V19.D1, V20.D1] // 126f400c
|
||||
VLD1 (R29), [V14.D1, V15.D1, V16.D1, V17.D1] // ae2f400c
|
||||
VLD1.P 16(R23), [V1.B16] // e172df4c
|
||||
VLD1.P (R6)(R11), [V31.D1] // df7ccb0c
|
||||
VLD1.P (R6)(R11), [V31.D1] // VLD1.P (R6)(R11*1), [V31.D1] // df7ccb0c
|
||||
VLD1.P 16(R7), [V31.D1, V0.D1] // ffacdf0c
|
||||
VLD1.P (R19)(R4), [V24.B8, V25.B8] // 78a2c40c
|
||||
VLD1.P (R20)(R8), [V7.H8, V8.H8, V9.H8] // 8766c84c
|
||||
VLD1.P (R19)(R4), [V24.B8, V25.B8] // VLD1.P (R19)(R4*1), [V24.B8, V25.B8] // 78a2c40c
|
||||
VLD1.P (R20)(R8), [V7.H8, V8.H8, V9.H8] // VLD1.P (R20)(R8*1), [V7.H8, V8.H8, V9.H8] // 8766c84c
|
||||
VLD1.P 32(R30), [V5.B8, V6.B8, V7.B8, V8.B8] // c523df0c
|
||||
VLD1 (R19), V14.B[15] // 6e1e404d
|
||||
VLD1 (R29), V0.H[1] // a04b400d
|
||||
VLD1 (R27), V2.S[0] // 6283400d
|
||||
VLD1 (R21), V5.D[1] // a586404d
|
||||
VLD1.P 1(R19), V10.B[14] // 6a1adf4d
|
||||
VLD1.P (R3)(R14), V16.B[11] // 700cce4d
|
||||
VLD1.P (R3)(R14), V16.B[11] // VLD1.P (R3)(R14*1), V16.B[11] // 700cce4d
|
||||
VLD1.P 2(R1), V28.H[2] // 3c50df0d
|
||||
VLD1.P (R13)(R20), V9.H[2] // a951d40d
|
||||
VLD1.P (R13)(R20), V9.H[2] // VLD1.P (R13)(R20*1), V9.H[2] // a951d40d
|
||||
VLD1.P 4(R17), V1.S[3] // 2192df4d
|
||||
VLD1.P (R14)(R2), V17.S[2] // d181c24d
|
||||
VLD1.P (R14)(R2), V17.S[2] // VLD1.P (R14)(R2*1), V17.S[2] // d181c24d
|
||||
VLD1.P 8(R5), V30.D[1] // be84df4d
|
||||
VLD1.P (R27)(R13), V27.D[0] // 7b87cd0d
|
||||
VLD1.P (R27)(R13), V27.D[0] // VLD1.P (R27)(R13*1), V27.D[0] // 7b87cd0d
|
||||
//TODO FMOVS.P -29(RSP), F8 // e8375ebc
|
||||
//TODO FMOVS.W 71(R29), F28 // bc7f44bc
|
||||
FMOVS 6160(R4), F23 // 971058bd
|
||||
VMOV V18.B[10], V27 // 5b06155e
|
||||
VDUP V18.B[10], V27 // 5b06155e
|
||||
VMOV V12.B[2], V28.B[12] // 9c15196e
|
||||
VMOV R30, V4.B[13] // c41f1b4e
|
||||
VMOV V2.B16, V4.B16 // 441ca24e
|
||||
@@ -734,25 +732,25 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$-8
|
||||
VSHL $7, V22.D2, V25.D2 // d956474f
|
||||
VST1 [V14.H4, V15.H4, V16.H4], (R27) // 6e67000c
|
||||
VST1 [V2.S4, V3.S4, V4.S4, V5.S4], (R14) // c229004c
|
||||
VST1.P [V25.S4], (R7)(R29) // f9789d4c
|
||||
VST1.P [V25.S4], (R7)(R29) // VST1.P [V25.S4], (R7)(R29*1) // f9789d4c
|
||||
VST1.P [V25.D2, V26.D2], 32(R7) // f9ac9f4c
|
||||
VST1.P [V14.D1, V15.D1], (R7)(R23) // eeac970c
|
||||
VST1.P [V14.D1, V15.D1], (R7)(R23) // VST1.P [V14.D1, V15.D1], (R7)(R23*1) // eeac970c
|
||||
VST1.P [V25.D2, V26.D2, V27.D2], 48(R27) // 796f9f4c
|
||||
VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14) // 6d648e4c
|
||||
VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14) // VST1.P [V13.H8, V14.H8, V15.H8], (R3)(R14*1) // 6d648e4c
|
||||
VST1.P [V16.S4, V17.S4, V18.S4, V19.S4], 64(R6) // d0289f4c
|
||||
VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16) // 9324900c
|
||||
VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16) // VST1.P [V19.H4, V20.H4, V21.H4, V22.H4], (R4)(R16*1) // 9324900c
|
||||
VST1 V12.B[3], (R1) // 2c0c000d
|
||||
VST1 V12.B[3], (R1) // 2c0c000d
|
||||
VST1 V25.S[2], (R20) // 9982004d
|
||||
VST1 V9.D[1], (RSP) // e987004d
|
||||
VST1.P V30.B[6], 1(R3) // 7e189f0d
|
||||
VST1.P V8.B[0], (R3)(R21) // 6800950d
|
||||
VST1.P V8.B[0], (R3)(R21) // VST1.P V8.B[0], (R3)(R21*1) // 6800950d
|
||||
VST1.P V15.H[5], 2(R10) // 4f499f4d
|
||||
VST1.P V1.H[7], (R23)(R11) // e15a8b4d
|
||||
VST1.P V1.H[7], (R23)(R11) // VST1.P V1.H[7], (R23)(R11*1) // e15a8b4d
|
||||
VST1.P V26.S[0], 4(R11) // 7a819f0d
|
||||
VST1.P V9.S[1], (R16)(R21) // 0992950d
|
||||
VST1.P V9.S[1], (R16)(R21) // VST1.P V9.S[1], (R16)(R21*1) // 0992950d
|
||||
VST1.P V16.D[0], 8(R9) // 30859f0d
|
||||
VST1.P V23.D[1], (R21)(R16) // b786904d
|
||||
VST1.P V23.D[1], (R21)(R16) // VST1.P V23.D[1], (R21)(R16*1) // b786904d
|
||||
VSUB V1, V12, V23 // 9785e17e
|
||||
VUADDLV V31.S4, V11 // eb3bb06e
|
||||
UCVTFWS R11, F19 // 7301231e
|
||||
|
||||
76
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
76
src/cmd/asm/internal/asm/testdata/arm64error.s
vendored
@@ -8,60 +8,12 @@ TEXT errors(SB),$0
|
||||
ADDSW R7->32, R14, R13 // ERROR "shift amount out of range 0 to 31"
|
||||
ADD R1.UXTB<<5, R2, R3 // ERROR "shift amount out of range 0 to 4"
|
||||
ADDS R1.UXTX<<7, R2, R3 // ERROR "shift amount out of range 0 to 4"
|
||||
ADDS R5, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS R5, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW R5, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW R5, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
ADDS $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
ADDSW $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
SUBS $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0xff, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0xffff0, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0x1000100010001000, R6, RSP // ERROR "illegal destination register"
|
||||
SUBSW $0x10001000100011, R6, RSP // ERROR "illegal destination register"
|
||||
AND $0x22220000, R2, RSP // ERROR "illegal combination"
|
||||
ANDS $0x22220000, R2, RSP // ERROR "illegal combination"
|
||||
ADD R1, R2, R3, R4 // ERROR "illegal combination"
|
||||
BICW R7@>33, R5, R16 // ERROR "shift amount out of range 0 to 31"
|
||||
NEGW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
|
||||
NEGSW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
|
||||
ADD R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDS R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
ADDSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUB R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBS R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
SUBSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
|
||||
CMP R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMPW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMN R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CMNW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEG R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGS R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
NEGSW R7@>2, R5 // ERROR "unsupported shift operator"
|
||||
CINC CS, R2, R3, R4 // ERROR "illegal combination"
|
||||
CSEL LT, R1, R2 // ERROR "illegal combination"
|
||||
CINC AL, R2, R3 // ERROR "invalid condition"
|
||||
CINC NV, R2, R3 // ERROR "invalid condition"
|
||||
CINVW AL, R2, R3 // ERROR "invalid condition"
|
||||
CINV NV, R2, R3 // ERROR "invalid condition"
|
||||
CNEG AL, R2, R3 // ERROR "invalid condition"
|
||||
CNEGW NV, R2, R3 // ERROR "invalid condition"
|
||||
CSET AL, R2 // ERROR "invalid condition"
|
||||
CSET NV, R2 // ERROR "invalid condition"
|
||||
CSETMW AL, R2 // ERROR "invalid condition"
|
||||
CSETM NV, R2 // ERROR "invalid condition"
|
||||
LDP.P 8(R2), (R2, R3) // ERROR "constrained unpredictable behavior"
|
||||
LDP.W 8(R3), (R2, R3) // ERROR "constrained unpredictable behavior"
|
||||
LDP (R1), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||
@@ -69,8 +21,8 @@ TEXT errors(SB),$0
|
||||
LDP (R0), (R3, ZR) // ERROR "invalid register pair"
|
||||
LDXPW (RSP), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||
LDAXPW (R5), (R2, R2) // ERROR "constrained unpredictable behavior"
|
||||
MOVD.P 300(R2), R3 // ERROR "offset out of range [-256,255]"
|
||||
MOVD.P R3, 344(R2) // ERROR "offset out of range [-256,255]"
|
||||
MOVD.P 300(R2), R3 // ERROR "offset out of range [-255,254]"
|
||||
MOVD.P R3, 344(R2) // ERROR "offset out of range [-255,254]"
|
||||
MOVD (R3)(R7.SXTX<<2), R8 // ERROR "invalid index shift amount"
|
||||
MOVWU (R5)(R4.UXTW<<3), R10 // ERROR "invalid index shift amount"
|
||||
MOVWU (R5)(R4<<1), R10 // ERROR "invalid index shift amount"
|
||||
@@ -106,13 +58,13 @@ TEXT errors(SB),$0
|
||||
VMOV V8.H[9], R3 // ERROR "register element index out of range 0 to 7"
|
||||
VMOV V8.S[4], R3 // ERROR "register element index out of range 0 to 3"
|
||||
VMOV V8.D[2], R3 // ERROR "register element index out of range 0 to 1"
|
||||
VDUP V8.B[16], V3.B16 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.B[17], V3.B8 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.H[9], V3.H4 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.H[9], V3.H8 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.S[4], V3.S2 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.S[4], V3.S4 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.D[2], V3.D2 // ERROR "register element index out of range 0 to 1"
|
||||
VDUP V8.B[16], R3.B16 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.B[17], R3.B8 // ERROR "register element index out of range 0 to 15"
|
||||
VDUP V8.H[9], R3.H4 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.H[9], R3.H8 // ERROR "register element index out of range 0 to 7"
|
||||
VDUP V8.S[4], R3.S2 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.S[4], R3.S4 // ERROR "register element index out of range 0 to 3"
|
||||
VDUP V8.D[2], R3.D2 // ERROR "register element index out of range 0 to 1"
|
||||
VFMLA V1.D2, V12.D2, V3.S2 // ERROR "operand mismatch"
|
||||
VFMLA V1.S2, V12.S2, V3.D2 // ERROR "operand mismatch"
|
||||
VFMLA V1.S4, V12.S2, V3.D2 // ERROR "operand mismatch"
|
||||
@@ -157,9 +109,6 @@ TEXT errors(SB),$0
|
||||
VREV16 V1.D1, V2.D1 // ERROR "invalid arrangement"
|
||||
VREV16 V1.B8, V2.B16 // ERROR "invalid arrangement"
|
||||
VREV16 V1.H4, V2.H4 // ERROR "invalid arrangement"
|
||||
FLDPQ (R0), (R1, R2) // ERROR "invalid register pair"
|
||||
FLDPQ (R1), (F2, F2) // ERROR "constrained unpredictable behavior"
|
||||
FSTPQ (R1, R2), (R0) // ERROR "invalid register pair"
|
||||
FLDPD (R0), (R1, R2) // ERROR "invalid register pair"
|
||||
FLDPD (R1), (F2, F2) // ERROR "constrained unpredictable behavior"
|
||||
FLDPS (R2), (F3, F3) // ERROR "constrained unpredictable behavior"
|
||||
@@ -406,17 +355,10 @@ TEXT errors(SB),$0
|
||||
VBIF V0.D2, V1.D2, V2.D2 // ERROR "invalid arrangement"
|
||||
VUADDW V9.B8, V12.H8, V14.B8 // ERROR "invalid arrangement"
|
||||
VUADDW2 V9.B8, V12.S4, V14.S4 // ERROR "operand mismatch"
|
||||
VUMAX V1.D2, V2.D2, V3.D2 // ERROR "invalid arrangement"
|
||||
VUMIN V1.D2, V2.D2, V3.D2 // ERROR "invalid arrangement"
|
||||
VUMAX V1.B8, V2.B8, V3.B16 // ERROR "operand mismatch"
|
||||
VUMIN V1.H4, V2.S4, V3.H4 // ERROR "operand mismatch"
|
||||
VSLI $64, V7.D2, V8.D2 // ERROR "shift out of range"
|
||||
VUSRA $0, V7.D2, V8.D2 // ERROR "shift out of range"
|
||||
CASPD (R3, R4), (R2), (R8, R9) // ERROR "source register pair must start from even register"
|
||||
CASPD (R2, R3), (R2), (R9, R10) // ERROR "destination register pair must start from even register"
|
||||
CASPD (R2, R4), (R2), (R8, R9) // ERROR "source register pair must be contiguous"
|
||||
CASPD (R2, R3), (R2), (R8, R10) // ERROR "destination register pair must be contiguous"
|
||||
ADD R1>>2, RSP, R3 // ERROR "illegal combination"
|
||||
ADDS R2<<3, R3, RSP // ERROR "unexpected SP reference"
|
||||
CMP R1<<5, RSP // ERROR "the left shift amount out of range 0 to 4"
|
||||
RET
|
||||
|
||||
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
8
src/cmd/asm/internal/asm/testdata/mips64.s
vendored
@@ -407,8 +407,6 @@ label4:
|
||||
SRLV R27, R6, R17 // 03668816
|
||||
SRA R11, R19, R20 // 0173a007
|
||||
SRAV R20, R19, R19 // 02939817
|
||||
ROTR R19, R18, R20 // 0272a046
|
||||
ROTRV R9, R13, R16 // 012d8056
|
||||
|
||||
// LSHW rreg ',' rreg
|
||||
// {
|
||||
@@ -420,8 +418,6 @@ label4:
|
||||
SRLV R27, R6 // 03663016
|
||||
SRA R11, R19 // 01739807
|
||||
SRAV R20, R19 // 02939817
|
||||
ROTR R20, R19 // 02939846
|
||||
ROTRV R16, R9 // 02094856
|
||||
|
||||
// LSHW imm ',' sreg ',' rreg
|
||||
// {
|
||||
@@ -433,8 +429,6 @@ label4:
|
||||
SRLV $31, R6, R17 // 00068ffa
|
||||
SRA $8, R8, R19 // 00089a03
|
||||
SRAV $19, R8, R7 // 00083cfb
|
||||
ROTR $12, R8, R3 // 00281b02
|
||||
ROTRV $8, R22, R22 // 0036b23a
|
||||
|
||||
// LSHW imm ',' rreg
|
||||
// {
|
||||
@@ -446,8 +440,6 @@ label4:
|
||||
SRLV $31, R17 // 00118ffa
|
||||
SRA $3, R12 // 000c60c3
|
||||
SRAV $12, R3 // 00031b3b
|
||||
ROTR $12, R8 // 00284302
|
||||
ROTRV $63, R22 // 0036b7fe
|
||||
|
||||
|
||||
// LAND/LXOR/LNOR/LOR rreg ',' rreg
|
||||
|
||||
19
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
19
src/cmd/asm/internal/asm/testdata/ppc64.s
vendored
@@ -41,8 +41,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVDBR (R3)(R4), R5 // 7ca41c28
|
||||
MOVWBR (R3)(R4), R5 // 7ca41c2c
|
||||
MOVHBR (R3)(R4), R5 // 7ca41e2c
|
||||
MOVD $foo+4009806848(FP), R5 // 3ca1ef0138a5cc20
|
||||
MOVD $foo(SB), R5 // 3ca0000038a50000
|
||||
|
||||
MOVDU 8(R3), R4 // e8830009
|
||||
MOVDU (R3)(R4), R5 // 7ca4186a
|
||||
@@ -79,15 +77,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
MOVBU R4, 1(R3) // 9c830001
|
||||
MOVBU R5, (R3)(R4) // 7ca419ee
|
||||
|
||||
MOVB $0, R4 // 38800000
|
||||
MOVBZ $0, R4 // 38800000
|
||||
MOVH $0, R4 // 38800000
|
||||
MOVHZ $0, R4 // 38800000
|
||||
MOVW $0, R4 // 38800000
|
||||
MOVWZ $0, R4 // 38800000
|
||||
MOVD $0, R4 // 38800000
|
||||
MOVD $0, R0 // 38000000
|
||||
|
||||
ADD $1, R3 // 38630001
|
||||
ADD $1, R3, R4 // 38830001
|
||||
ADD $-1, R4 // 3884ffff
|
||||
@@ -291,17 +280,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
ROTLW R3, R4, R5 // 5c85183e
|
||||
EXTSWSLI $3, R4, R5 // 7c851ef4
|
||||
RLWMI $7, R3, $65535, R6 // 50663c3e
|
||||
RLWMI $7, R3, $16, $31, R6 // 50663c3e
|
||||
RLWMICC $7, R3, $65535, R6 // 50663c3f
|
||||
RLWMICC $7, R3, $16, $31, R6 // 50663c3f
|
||||
RLWNM $3, R4, $7, R6 // 54861f7e
|
||||
RLWNM $3, R4, $29, $31, R6 // 54861f7e
|
||||
RLWNM R3, R4, $7, R6 // 5c861f7e
|
||||
RLWNM R3, R4, $29, $31, R6 // 5c861f7e
|
||||
RLWNMCC $3, R4, $7, R6 // 54861f7f
|
||||
RLWNMCC $3, R4, $29, $31, R6 // 54861f7f
|
||||
RLWNMCC R3, R4, $7, R6 // 5c861f7f
|
||||
RLWNMCC R3, R4, $29, $31, R6 // 5c861f7f
|
||||
RLDMI $0, R4, $7, R6 // 7886076c
|
||||
RLDMICC $0, R4, $7, R6 // 7886076d
|
||||
RLDIMI $0, R4, $7, R6 // 788601cc
|
||||
@@ -320,8 +303,6 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
|
||||
RLDICCC $0, R4, $15, R6 // 788603c9
|
||||
CLRLSLWI $16, R5, $8, R4 // 54a4422e
|
||||
CLRLSLDI $24, R4, $2, R3 // 78831588
|
||||
RLDCR $1, R1, $-16, R1 // 78210ee4
|
||||
RLDCRCC $1, R1, $-16, R1 // 78210ee5
|
||||
|
||||
BEQ 0(PC) // 41820000
|
||||
BEQ CR1,0(PC) // 41860000
|
||||
|
||||
14
src/cmd/asm/internal/asm/testdata/riscv64error.s
vendored
14
src/cmd/asm/internal/asm/testdata/riscv64error.s
vendored
@@ -1,14 +0,0 @@
|
||||
// Copyright 2021 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.
|
||||
|
||||
TEXT errors(SB),$0
|
||||
MOV $0, 0(SP) // ERROR "constant load must target register"
|
||||
MOV $0, 8(SP) // ERROR "constant load must target register"
|
||||
MOV $1234, 0(SP) // ERROR "constant load must target register"
|
||||
MOV $1234, 8(SP) // ERROR "constant load must target register"
|
||||
MOVB $1, X5 // ERROR "unsupported constant load"
|
||||
MOVH $1, X5 // ERROR "unsupported constant load"
|
||||
MOVW $1, X5 // ERROR "unsupported constant load"
|
||||
MOVF $1, X5 // ERROR "unsupported constant load"
|
||||
RET
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user