summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/catch-undef-behavior.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/catch-undef-behavior.cpp')
-rw-r--r--clang/test/CodeGenCXX/catch-undef-behavior.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/clang/test/CodeGenCXX/catch-undef-behavior.cpp b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
index 6fd7d16f8636..0c14c97dacca 100644
--- a/clang/test/CodeGenCXX/catch-undef-behavior.cpp
+++ b/clang/test/CodeGenCXX/catch-undef-behavior.cpp
@@ -56,8 +56,8 @@ void member_access(S *p) {
// (1b) Check that 'p' actually points to an 'S'.
- // CHECK: %[[VPTR:.*]] = load i64, ptr
- //
+ // CHECK: %[[VTABLE:.*]] = load ptr, ptr %0
+ // CHECK: %[[VPTR:.*]] = ptrtoint ptr %[[VTABLE]] to i64
// hash_16_bytes:
//
// If this number changes, it indicates that either the mangled name of ::S
@@ -67,15 +67,10 @@ void member_access(S *p) {
// The two hash values are for 64- and 32-bit Clang binaries, respectively.
// FIXME: We should produce a 64-bit value either way.
//
- // CHECK-NEXT: xor i64 {{-4030275160588942838|1107558922}}, %[[VPTR]]
- // CHECK-NEXT: mul i64 {{.*}}, -7070675565921424023
- // CHECK-NEXT: lshr i64 {{.*}}, 47
- // CHECK-NEXT: xor i64
- // CHECK-NEXT: xor i64 %[[VPTR]]
- // CHECK-NEXT: mul i64 {{.*}}, -7070675565921424023
- // CHECK-NEXT: lshr i64 {{.*}}, 47
- // CHECK-NEXT: xor i64
- // CHECK-NEXT: %[[HASH:.*]] = mul i64 {{.*}}, -7070675565921424023
+ // CHECK-NEXT: mul i64 %[[VPTR]], -4658895280553007687, !nosanitize
+ // CHECK-NEXT: lshr i64 {{.*}}, 31
+ // CHECK-NEXT: xor i64 %[[#]], %[[#]]
+ // CHECK-NEXT: %[[HASH:.*]] = xor i64 4589795628539611399, %[[#]], !nosanitize
//
// Check the hash against the table:
//
@@ -115,8 +110,9 @@ void member_access(S *p) {
// (3b) Check that 'p' actually points to an 'S'
- // CHECK: load i64, ptr
- // CHECK-NEXT: xor i64 {{-4030275160588942838|1107558922}},
+ // CHECK: [[VTABLE2:%.*]] = load ptr, ptr
+ // CHECK: ptrtoint ptr [[VTABLE2]] to i64
+ // CHECK-NEXT: mul i64 %[[#]], -4658895280553007687, !nosanitize
// [...]
// CHECK: getelementptr inbounds [128 x i64], ptr @__ubsan_vptr_type_cache, i32 0, i64 %
// CHECK: br i1