summaryrefslogtreecommitdiffstats
path: root/test/CodeGen
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-06-16 03:27:36 +0000
committerVedant Kumar <vsk@apple.com>2017-06-16 03:27:36 +0000
commitff94b5e7fe537029dd2a96c48198b1bcb27b0958 (patch)
tree278a9dec9420d6619eee64a279ddcbbc77eaa2e6 /test/CodeGen
parentd9557ee91ddf70e12584f190efb1f1a647f228b7 (diff)
[ubsan] PR33081: Skip the standard type checks for volatile
Skip checks for null dereference, alignment violation, object size violation, and dynamic type violation if the pointer points to volatile data. Differential Revision: https://reviews.llvm.org/D34262 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/ubsan-volatile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/ubsan-volatile.c b/test/CodeGen/ubsan-volatile.c
new file mode 100644
index 0000000000..ce54aada81
--- /dev/null
+++ b/test/CodeGen/ubsan-volatile.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsanitize=null,alignment,object-size,vptr -S -emit-llvm %s -o - | FileCheck %s
+
+// CHECK: @volatile_null_deref
+void volatile_null_deref(volatile int *p) {
+ // CHECK-NOT: call{{.*}}ubsan
+ *p;
+}