summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/uninit_func.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/uninit_func.adb')
-rw-r--r--gcc/testsuite/gnat.dg/uninit_func.adb13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/uninit_func.adb b/gcc/testsuite/gnat.dg/uninit_func.adb
new file mode 100644
index 00000000000..9c9ee341143
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/uninit_func.adb
@@ -0,0 +1,13 @@
+-- { dg-do compile }
+-- { dg-options "-O -Wall" }
+
+function uninit_func (A, B : Boolean) return Boolean is
+ C : Boolean; -- { dg-warning "may be used uninitialized" }
+begin
+ if A then
+ C := False;
+ elsif B then
+ C := True;
+ end if;
+ return C;
+end;