Skip to content

Commit

Permalink
[clang][rtsan] Add realtime_sanitizer to Features.def (#106650)
Browse files Browse the repository at this point in the history
Allows us to introduce the scoped disabler in #106736
  • Loading branch information
cjappl authored Sep 6, 2024
1 parent a657779 commit fb14941
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/include/clang/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ FEATURE(memtag_globals,
FEATURE(xray_instrument, LangOpts.XRayInstrument)
FEATURE(undefined_behavior_sanitizer,
LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined))
FEATURE(realtime_sanitizer,
LangOpts.Sanitize.has(SanitizerKind::Realtime))
FEATURE(coverage_sanitizer, LangOpts.SanitizeCoverage)
FEATURE(assume_nonnull, true)
FEATURE(attribute_analyzer_noreturn, true)
Expand Down
12 changes: 12 additions & 0 deletions clang/test/Lexer/has_feature_realtime_sanitizer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %clang_cc1 -E -fsanitize=realtime %s -o - | FileCheck --check-prefix=CHECK-RTSAN %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-RTSAN %s

#if __has_feature(realtime_sanitizer)
int RealtimeSanitizerEnabled();
#else
int RealtimeSanitizerDisabled();
#endif

// CHECK-RTSAN: RealtimeSanitizerEnabled

// CHECK-NO-RTSAN: RealtimeSanitizerDisabled

0 comments on commit fb14941

Please sign in to comment.