repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR inline-asm/84742
[official-gcc.git]
/
gcc
/
testsuite
/
go.go-torture
/
execute
/
map-1.go
blob
2054c6c413b6315390e53d89c8b9c183bfc6c08e
1
package
main
2
3
func
main
() {
4
v
:=
make
(
map
[
int
]
int
);
5
v
[
0
] =
0
;
6
v
[
1000000
] =
1
;
7
if
v
[
0
] !=
0
{
8
panic
(
1
)
9
}
10
val
,
present
:=
v
[
0
];
11
if
!
present || val
!=
0
{
12
panic
(
2
)
13
}
14
val
=
5
;
15
val
,
present
=
v
[
1
];
16
if
present || val
!=
0
{
17
panic
(
3
);
18
}
19
if
v
[
2
] !=
0
{
20
panic
(
4
)
21
}
22
val
,
present
=
v
[
2
];
23
if
present
{
24
panic
(
5
)
25
}
26
if
len
(
v
) !=
2
{
27
panic
(
6
)
28
}
29
delete
(
v
,
0
)
30
if
len
(
v
) !=
1
{
31
panic
(
7
)
32
}
33
34
w
:=
make
(
map
[
string
]
string
);
35
if
len
(
w
) !=
0
{
36
panic
(
8
)
37
}
38
w
[
"Hello"
] =
"world"
;
39
w
[
"Goodbye"
] =
"sweet prince"
;
40
if
w
[
"Hello"
] !=
"world"
{
41
panic
(
9
)
42
}
43
if
w
[
"Hej"
] !=
""
{
44
panic
(
10
)
45
}
46
}