summaryrefslogtreecommitdiff
path: root/tests/diagnostics/unreachable-code.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/diagnostics/unreachable-code.slang')
-rw-r--r--tests/diagnostics/unreachable-code.slang12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/diagnostics/unreachable-code.slang b/tests/diagnostics/unreachable-code.slang
new file mode 100644
index 000000000..493ccc81f
--- /dev/null
+++ b/tests/diagnostics/unreachable-code.slang
@@ -0,0 +1,12 @@
+//TEST:SIMPLE:
+
+// "Obviously" unreachable code.
+
+int foo()
+{
+ return 1;
+
+ // The following statements can never be reached.
+ int x = 0;
+ return x;
+}