Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
d660688f
Commit
d660688f
authored
Jun 17, 2013
by
Dmitriy Vyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime/race: add tests for method thunks
R=golang-dev, dave CC=golang-dev
https://golang.org/cl/10257043
parent
f84cbd09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
0 deletions
+87
-0
mop_test.go
src/pkg/runtime/race/testdata/mop_test.go
+87
-0
No files found.
src/pkg/runtime/race/testdata/mop_test.go
View file @
d660688f
...
...
@@ -1811,3 +1811,90 @@ And Brutus is an honourable man.`
}
_
=
res
}
type
Base
int
func
(
b
*
Base
)
Foo
()
int
{
return
42
}
func
(
b
Base
)
Bar
()
int
{
return
int
(
b
)
}
func
TestNoRaceMethodThunk
(
t
*
testing
.
T
)
{
type
Derived
struct
{
pad
int
Base
}
var
d
Derived
done
:=
make
(
chan
bool
)
go
func
()
{
_
=
d
.
Foo
()
done
<-
true
}()
d
=
Derived
{}
<-
done
}
func
TestRaceMethodThunk
(
t
*
testing
.
T
)
{
type
Derived
struct
{
pad
int
*
Base
}
var
d
Derived
done
:=
make
(
chan
bool
)
go
func
()
{
_
=
d
.
Foo
()
done
<-
true
}()
d
=
Derived
{}
<-
done
}
func
TestRaceMethodThunk2
(
t
*
testing
.
T
)
{
type
Derived
struct
{
pad
int
Base
}
var
d
Derived
done
:=
make
(
chan
bool
)
go
func
()
{
_
=
d
.
Bar
()
done
<-
true
}()
d
=
Derived
{}
<-
done
}
func
TestRaceMethodThunk3
(
t
*
testing
.
T
)
{
type
Derived
struct
{
pad
int
*
Base
}
var
d
Derived
d
.
Base
=
new
(
Base
)
done
:=
make
(
chan
bool
)
go
func
()
{
_
=
d
.
Bar
()
done
<-
true
}()
d
.
Base
=
new
(
Base
)
<-
done
}
func
TestRaceMethodThunk4
(
t
*
testing
.
T
)
{
type
Derived
struct
{
pad
int
*
Base
}
var
d
Derived
d
.
Base
=
new
(
Base
)
done
:=
make
(
chan
bool
)
go
func
()
{
_
=
d
.
Bar
()
done
<-
true
}()
*
(
*
int
)(
d
.
Base
)
=
42
<-
done
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment