1// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o - %s | grep "ret i32 2520" 2 3static int foo(unsigned i) { 4 void *addrs[] = { &&L1, &&L2, &&L3, &&L4, &&L5 }; 5 int res = 1; 6 7 goto *addrs[i]; 8 L5: res *= 11; 9 L4: res *= 7; 10 L3: res *= 5; 11 L2: res *= 3; 12 L1: res *= 2; 13 return res; 14} 15 16static int foo2(unsigned i) { 17 static const void *addrs[] = { &&L1, &&L2, &&L3, &&L4, &&L5 }; 18 int res = 1; 19 20 goto *addrs[i]; 21L5: res *= 11; 22L4: res *= 7; 23L3: res *= 5; 24L2: res *= 3; 25L1: res *= 2; 26 return res; 27} 28 29int main() { 30 return foo(3)+foo2(4); 31} 32