summaryrefslogtreecommitdiffstats
path: root/clang/test/AST/Interp/cond.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/Interp/cond.cpp')
-rw-r--r--clang/test/AST/Interp/cond.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/AST/Interp/cond.cpp b/clang/test/AST/Interp/cond.cpp
new file mode 100644
index 00000000000..8a5a318c216
--- /dev/null
+++ b/clang/test/AST/Interp/cond.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only -fforce-experimental-new-constant-interpreter %s -verify
+// RUN: %clang_cc1 -std=c++17 -fsyntax-only %s -verify
+// expected-no-diagnostics
+
+constexpr int cond_then_else(int a, int b) {
+ if (a < b) {
+ return b - a;
+ } else {
+ return a - b;
+ }
+}
OpenPOWER on IntegriCloud