Peter Collingbourne | ad9841e | 2014-11-27 00:06:42 +0000 | [diff] [blame] | 1 | // RUN: llgo -o %t %s |
2 | // RUN: %t 2>&1 | FileCheck %s | ||||
3 | |||||
4 | // CHECK: 1 | ||||
5 | // CHECK-NEXT: 2 | ||||
6 | |||||
7 | package main | ||||
8 | |||||
9 | func main() { | ||||
10 | // case clauses have their own scope. | ||||
11 | switch { | ||||
12 | case true, false: | ||||
13 | x := 1 | ||||
14 | println(x) | ||||
15 | fallthrough | ||||
16 | default: | ||||
17 | x := 2 | ||||
18 | println(x) | ||||
19 | } | ||||
20 | } |