summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-24 00:54:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-24 00:54:33 +0000
commit69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548 (patch)
tree99c23222a860523fcf5ca4ac986547cfd99f3782 /clang/test/CodeGen
parent6167ab281965d4ebbcff77c1f392050bcd1c5e79 (diff)
downloadbcm5719-llvm-69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548.tar.gz
bcm5719-llvm-69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548.zip
New -fcatch-undefined-behavior features:
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r--clang/test/CodeGen/catch-undef-behavior.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/CodeGen/catch-undef-behavior.c b/clang/test/CodeGen/catch-undef-behavior.c
index ee0b6586dd8..8c45fa50456 100644
--- a/clang/test/CodeGen/catch-undef-behavior.c
+++ b/clang/test/CodeGen/catch-undef-behavior.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck %s
// PR6805
// CHECK: @foo
@@ -11,7 +11,11 @@ void foo() {
// CHECK: @bar
int bar(int *a) {
- // CHECK: objectsize
- // CHECK: icmp uge
+ // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64
+ // CHECK-NEXT: icmp uge i64 %[[SIZE]], 4
+
+ // CHECK: %[[PTRINT:.*]] = ptrtoint
+ // CHECK-NEXT: %[[MISALIGN:.*]] = and i64 %[[PTRINT]], 3
+ // CHECK-NEXT: icmp eq i64 %[[MISALIGN]], 0
return *a;
}
OpenPOWER on IntegriCloud