[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 10:42:43 PDT 2024


================
@@ -0,0 +1,35 @@
+// RUN: %clangxx -fsanitize=realtime %s -o %t
+// RUN: not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx %s -fsanitize=realtime -o - -S -emit-llvm | FileCheck %s --check-prefix=CHECK-ENABLED-IR
+// RUN: %clangxx %s -o - -S -emit-llvm | FileCheck %s --check-prefix=CHECK-DISABLED-IR
+// UNSUPPORTED: ios
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "sanitizer/rtsan_interface.h"
+
+void violation() [[clang::nonblocking]] {
+  void *ptr;
+  {
+    __rtsan::ScopedDisabler disabler{};
----------------
vitalybuka wrote:

what about tested case
```
__rtsan::ScopedDisabler disabler1{};
__rtsan::ScopedDisabler disabler2{};
```

I see it's implemented, maybe add a test case?

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


More information about the cfe-commits mailing list