Skip to content
Commit 50f7eeec authored by Howard Hinnant's avatar Howard Hinnant
Browse files

Enclosed is a stress test for dynamic_cast. It stresses both libc++abi, and...

Enclosed is a stress test for dynamic_cast.  It stresses both libc++abi, and clang itself.  It creates a ridiculously large class hierarchy using variadic templates.  You can specify both the width and depth of the class hierarchy.  And you can specify whether the cast is to the actual run time type, or to an intermediate layer in the class.  About 1/3 of the time I compile this, it crashes the compiler.  There seems to be an uninitialized area of memory, and I'm probably blowing past an assumption on class hierarchy size within clang (and understandably so). I can get it work most of the time with a class hierarchy width of 20 and a depth of 7.  I'm making timings with both -O3 and -Os, using both cast to root and cast to intermediate, on both libc++abi, and gcc's dynamic_cast.  I've put the results in a comment/table at the bottom of the test.

llvm-svn: 148083
parent da4fda73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment