summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2010-01-21 15:20:48 +0000
committerMike Stump <mrs@apple.com>2010-01-21 15:20:48 +0000
commit04c6851cd6053c638e68bf1d7b99dda14ea267fb (patch)
tree2993f391bd3cc8b6fe8f2b782a3a9fdcdba35dd8 /clang/test
parentd2eba45be30aed16891c94553f86e8af5e800b78 (diff)
downloadbcm5719-llvm-04c6851cd6053c638e68bf1d7b99dda14ea267fb.tar.gz
bcm5719-llvm-04c6851cd6053c638e68bf1d7b99dda14ea267fb.zip
Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of destructor calls. Other consumers, such as static analysis, that would like to have more a more complete CFG can select the inclusion of those edges as CFG build time. This also fixes up the two compilation users of CFGs to be tolerant of having or not having those edges. All catch code is assumed be to live if we didn't generate the exceptional edges for CallExprs. llvm-svn: 94074
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/warn-unreachable.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-unreachable.cpp b/clang/test/SemaCXX/warn-unreachable.cpp
new file mode 100644
index 00000000000..13a82f4f183
--- /dev/null
+++ b/clang/test/SemaCXX/warn-unreachable.cpp
@@ -0,0 +1,35 @@
+// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wunreachable-code -Wno-unused-value
+
+int live();
+int dead();
+int liveti() throw(int);
+int (*livetip)() throw(int);
+
+int test1() {
+ try {
+ live();
+ } catch (int i) {
+ live();
+ }
+ return 1;
+}
+
+void test2() {
+ try {
+ live();
+ } catch (int i) {
+ live();
+ }
+ try {
+ liveti();
+ } catch (int i) {
+ live();
+ }
+ try {
+ livetip();
+ } catch (int i) {
+ live();
+ }
+ throw 1;
+ dead(); // expected-warning {{will never be executed}}
+}
OpenPOWER on IntegriCloud