summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/Misc/print_summary.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ubsan/TestCases/Misc/print_summary.c')
-rw-r--r--test/ubsan/TestCases/Misc/print_summary.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/Misc/print_summary.c b/test/ubsan/TestCases/Misc/print_summary.c
new file mode 100644
index 000000000..b67a0614d
--- /dev/null
+++ b/test/ubsan/TestCases/Misc/print_summary.c
@@ -0,0 +1,11 @@
+// RUN: %clang -fsanitize=undefined %s -O3 -o %t
+// RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
+// RUN: %env_ubsan_opts=print_summary=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO_SUMMARY
+
+// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}
+// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}
+
+int main(int argc, char **argv) {
+ int arr[argc - 2];
+ return 0;
+}