[OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP programs.

Summary:
Some OpenMP clauses rely on the values of the variables. If the variable
is not initialized and used in OpenMP clauses that depend on the
variables values, it should be reported that the uninitialized variable
is used in the OpenMP clause expression.
This patch adds initial processing for uninitialized variables in OpenMP
constructs. Currently, it checks for use of the uninitialized variables
in the structured blocks.

Reviewers: NoQ, Szelethus, dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet

Subscribers: rnkovacs, guansong, jfb, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64356

llvm-svn: 365786
diff --git a/clang/test/OpenMP/target_depend_messages.cpp b/clang/test/OpenMP/target_depend_messages.cpp
index a7ac176..a18bc5d 100644
--- a/clang/test/OpenMP/target_depend_messages.cpp
+++ b/clang/test/OpenMP/target_depend_messages.cpp
@@ -2,6 +2,12 @@
 
 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
 
+void xxx(int argc) {
+  int x; // expected-note {{initialize the variable 'x' to silence this warning}}
+#pragma omp target depend(in : argc)
+  argc = x; // expected-warning {{variable 'x' is uninitialized when used here}}
+}
+
 void foo() {
 }