[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Lexer / has_feature_undefined_behavior_sanitizer.cpp
blob62e5316dde58eb2bcee1e1f05cd000eb7fe98bae
1 // RUN: %clang -E -fsanitize=undefined %s -o - | FileCheck --check-prefix=CHECK-UBSAN %s
2 // RUN: %clang -E -fsanitize=alignment %s -o - | FileCheck --check-prefix=CHECK-ALIGNMENT %s
3 // RUN: %clang -E %s -o - | FileCheck --check-prefix=CHECK-NO-UBSAN %s
5 #if __has_feature(undefined_behavior_sanitizer)
6 int UBSanEnabled();
7 #else
8 int UBSanDisabled();
9 #endif
11 // CHECK-UBSAN: UBSanEnabled
12 // CHECK-ALIGNMENT: UBSanEnabled
13 // CHECK-NO-UBSAN: UBSanDisabled