Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / asan / TestCases / strcmp.c
blob417bd491ebe02ff28855877006bd0d3aed0facb1
1 // RUN: %clang_asan %s -o %t
2 // RUN: %env_asan_opts=intercept_strcmp=false %run %t 2>&1
3 // RUN: %env_asan_opts=intercept_strcmp=true not %run %t 2>&1 | FileCheck %s
4 // RUN: not %run %t 2>&1 | FileCheck %s
6 #include <assert.h>
7 #include <stdlib.h>
8 #include <string.h>
10 int main(int argc, char **argv) {
11 char s1[] = "abcd";
12 char s2[] = "1234";
13 assert(strcmp(s1, s2) > 0);
14 assert(strcmp(s1 - 1, s2));
16 // CHECK: {{.*ERROR: AddressSanitizer: stack-buffer-underflow on address}}
17 // CHECK: READ of size 1
18 return 0;