1 // RUN: %clangxx_msan -O2 %s -o %t && %run %t
3 #include <sanitizer/msan_interface.h>
11 // Here S is passed to FooRun as a 64-bit integer.
12 // This triggers an optimization where 10000 * s.a is transformed into
13 // ((*(uint64_t *)&s) * (10000 * 2**32)) >> 32
14 // Test that MSan understands that this kills the uninitialized high half of S
17 int64_t x
= 10000 * s
.a
;
18 __msan_check_mem_is_initialized(&x
, sizeof(x
));
23 // Take &z to ensure that it is built on stack.