diff options
author | Will Dietz <wdietz2@illinois.edu> | 2013-02-25 22:37:49 +0000 |
---|---|---|
committer | Will Dietz <wdietz2@illinois.edu> | 2013-02-25 22:37:49 +0000 |
commit | 11d0a9f27865e6bf46993aa42e9aec76416f41c7 (patch) | |
tree | 74562b48b8855da1ffd2ec207bf84fe655eb177f /clang/test/CodeGenCXX/catch-undef-behavior.cpp | |
parent | 0587597fb83b0cf2841e5972a262f5d8e2bb399d (diff) | |
download | bcm5719-llvm-11d0a9f27865e6bf46993aa42e9aec76416f41c7.tar.gz bcm5719-llvm-11d0a9f27865e6bf46993aa42e9aec76416f41c7.zip |
[ubsan] Emit single check for left shift.
Avoids warning twice on same shift.
llvm-svn: 176056
Diffstat (limited to 'clang/test/CodeGenCXX/catch-undef-behavior.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/catch-undef-behavior.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/catch-undef-behavior.cpp b/clang/test/CodeGenCXX/catch-undef-behavior.cpp index 31958a61e37..d6d0edfa1ed 100644 --- a/clang/test/CodeGenCXX/catch-undef-behavior.cpp +++ b/clang/test/CodeGenCXX/catch-undef-behavior.cpp @@ -130,7 +130,12 @@ int lsh_overflow(int a, int b) { // CHECK-NEXT: %[[SHIFTED_OUT_NOT_SIGN:.*]] = lshr i32 %[[SHIFTED_OUT]], 1 // CHECK-NEXT: %[[NO_OVERFLOW:.*]] = icmp eq i32 %[[SHIFTED_OUT_NOT_SIGN]], 0 - // CHECK-NEXT: br i1 %[[NO_OVERFLOW]] + + // CHECK: %[[VALID:.*]] = phi i1 [ %[[INBOUNDS]], {{.*}} ], [ %[[NO_OVERFLOW]], {{.*}} ] + // CHECK-NEXT: br i1 %[[VALID]] + + // CHECK: call void @__ubsan_handle_shift_out_of_bounds + // CHECK-NOT: call void @__ubsan_handle_shift_out_of_bounds // CHECK: %[[RET:.*]] = shl i32 %[[LHS]], %[[RHS]] // CHECK-NEXT: ret i32 %[[RET]] |