[compiler-rt] [compiler-rt][rtsan] Introduce first end to end RTsan lit tests, enable instrumented unit tests (PR #105732)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 19:32:23 PDT 2024


================
@@ -0,0 +1,17 @@
+// RUN: %clangxx -fsanitize=realtime %s -o %t
+// RUN: not %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: ios
+
+// Intent: Ensure that an intercepted call in a [[clang::nonblocking]] function
+//         is flagged as an error. Basic smoke test.
+
+#include <stdlib.h>
+
+void violation() [[clang::nonblocking]] { void *Ptr = malloc(2); }
----------------
MaskRay wrote:

perhaps print it or store this to a global variable to ensure that optimizers don't optimize this out.

`ptr`

https://github.com/llvm/llvm-project/pull/105732


More information about the llvm-commits mailing list