diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-11 22:03:54 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-11-11 22:03:54 +0000 |
commit | 07f5b04be7e51fa08d0c263728d069572b497b97 (patch) | |
tree | 1a1659ab55255f9b7783592889975e7fcf65776a /test/CodeGenCXX/catch-undef-behavior.cpp | |
parent | 41d917703018e3e316eab5155e12722c153fb705 (diff) |
Bundle conditions checked by UBSan with sanitizer kinds they implement.
Summary:
This change makes CodeGenFunction::EmitCheck() take several
conditions that needs to be checked (all of them need to be true),
together with sanitizer kinds these checks are for. This would allow
to split one call into UBSan runtime into several calls in case
different sanitizer kinds would have different recoverability
settings.
Tests should be fixed accordingly, I'm working on it.
Test Plan: regression test suite.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6219
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/catch-undef-behavior.cpp')
-rw-r--r-- | test/CodeGenCXX/catch-undef-behavior.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/CodeGenCXX/catch-undef-behavior.cpp b/test/CodeGenCXX/catch-undef-behavior.cpp index 5bf31c1ca4..aa654381b2 100644 --- a/test/CodeGenCXX/catch-undef-behavior.cpp +++ b/test/CodeGenCXX/catch-undef-behavior.cpp @@ -221,11 +221,14 @@ void bad_downcast_pointer(S *p) { void bad_downcast_reference(S &p) { // CHECK: %[[E1:.*]] = icmp ne {{.*}}, null // CHECK-NOT: br i1 + // CHECK: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8( // CHECK: %[[E2:.*]] = icmp uge i64 %[[SIZE]], 24 - // CHECK: %[[E12:.*]] = and i1 %[[E1]], %[[E2]] + // CHECK: %[[MISALIGN:.*]] = and i64 %{{.*}}, 7 // CHECK: %[[E3:.*]] = icmp eq i64 %[[MISALIGN]], 0 + + // CHECK: %[[E12:.*]] = and i1 %[[E1]], %[[E2]] // CHECK: %[[E123:.*]] = and i1 %[[E12]], %[[E3]] // CHECK: br i1 %[[E123]], @@ -382,7 +385,7 @@ void downcast_reference(B &b) { // CHECK-NEXT: [[MASKED:%[0-9]*]] = and i64 [[C_INT]], 15 // CHECK-NEXT: [[TEST:%[0-9]*]] = icmp eq i64 [[MASKED]], 0 // AND the alignment test with the objectsize test. - // CHECK-NEXT: [[AND:%[0-9]*]] = and i1 {{.*}}, [[TEST]] + // CHECK: [[AND:%[0-9]*]] = and i1 {{.*}}, [[TEST]] // CHECK-NEXT: br i1 [[AND]] } |