[compiler-rt] [compiler-rt][nsan] Add more tests for shadow memory (PR #100906)
Alexander Shaposhnikov via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 10:44:21 PDT 2024
================
@@ -0,0 +1,46 @@
+// RUN: %clangxx_nsan -O2 %s -o %t
+// RUN: %run %t 2>&1 | FileCheck %s
+
+// RUN: %clangxx_nsan -fno-builtin -O2 %s -o %t
+// RUN: %run %t 2>&1 | FileCheck %s
+
+// This verifies that shadow memory is tracked correcty across typed and
+// bitcasted swaps.
+
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <utility>
+
+extern "C" void __nsan_dump_shadow_mem(const char *addr, size_t size_bytes,
+ size_t bytes_per_line, size_t reserved);
+
+__attribute__((noinline)) void SwapFT(double *a, double *b) {
----------------
alexander-shaposhnikov wrote:
done
https://github.com/llvm/llvm-project/pull/100906
More information about the llvm-commits
mailing list