Skip to content

Commit fb14941

Browse files
authored
[clang][rtsan] Add realtime_sanitizer to Features.def (#106650)
Allows us to introduce the scoped disabler in #106736
1 parent a657779 commit fb14941

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang/include/clang/Basic/Features.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ FEATURE(memtag_globals,
5454
FEATURE(xray_instrument, LangOpts.XRayInstrument)
5555
FEATURE(undefined_behavior_sanitizer,
5656
LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined))
57+
FEATURE(realtime_sanitizer,
58+
LangOpts.Sanitize.has(SanitizerKind::Realtime))
5759
FEATURE(coverage_sanitizer, LangOpts.SanitizeCoverage)
5860
FEATURE(assume_nonnull, true)
5961
FEATURE(attribute_analyzer_noreturn, true)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %clang_cc1 -E -fsanitize=realtime %s -o - | FileCheck --check-prefix=CHECK-RTSAN %s
2+
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-RTSAN %s
3+
4+
#if __has_feature(realtime_sanitizer)
5+
int RealtimeSanitizerEnabled();
6+
#else
7+
int RealtimeSanitizerDisabled();
8+
#endif
9+
10+
// CHECK-RTSAN: RealtimeSanitizerEnabled
11+
12+
// CHECK-NO-RTSAN: RealtimeSanitizerDisabled

0 commit comments

Comments
 (0)