CMake Nightly Date Stamp
[kiteware-cmake.git] / Tests / RunCMake / exit_crash.c
blob324ffad712af13c4a7bbe755922f9590970a66c7
1 int main(int argc, const char* argv[])
3 #ifndef __clang_analyzer__ /* Suppress clang-analyzer warnings */
4 /* Construct an invalid address that cannot be predicted by the
5 compiler/optimizer, and that is not NULL (which is undefined
6 behavior to dereference). */
7 volatile int* invalidAddress = 0;
8 invalidAddress += argc ? 1 : 2;
9 (void)argv;
10 /* Write to the invalid address to cause SIGSEGV or similar. */
11 *invalidAddress = 0;
12 #endif
13 return 0;