summaryrefslogtreecommitdiff
path: root/test/ubsan_minimal
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-09-19 06:46:36 +0000
committerVedant Kumar <vsk@apple.com>2017-09-19 06:46:36 +0000
commitc85c0b5fe40d3204e454b7452df80a524dda1823 (patch)
treed6884d86215e178fa83207a6df2507871520b019 /test/ubsan_minimal
parent7bd22ca122d1a8289eda6962827e9ed1c1786577 (diff)
[ubsan-minimal] Make the interface more compatible with RTUBSan
This eliminates a few inconsistencies between the symbol sets exported by RTUBSan and RTUBSan_minimal: * Handlers for nonnull_return were missing from the minimal RT, and are now added in. * The minimal runtime exported recoverable handlers for builtin_unreachable and missing_return. These are not supposed to exist, and are now removed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan_minimal')
-rw-r--r--test/ubsan_minimal/TestCases/recover-dedup.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/ubsan_minimal/TestCases/recover-dedup.cpp b/test/ubsan_minimal/TestCases/recover-dedup.cpp
index 744471c66..4dfd6991e 100644
--- a/test/ubsan_minimal/TestCases/recover-dedup.cpp
+++ b/test/ubsan_minimal/TestCases/recover-dedup.cpp
@@ -1,6 +1,18 @@
-// RUN: %clangxx -fsanitize=signed-integer-overflow -fsanitize-recover=all %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx -w -fsanitize=signed-integer-overflow,nullability-return,returns-nonnull-attribute -fsanitize-recover=all %s -o %t && %run %t 2>&1 | FileCheck %s
#include <stdint.h>
+#include <stdio.h>
+
+int *_Nonnull h() {
+ // CHECK: nullability-return
+ return NULL;
+}
+
+__attribute__((returns_nonnull))
+int *i() {
+ // CHECK: nonnull-return
+ return NULL;
+}
__attribute__((noinline))
int f(int x, int y) {
@@ -15,6 +27,8 @@ int g(int x, int y) {
}
int main() {
+ h();
+ i();
int x = 2;
for (int i = 0; i < 10; ++i)
x = f(x, x);