Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / compiler-rt / test / ubsan_minimal / TestCases / nullptr-and-nonzero-offset.c
blobbba9a38da0c73ad3177718fa7517fb2c00c5afb8
1 // RUN: %clang -fsanitize=pointer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="pointer-overflow"
2 // RUN: %clangxx -x c++ -fsanitize=pointer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --implicit-check-not="pointer-overflow"
4 #include <stdlib.h>
6 int main(int argc, char *argv[]) {
7 char *base, *result;
9 base = (char *)0;
10 result = base + 0;
11 // CHECK-NOT: pointer-overflow
13 base = (char *)0;
14 result = base + 1;
15 // CHECK: pointer-overflow by 0x{{[[:xdigit:]]+$}}
17 base = (char *)1;
18 result = base - 1;
19 // CHECK: pointer-overflow by 0x{{[[:xdigit:]]+$}}
21 return 0;