gcc/testsuite/go.test/test/fixedbugs/issue15071.dir/exp.go
raw| 1 | // Copyright 2016 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package exp |
| 6 | |
| 7 | func Exported(x int) int { |
| 8 | return inlined(x) |
| 9 | } |
| 10 | |
| 11 | func inlined(x int) int { |
| 12 | y := 0 |
| 13 | switch { |
| 14 | case x > 0: |
| 15 | y += 5 |
| 16 | return 0 + y |
| 17 | case x < 1: |
| 18 | y += 6 |
| 19 | fallthrough |
| 20 | default: |
| 21 | y += 7 |
| 22 | return 2 + y |
| 23 | } |
| 24 | } |