aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Windows/iostream_sbo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/Windows/iostream_sbo.cc')
-rw-r--r--test/asan/TestCases/Windows/iostream_sbo.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/asan/TestCases/Windows/iostream_sbo.cc b/test/asan/TestCases/Windows/iostream_sbo.cc
new file mode 100644
index 000000000000..ffcd53013ec6
--- /dev/null
+++ b/test/asan/TestCases/Windows/iostream_sbo.cc
@@ -0,0 +1,18 @@
+// First, check this works with the default blacklist:
+// RUN: %clang_cl_asan -O0 %s -Fe%t
+// RUN: echo "42" | %run %t 2>&1 | FileCheck %s
+//
+// Then, make sure it still works when a user uses his own blacklist file:
+// RUN: %clang_cl_asan -O0 %s -fsanitize-blacklist=%p/../Helpers/initialization-blacklist.txt -Fe%t2
+// RUN: echo "42" | %run %t2 2>&1 | FileCheck %s
+
+#include <iostream>
+
+int main() {
+ int i;
+ std::cout << "Type i: ";
+ std::cin >> i;
+ return 0;
+// CHECK: Type i:
+// CHECK-NOT: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
+}