Fix gcc-6 bug in the rand test.
There seems to be a silly optimization bug in gcc-6 that completely elides r, causing the check r >= x to compare garbage values and fail. Marking the function noinline forces the compiler to keep the return value and lets the test pass.