summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-02-16 23:59:08 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-02-16 23:59:08 +0000
commit8d2226208d1717ddc34c63707d2ffcfc6f1d21b6 (patch)
treede27cedd72d7b180786ca6eebab0a8cb90500348 /clang/test
parent197fcd44188b6923a515ac8a9798501af165cd8f (diff)
downloadbcm5719-llvm-8d2226208d1717ddc34c63707d2ffcfc6f1d21b6.tar.gz
bcm5719-llvm-8d2226208d1717ddc34c63707d2ffcfc6f1d21b6.zip
Ensure that the NRVO flag has some block to insert into. Fixes PR9178!
llvm-svn: 125694
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/nrvo-noreturn.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/nrvo-noreturn.cc b/clang/test/CodeGenCXX/nrvo-noreturn.cc
new file mode 100644
index 00000000000..a8259cab5f3
--- /dev/null
+++ b/clang/test/CodeGenCXX/nrvo-noreturn.cc
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -emit-llvm-only %s
+// PR9178
+
+void abort() __attribute__((__noreturn__));
+struct CoinModelLink {
+ CoinModelLink();
+ ~CoinModelLink();
+};
+class CoinModel {
+ CoinModelLink firstInQuadraticColumn();
+};
+CoinModelLink CoinModel::firstInQuadraticColumn() {
+ abort();
+ CoinModelLink x;
+ return x;
+}
+
OpenPOWER on IntegriCloud