Skip to content

Commit 8e075fd

Browse files
author
Robert Lougher
committed
[ubsan] Fix vptr.cpp test to be more resilient. NFC.
The test contains a switch statement in which two of the cases are tail-merged, with the call to __ubsan_handle_dynamic_type_cache_miss_abort in the common tail. When tail-merging occurs, the debug location of the tail is randomly taken from one of the merge inputs. Luckily for the test, the expected line number in the check is the one which is chosen by the tail-merge. However, if the switch cases are re-ordered the test will fail. This patch disables tail-merge, making the test resilient to changes in tail-merge, and unblocking review D25742. It does not change the semantics of the test. llvm-svn: 285208
1 parent e713000 commit 8e075fd

File tree

1 file changed

+1
-1
lines changed
  • compiler-rt/test/ubsan/TestCases/TypeCheck

1 file changed

+1
-1
lines changed

compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t
1+
// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t -mllvm -enable-tail-merge=false
22
// RUN: %run %t rT && %run %t mT && %run %t fT && %run %t cT
33
// RUN: %run %t rU && %run %t mU && %run %t fU && %run %t cU
44
// RUN: %run %t rS && %run %t rV && %run %t oV

0 commit comments

Comments
 (0)