summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/new-operator-phi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/new-operator-phi.cpp')
-rw-r--r--test/CodeGenCXX/new-operator-phi.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/new-operator-phi.cpp b/test/CodeGenCXX/new-operator-phi.cpp
new file mode 100644
index 0000000000000..a5eed28ccf951
--- /dev/null
+++ b/test/CodeGenCXX/new-operator-phi.cpp
@@ -0,0 +1,11 @@
+// RUN: clang-cc -emit-llvm-only -verify %s
+// PR5454
+#include <stddef.h>
+
+class X {static void * operator new(size_t size) throw(); X(int); };
+int a(), b();
+void b(int x)
+{
+ new X(x ? a() : b());
+}
+