aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c b/gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c
new file mode 100644
index 000000000..eb356c3ee
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/uninit-E.c
@@ -0,0 +1,9 @@
+/* Test we do warn about initializing variable with self when -Winit-self is supplied. */
+/* { dg-do compile } */
+/* { dg-options "-O -Wuninitialized -Winit-self" } */
+
+int f()
+{
+ int i = i; /* { dg-warning "i" "uninitialized variable warning" } */
+ return i;
+}