diff --git a/clang/test/CodeGenCXX/RelativeVTablesABI/dynamic-cast.cpp b/clang/test/CodeGenCXX/RelativeVTablesABI/dynamic-cast.cpp --- a/clang/test/CodeGenCXX/RelativeVTablesABI/dynamic-cast.cpp +++ b/clang/test/CodeGenCXX/RelativeVTablesABI/dynamic-cast.cpp @@ -35,13 +35,13 @@ // CHECK-NEXT: [[isnull:%[0-9]+]] = icmp eq %class.B* %b, null // CHECK-NEXT: br i1 [[isnull]], label %[[dynamic_cast_end:[a-z0-9._]+]], label %[[dynamic_cast_notnull:[a-z0-9._]+]] // CHECK: [[dynamic_cast_notnull]]: -// CHECK-NEXT: [[b2:%[0-9]+]] = bitcast %class.B* %b to i32** -// CHECK-NEXT: [[vtable:%[a-z0-9]+]] = load i32*, i32** [[b2]], align 8 -// CHECK-NEXT: [[offset_ptr:%.+]] = getelementptr inbounds i32, i32* [[vtable]], i64 -2 -// CHECK-NEXT: [[offset_to_top:%.+]] = load i32, i32* [[offset_ptr]], align 4 -// CHECK-NEXT: [[b:%[0-9]+]] = bitcast %class.B* %b to i8* -// CHECK-NEXT: [[offset_to_top2:%.+]] = sext i32 [[offset_to_top]] to i64 -// CHECK-NEXT: [[casted:%.+]] = getelementptr inbounds i8, i8* [[b]], i64 [[offset_to_top2]] +// CHECK-DAG: [[b2:%[0-9]+]] = bitcast %class.B* %b to i32** +// CHECK-DAG: [[vtable:%[a-z0-9]+]] = load i32*, i32** [[b2]], align 8 +// CHECK-DAG: [[offset_ptr:%.+]] = getelementptr inbounds i32, i32* [[vtable]], i64 -2 +// CHECK-DAG: [[offset_to_top:%.+]] = load i32, i32* [[offset_ptr]], align 4 +// CHECK-DAG: [[b:%[0-9]+]] = bitcast %class.B* %b to i8* +// CHECK-DAG: [[offset_to_top2:%.+]] = sext i32 [[offset_to_top]] to i64 +// CHECK-DAG: [[casted:%.+]] = getelementptr inbounds i8, i8* [[b]], i64 [[offset_to_top2]] // CHECK-NEXT: br label %[[dynamic_cast_end]] // CHECK: [[dynamic_cast_end]]: // CHECK-NEXT: [[res:%[0-9]+]] = phi i8* [ [[casted]], %[[dynamic_cast_notnull]] ], [ null, %entry ]