rust/src/test/codegen/small-dense-int-switch.cc

12 lines
173 B
C++
Raw Normal View History

2013-07-16 19:42:28 -05:00
#include <stdlib.h>
extern "C"
size_t test(size_t x, size_t y) {
switch (x) {
case 1: return y;
case 2: return y*2;
case 4: return y*3;
default: return 11;
}
}