blob: 831ba1bfed669c9f501103713b10c921276dd5e6 [file] [log] [blame]
This test checks completion of labels.
-- flags --
-ignore_extra_diags
-- labels.go --
package labels
func _() {
goto F //@complete(re"() \\/\\/", label1, label5)
Foo1: //@item(label1, "Foo1", "label", "const")
for a, b := range []int{} {
Foo2: //@item(label2, "Foo2", "label", "const")
switch {
case true:
break F //@complete(re"() \\/\\/", label2, label1)
continue F //@complete(re"() \\/\\/", label1)
{
FooUnjumpable:
}
goto F //@complete(re"() \\/\\/", label1, label2, label4, label5)
func() {
goto F //@complete(re"() \\/\\/", label3)
break F //@complete(re"() \\/\\/")
continue F //@complete(re"() \\/\\/")
Foo3: //@item(label3, "Foo3", "label", "const")
}()
}
Foo4: //@item(label4, "Foo4", "label", "const")
switch any(a).(type) {
case int:
break F //@complete(re"() \\/\\/", label4, label1)
}
}
break F //@complete(re"() \\/\\/")
continue F //@complete(re"() \\/\\/")
Foo5: //@item(label5, "Foo5", "label", "const")
for {
break F //@complete(re"() \\/\\/", label5)
}
return
}