1 // RUN: %clangxx_msan -fexceptions -fsanitize-memory-track-origins=2 %libatomic -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-SHADOW
3 // PPC has no libatomic
4 // UNSUPPORTED: powerpc64-target-arch
5 // UNSUPPORTED: powerpc64le-target-arch
7 #include <sanitizer/msan_interface.h>
10 typedef struct __attribute((packed
)) {
14 void copy(i24
*dst
, i24
*src
);
20 __msan_check_mem_is_initialized(&init
, 3);
22 __msan_check_mem_is_initialized(&init
, 3);
25 void copy(i24
*dst
, i24
*src
) {
27 __atomic_load(src
, dst
, __ATOMIC_RELAXED
);
32 // CHECK: MemorySanitizer: use-of-uninitialized-value
33 // CHECK: #0 {{0x[a-f0-9]+}} in main{{.*}}libatomic_load_exceptions.cpp:[[@LINE-11]]
35 // CHECK-SHADOW: Uninitialized value was stored to memory at
36 // CHECK-SHADOW: #0 {{0x[a-f0-9]+}} in copy{{.*}}libatomic_load_exceptions.cpp:[[@LINE-9]]