annotate compiler-rt/test/msan/unaligned_read_origin.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents c4bab56944e8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
anatofuz
parents:
diff changeset
2 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
anatofuz
parents:
diff changeset
3 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1
anatofuz
parents:
diff changeset
4 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 #include <sanitizer/msan_interface.h>
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 int main(int argc, char **argv) {
anatofuz
parents:
diff changeset
9 int x;
anatofuz
parents:
diff changeset
10 int *volatile p = &x;
anatofuz
parents:
diff changeset
11 return __sanitizer_unaligned_load32(p);
anatofuz
parents:
diff changeset
12 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
anatofuz
parents:
diff changeset
13 // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cpp:}}[[@LINE-2]]
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
14 // CHECK: Uninitialized value was created by an allocation of 'x' in the stack frame
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
15 // CHECK: {{#0 0x.* in main .*unaligned_read_origin.cpp:}}[[@LINE-6]]
150
anatofuz
parents:
diff changeset
16 }