summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/switch1.C
blob: c21630d752b607926122c6ae27070dd46c79aa54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-options "-O1" }

template <typename T>
int f(T t) {
  switch (t) {
  case 1:
    return 5;
  case 2:
    return 6;
  case 3:
    return -4;
  case 4:
    return 8;
  case 5:
    return 12;
  case 6:
    return 13;
  default:
    return -27;
  }
}

template int f(int);