[compiler-rt] r285208 - [ubsan] Fix vptr.cpp test to be more resilient. NFC.

Robert Lougher via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 09:02:36 PDT 2016


Author: rlougher
Date: Wed Oct 26 11:02:36 2016
New Revision: 285208

URL: http://llvm.org/viewvc/llvm-project?rev=285208&view=rev
Log:
[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.


Modified:
    compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr.cpp

Modified: compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr.cpp?rev=285208&r1=285207&r2=285208&view=diff
==============================================================================
--- compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr.cpp (original)
+++ compiler-rt/trunk/test/ubsan/TestCases/TypeCheck/vptr.cpp Wed Oct 26 11:02:36 2016
@@ -1,4 +1,4 @@
-// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t
+// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t -mllvm -enable-tail-merge=false
 // RUN: %run %t rT && %run %t mT && %run %t fT && %run %t cT
 // RUN: %run %t rU && %run %t mU && %run %t fU && %run %t cU
 // RUN: %run %t rS && %run %t rV && %run %t oV




More information about the llvm-commits mailing list