summaryrefslogtreecommitdiffstats
path: root/tests/preprocessor
diff options
context:
space:
mode:
Diffstat (limited to 'tests/preprocessor')
-rw-r--r--tests/preprocessor/elif-eval.slang9
-rw-r--r--tests/preprocessor/elif-eval.slang.expected8
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/preprocessor/elif-eval.slang b/tests/preprocessor/elif-eval.slang
new file mode 100644
index 000000000..912f70fd2
--- /dev/null
+++ b/tests/preprocessor/elif-eval.slang
@@ -0,0 +1,9 @@
+//TEST:SIMPLE:
+
+#ifndef SOME_MACRO
+# error Not this one!
+// The expression after #elif shouldn't be evaluated, because #ifndef evaluated as true
+#elif SOME_OTHER_MACRO
+#else
+#error This isn't valid!
+#endif
diff --git a/tests/preprocessor/elif-eval.slang.expected b/tests/preprocessor/elif-eval.slang.expected
new file mode 100644
index 000000000..04387be1c
--- /dev/null
+++ b/tests/preprocessor/elif-eval.slang.expected
@@ -0,0 +1,8 @@
+result code = -1
+standard error = {
+tests/preprocessor/elif-eval.slang(4): error 15900: #error: Not this one!
+# error Not this one!
+ ^~~~~
+}
+standard output = {
+}