summaryrefslogtreecommitdiffstats
path: root/compiler-rt/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
commitc539795bc35b2016a138fe9e56695a0901dfcf7d (patch)
treeac2c406a9dccfe514ed75427c7f734e6fdd6c093 /compiler-rt/test/ubsan_minimal
parent6f8fbf4b868394bac2b18403b39170b76586c00a (diff)
downloadbcm5719-llvm-c539795bc35b2016a138fe9e56695a0901dfcf7d.tar.gz
bcm5719-llvm-c539795bc35b2016a138fe9e56695a0901dfcf7d.zip
[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. llvm-svn: 313614
Diffstat (limited to 'compiler-rt/test/ubsan_minimal')
-rw-r--r--compiler-rt/test/ubsan_minimal/TestCases/recover-dedup.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/compiler-rt/test/ubsan_minimal/TestCases/recover-dedup.cpp b/compiler-rt/test/ubsan_minimal/TestCases/recover-dedup.cpp
index 744471c66a7..4dfd6991ef1 100644
--- a/compiler-rt/test/ubsan_minimal/TestCases/recover-dedup.cpp
+++ b/compiler-rt/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);
OpenPOWER on IntegriCloud