diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/msan/preinit_array.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/msan/preinit_array.cpp b/test/msan/preinit_array.cpp new file mode 100644 index 000000000..6f877bac0 --- /dev/null +++ b/test/msan/preinit_array.cpp @@ -0,0 +1,16 @@ +// RUN: %clangxx_msan -O0 %s -o %t && %run %t + +#include <sanitizer/msan_interface.h> + +volatile int global; +static void pre_ctor() { + volatile int local; + global = 42; + local = 42; +} + +__attribute__((section(".preinit_array"), used)) void(*__local_pre_ctor)(void) = pre_ctor; + +int main(void) { + return 0; +} |