[ASan] port remaining output and feature tests to lit. TODO: we should in fact run most of the tests for 32/64 bits and for all optimization levels

llvm-svn: 161935
diff --git a/compiler-rt/lib/asan/lit_tests/stack-overflow.cc b/compiler-rt/lib/asan/lit_tests/stack-overflow.cc
new file mode 100644
index 0000000..2ff921b5
--- /dev/null
+++ b/compiler-rt/lib/asan/lit_tests/stack-overflow.cc
@@ -0,0 +1,13 @@
+// RUN: %clang_asan -m64 -O2 %s -o %t
+// RUN: %t 2>&1 | %symbolizer | FileCheck %s
+
+#include <string.h>
+int main(int argc, char **argv) {
+  char x[10];
+  memset(x, 0, 10);
+  int res = x[argc * 10];  // BOOOM
+  // CHECK: {{READ of size 1 at 0x.* thread T0}}
+  // CHECK: {{    #0 0x.* in main .*stack-overflow.cc:8}}
+  // CHECK: {{Address 0x.* is .* frame <main>}}
+  return res;
+}