Fixes for AbsRegion and jump table index slicing involving global variable (#695)
[dyninst.git] / cmake / CheckCXX11Features / cxx11-test-constexpr.cpp
1 constexpr int square(int x)
2 {
3         return x*x;
4 }
5
6 constexpr int the_answer()
7 {
8         return 42;
9 }
10
11 int main()
12 {
13         int test_arr[square(3)];
14         bool ret = (
15                 (square(the_answer()) == 1764) &&
16                 (sizeof(test_arr)/sizeof(test_arr[0]) == 9)
17         );
18         return ret ? 0 : 1;
19 }