-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
struct St{
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int foo() {
L1:
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int foo() {
L1:
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel
{
#pragma omp cancel parallel if // expected-error {{expected '(' after 'if'}}
#pragma omp cancel parallel if () // expected-error {{expected expression}}
#pragma omp cancel parallel if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp cancel parallel if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp cancel' are ignored}}
- #pragma omp cancel parallel if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp cancel parallel if (argc > 0 ? argv[1] : argv[2] + z)
#pragma omp cancel parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp cancel' cannot contain more than one 'if' clause}}
#pragma omp cancel parallel if (S) // expected-error {{'S' does not refer to a value}}
#pragma omp cancel parallel if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
}
int main(int argc, char **argv) {
+int z;
#pragma omp parallel
{
#pragma omp cancel parallel if // expected-error {{expected '(' after 'if'}}
#pragma omp cancel parallel if () // expected-error {{expected expression}}
#pragma omp cancel parallel if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp cancel parallel if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp cancel' are ignored}}
- #pragma omp cancel parallel if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp cancel parallel if (argc > 0 ? argv[1] : argv[2] - z)
#pragma omp cancel parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp cancel' cannot contain more than one 'if' clause}}
#pragma omp cancel parallel if (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp cancel parallel if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int main(int argc, char **argv) {
#pragma omp cancellation // expected-error {{expected an OpenMP directive}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
int foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int temp; // expected-note 6 {{'temp' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 %s -Wuninitialized
int temp; // expected-note 7 {{'temp' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
- #pragma omp distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute' cannot contain more than one 'dist_schedule' clause}}
+ #pragma omp distribute dist_schedule (static), dist_schedule (static, 1 + z) // expected-error {{directive '#pragma omp distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 0; i < 10; ++i) foo();
}
int main(int argc, char **argv) {
+int z;
#pragma omp distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
- #pragma omp distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute' cannot contain more than one 'dist_schedule' clause}}
+ #pragma omp distribute dist_schedule (static), dist_schedule (static, 1 -z ) // expected-error {{directive '#pragma omp distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp distribute dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 0; i < 10; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
extern S1 a;
class S2 {
mutable int a;
-
+
public:
S2() : a(0) {}
S2(const S2 &s2) : a(s2.a) {}
class S3 {
int a;
S3 &operator=(const S3 &s3);
-
+
public:
S3() : a(0) {} // expected-note {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
S3(S3 &s3) : a(s3.a) {} // expected-note {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp distribute firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i) foo();
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
- #pragma omp distribute firstprivate(da)
+ #pragma omp distribute firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <class T, int N>
T tmain(T argc) {
- T b = argc, c, d, e, f, g;
+ T b = argc, c, d, e, f, g, z;
char ** argv;
static T a;
-// CHECK: static T a;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute parallel for dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute parallel for dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp target
#pragma omp teams
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+#pragma omp distribute parallel for firstprivate(k, h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, k;
int &j = i;
#pragma omp target
#pragma omp teams
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}}
+#pragma omp distribute parallel for firstprivate(k, h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for if(argc)
+#pragma omp distribute parallel for if(argc+z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for if(parallel : argc)
+#pragma omp distribute parallel for if(parallel : argc-z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for num_threads (argc)
+#pragma omp distribute parallel for num_threads (argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}}
+#pragma omp distribute parallel for num_threads (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+#pragma omp distribute parallel for reduction(+ : ba, z) // expected-error {{const-qualified variable cannot be reduction}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp parallel private(fl)
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for reduction(+ : fl)
+#pragma omp distribute parallel for reduction(+ : fl, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel reduction(* : fl)
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for schedule (guided, (ST > 0) ? 1 + ST : 2)
+#pragma omp distribute parallel for schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+4 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'schedule' clause}}
// expected-error@+3 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+#pragma omp distribute parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2 - z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 2 {{directive '#pragma omp distribute parallel for' cannot contain more than one 'schedule' clause}}
// expected-error@+3 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
struct S1; // expected-note 2 {{declared here}}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd copyin // expected-error {{expected '(' after 'copyin'}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T k;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute parallel for simd dist_schedule (static), dist_schedule (static, k) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
+ int k;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute parallel for simd dist_schedule (static), dist_schedule (static, k) // expected-error {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd firstprivate(argc)
+#pragma omp distribute parallel for simd firstprivate(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd firstprivate(ba) // OK
+#pragma omp distribute parallel for simd firstprivate(ba, z) // OK
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, k;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
+#pragma omp distribute parallel for simd if (k)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
- int i;
+ int i, k;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
+#pragma omp distribute parallel for simd if (k)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd lastprivate(argc)
+#pragma omp distribute parallel for simd lastprivate(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd lastprivate(ba)
+#pragma omp distribute parallel for simd lastprivate(ba, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute parallel for simd'}}
#pragma omp distribute parallel for simd
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
+#pragma omp distribute parallel for simd num_threads (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
+#pragma omp distribute parallel for simd num_threads (z/argc)) // expected-warning {{extra tokens at the end of '#pragma omp distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd reduction(&& : argc)
+#pragma omp distribute parallel for simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
+#pragma omp distribute parallel for simd reduction(+ : z, o) // expected-error {{no viable overloaded '='}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd schedule (guided, (ST > 0) ? 1 + ST : 2)
+#pragma omp distribute parallel for simd schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+4 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+3 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+#pragma omp distribute parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2 -z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+4 2 {{directive '#pragma omp distribute parallel for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+3 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
struct S1; // expected-note 2 {{declared here}}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
int acc = 0;
int n = 1000;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared (argc)
+#pragma omp distribute parallel for simd shared (argc, z)
for(int k = 0 ; k < n ; k++) {
acc++;
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
int acc = 0;
int n = argc;
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd shared (argc)
+#pragma omp distribute parallel for simd shared (argc, z)
for(int k = 0 ; k < n ; k++) {
acc++;
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
public:
S4(int v):a(v) { }
};
-class S5 {
+class S5 {
int a;
S5():a(0) {} // expected-note {{implicitly declared private here}}
public:
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target
#pragma omp teams
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute simd dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
#pragma omp teams
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp distribute simd dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
+#pragma omp distribute simd firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-warning {{Non-trivial type 'const S2' is mapped, only trivial types are guaranteed to be mapped correctly}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd firstprivate(argc)
+#pragma omp distribute simd firstprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams
++k;
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd lastprivate(argc)
+#pragma omp distribute simd lastprivate(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
static int sii;
// expected-note@+1 {{defined as threadprivate or thread local}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp distribute simd'}}
#pragma omp distribute simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
T i;
+ long z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
+#pragma omp distribute simd reduction(^ : z, T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute simd reduction(&& : argc)
+#pragma omp distribute simd reduction(&& : z, argc)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
struct S1 { // expected-note 2 {{declared here}}
int a;
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
- #pragma omp for collapse (argc
+ #pragma omp for collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp for collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel
#pragma omp for firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp for firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
+#pragma omp for firstprivate(a, b, c, d, f, k) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{no matching constructor for initialization of 'S3'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel
#pragma omp for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp for lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+#pragma omp for lastprivate(k, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel
#pragma omp for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp for lastprivate(argc)
+#pragma omp for lastprivate(argc, k)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
template<class I, class C> int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for linear (argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp for linear(e, g)
+ #pragma omp for linear(e, g, k)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k) ++k;
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, k;
int &j = i;
#pragma omp for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
// expected-error@+2 {{linear variable with incomplete type 'S1'}}
// expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
- #pragma omp for linear(a, b)
+ #pragma omp for linear(a, b, k)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for linear (argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp for'}}
#pragma omp for
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-#pragma omp for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp for reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-#pragma omp for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+#pragma omp for reduction(min : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-#pragma omp for reduction(max : argv[1])
+#pragma omp for reduction(max : argv[1], z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp for schedule (dynamic, 1)) // expected-warning {{extra tokens at the end of '#pragma omp for' are ignored}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp for schedule (guided, (ST > 0) ? 1 + ST : 2)
+ #pragma omp for schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+2 2 {{directive '#pragma omp for' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for schedule (guided, 4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp for schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for' are ignored}}
+ #pragma omp for schedule (static, 2+2-z)) // expected-warning {{extra tokens at the end of '#pragma omp for' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for schedule (dynamic, foobool(1) > 0 ? 1 : 2)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp for simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp for simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp for simd lastprivate(argc)
+#pragma omp for simd lastprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
#pragma omp parallel
{
int v = 0;
+ long z;
int i;
- #pragma omp for simd linear(v:i)
+ #pragma omp for simd linear(z, v:i)
for (int k = 0; k < argc; ++k) { i = k; v += i; }
}
#pragma omp for simd linear(j)
for (int k = 0; k < argc; ++k) ++k;
// expected-error@+2 {{linear variable with incomplete type 'S1'}}
// expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
- #pragma omp for simd linear (a, b)
+ #pragma omp for simd linear(a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for simd linear (argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel
{
int i;
- #pragma omp for simd linear(i)
+ #pragma omp for simd linear(i : i)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp for simd linear(i : 4)
for (int k = 0; k < argc; ++k) { ++k; i += 4; }
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp for simd'}}
#pragma omp for simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-#pragma omp for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp for simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-#pragma omp for simd reduction(&& : argc)
+#pragma omp for simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp for simd schedule (dynamic, 1)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp for simd schedule (guided, (ST > 0) ? 1 + ST : 2)
+ #pragma omp for simd schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp for simd schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+ #pragma omp for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2 - z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+2 2 {{directive '#pragma omp for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
int foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
int foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-simd -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=50 -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=40 -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-version=31 -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-version=30 -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=50 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=40 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-version=31 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-version=30 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
static int m;
#pragma omp parallel firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp parallel firstprivate (argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
#pragma omp parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp parallel firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
- #pragma omp parallel firstprivate (d)
+ #pragma omp parallel firstprivate (z, d)
d = 5; // expected-error {{cannot assign to variable 'd' with const-qualified type}}
#pragma omp parallel firstprivate (argv[1]) // expected-error {{expected variable name}}
#pragma omp parallel firstprivate(ba)
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp parallel for firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for firstprivate(argv[1]) // expected-error {{expected variable name}}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for if(argc)
+ #pragma omp parallel for if(argc/z)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i,z;
#pragma omp parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for if(parallel : argc)
+ #pragma omp parallel for if(parallel : z*argc)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp parallel for'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp parallel for lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for lastprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp parallel for lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for lastprivate(argc)
+#pragma omp parallel for lastprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel for lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for linear(argc : 5)
+#pragma omp parallel for linear(argc, z : 5)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for linear(S1) // expected-error {{'S1' does not refer to a value}}
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for linear(argc)
+#pragma omp parallel for linear(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for linear(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for'}}
#pragma omp parallel for
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for num_threads (argc)
+ #pragma omp parallel for num_threads (argc+z)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
+ #pragma omp parallel for num_threads (z-argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp parallel for reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp parallel for reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+#pragma omp parallel for reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp parallel for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp parallel for schedule (dynamic, 1)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp parallel for schedule (guided, (ST > 0) ? 1 + ST : 2)
+ #pragma omp parallel for schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+ #pragma omp parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2 - z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+2 2 {{directive '#pragma omp parallel for' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for simd firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for simd firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
+#pragma omp parallel for simd firstprivate(h, z) // expected-error {{threadprivate or thread local variable cannot be firstprivate}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for simd linear(i)
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp parallel for simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for simd firstprivate(argc)
+#pragma omp parallel for simd firstprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for simd if(argc)
+ #pragma omp parallel for simd if(argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for simd if(parallel : argc)
+ #pragma omp parallel for simd if(parallel : argc / z)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for simd lastprivate(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+#pragma omp parallel for simd lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp parallel for simd lastprivate(2 * 2) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for simd lastprivate(ba)
+#pragma omp parallel for simd lastprivate(ba, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel for simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
template<class I, class C> int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp parallel for simd linear(i)
+ #pragma omp parallel for simd linear(i, z)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel
{
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp parallel for simd linear (argc)
+ #pragma omp parallel for simd linear (argc, z)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
// expected-error@+2 {{linear variable with incomplete type 'S1'}}
// expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
- #pragma omp parallel for simd linear (a, b)
+ #pragma omp parallel for simd linear (a, b)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp parallel for simd linear (argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp parallel for simd'}}
#pragma omp parallel for simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for simd num_threads (argc)
+ #pragma omp parallel for simd num_threads (argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
+ #pragma omp parallel for simd num_threads (argc * z)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp parallel for simd num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for simd private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+#pragma omp parallel for simd private(z, a, b) // expected-error {{private variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for simd private(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0);
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel for simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp parallel for simd private(argc)
+#pragma omp parallel for simd private(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp parallel for simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp parallel for simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp parallel for simd reduction(&& : argc)
+#pragma omp parallel for simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp parallel for simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T k;
#pragma omp parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp parallel for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
// expected-error@+1 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
#pragma omp parallel for simd schedule (guided, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp parallel for simd schedule (dynamic, 1)
+ #pragma omp parallel for simd schedule (dynamic, k)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp parallel for simd schedule (static, N) // expected-error {{argument to 'schedule' clause must be a strictly positive integer value}}
for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
}
int main(int argc, char **argv) {
+ int k;
#pragma omp parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for simd schedule (runtime, 3) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp parallel for simd schedule (guided, 4 // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp parallel for simd schedule (guided, k // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp parallel for simd schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel if // expected-error {{expected '(' after 'if'}}
#pragma omp parallel if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel if () // expected-error {{expected expression}}
#pragma omp parallel if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
- #pragma omp parallel if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp parallel if (argc > 0 ? argv[1] : argv[2] + z)
#pragma omp parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'if' clause}}
#pragma omp parallel if (S) // expected-error {{'S' does not refer to a value}}
#pragma omp parallel if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
}
int main(int argc, char **argv) {
+int z;
#pragma omp parallel if // expected-error {{expected '(' after 'if'}}
#pragma omp parallel if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel if () // expected-error {{expected expression}}
#pragma omp parallel if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp parallel if(parallel : argc)
+ #pragma omp parallel if(parallel : argc>> z)
#pragma omp parallel if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp parallel'}}
#pragma omp parallel if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'if' clause with 'parallel' name modifier}}
#pragma omp parallel if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel num_threads // expected-error {{expected '(' after 'num_threads'}}
#pragma omp parallel num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel num_threads () // expected-error {{expected expression}}
#pragma omp parallel num_threads (foobool(argc)), num_threads (true), num_threads (-5) // expected-error 2 {{directive '#pragma omp parallel' cannot contain more than one 'num_threads' clause}} expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
#pragma omp parallel num_threads (S) // expected-error {{'S' does not refer to a value}}
#pragma omp parallel num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
- #pragma omp parallel num_threads (argc)
+ #pragma omp parallel num_threads (argc+z)
#pragma omp parallel num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
#pragma omp parallel redef_num_threads (argc, argc)
foo();
}
int main(int argc, char **argv) {
+int z;
#pragma omp parallel num_threads // expected-error {{expected '(' after 'num_threads'}}
#pragma omp parallel num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel num_threads () // expected-error {{expected expression}}
#pragma omp parallel num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp parallel num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
+ #pragma omp parallel num_threads (z+argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
#pragma omp parallel num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
#pragma omp parallel num_threads (foobool(argc)), num_threads (true), num_threads (-5) // expected-error 2 {{directive '#pragma omp parallel' cannot contain more than one 'num_threads' clause}} expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
#pragma omp parallel num_threads (S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const int da[5] = { 0 }; // expected-note {{'da' defined here}}
S4 e(4);
S5 g[] = {5, 6};
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel private // expected-error {{expected '(' after 'private'}}
#pragma omp parallel private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp parallel firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}}
foo();
- #pragma omp parallel private(i)
+ #pragma omp parallel private(i, z)
#pragma omp parallel private(j)
foo();
#pragma omp parallel firstprivate(i)
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}}
foo();
-#pragma omp parallel reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp parallel reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
foo();
#pragma omp parallel reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp parallel reduction(~ : argc) // expected-error {{expected unqualified-id}}
foo();
-#pragma omp parallel reduction(&& : argc)
+#pragma omp parallel reduction(&& : argc, z)
foo();
#pragma omp parallel reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel sections firstprivate // expected-error {{expected '(' after 'firstprivate'}}
{
{
foo();
}
-#pragma omp parallel sections firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp parallel sections firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
{
foo();
}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel sections firstprivate // expected-error {{expected '(' after 'firstprivate'}}
{
{
foo();
}
-#pragma omp parallel sections firstprivate(argc)
+#pragma omp parallel sections firstprivate(argc, z)
{
foo();
}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel sections if // expected-error {{expected '(' after 'if'}}
{
foo();
{
foo();
}
- #pragma omp parallel sections if(argc)
+ #pragma omp parallel sections if(argc + z)
{
foo();
}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp parallel sections if // expected-error {{expected '(' after 'if'}}
{
foo();
{
foo();
}
- #pragma omp parallel sections if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp parallel sections if (argc > 0 ? argv[1] : argv[2] + z)
{
foo();
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp parallel sections num_threads // expected-error {{expected '(' after 'num_threads'}}
{foo();}
#pragma omp parallel sections num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
{foo();}
#pragma omp parallel sections num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
{foo();}
- #pragma omp parallel sections num_threads (argc)
+ #pragma omp parallel sections num_threads (argc + z)
{foo();}
#pragma omp parallel sections num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
{foo();}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp parallel sections num_threads // expected-error {{expected '(' after 'num_threads'}}
{foo();}
#pragma omp parallel sections num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
{foo();}
#pragma omp parallel sections num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
{foo();}
- #pragma omp parallel sections num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
+ #pragma omp parallel sections num_threads (argc / z)) // expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
{foo();}
#pragma omp parallel sections num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
{foo();}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel sections private // expected-error {{expected '(' after 'private'}}
{
{
foo();
}
-#pragma omp parallel sections private(e, g)
+#pragma omp parallel sections private(e, g, z)
{
foo();
}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0);
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel sections private // expected-error {{expected '(' after 'private'}}
{
{
foo();
}
-#pragma omp parallel sections private(argc)
+#pragma omp parallel sections private(argc, z)
{
foo();
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
{
foo();
}
-#pragma omp parallel sections reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp parallel sections reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
{
foo();
}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
{
foo();
}
-#pragma omp parallel sections reduction(+ : o) // expected-error {{no viable overloaded '='}}
+#pragma omp parallel sections reduction(+ : o, z) // expected-error {{no viable overloaded '='}}
{
foo();
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
const int da[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel sections shared // expected-error {{expected '(' after 'shared'}}
{ foo(); }
{ foo(); }
#pragma omp parallel sections shared(S1) // expected-error {{'S1' does not refer to a value}}
{ foo(); }
-#pragma omp parallel sections shared(a, b, c, d, f)
+#pragma omp parallel sections shared(a, b, c, d, f, k)
{ foo(); }
#pragma omp parallel sections shared(argv[1]) // expected-error {{expected variable name}}
{ foo(); }
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel shared // expected-error {{expected '(' after 'shared'}}
#pragma omp parallel shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp parallel shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
#pragma omp parallel shared (argc)
#pragma omp parallel shared (S1) // expected-error {{'S1' does not refer to a value}}
- #pragma omp parallel shared (a, b, c, d, f)
+ #pragma omp parallel shared (a, b, c, d, f, k)
#pragma omp parallel shared (argv[1]) // expected-error {{expected variable name}}
#pragma omp parallel shared(ba)
#pragma omp parallel shared(ca)
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
int a;
#pragma omp requires unified_address allocate(a) // expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note {{unified_address clause previously used here}} expected-note{{unified_address clause previously used here}} expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp requires'}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp sections firstprivate // expected-error {{expected '(' after 'firstprivate'}}
foo();
}
#pragma omp parallel
-#pragma omp sections firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp sections firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
{
foo();
}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp sections firstprivate // expected-error {{expected '(' after 'firstprivate'}}
foo();
}
#pragma omp parallel
-#pragma omp sections firstprivate(argc)
+#pragma omp sections firstprivate(argc, z)
{
foo();
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel
#pragma omp sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
foo();
}
#pragma omp parallel
-#pragma omp sections lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp sections lastprivate(a, b, k) // expected-error {{lastprivate variable with incomplete type 'S1'}}
{
foo();
}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, k;
int &j = i;
#pragma omp parallel
#pragma omp sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
foo();
}
#pragma omp parallel
-#pragma omp sections lastprivate(ba)
+#pragma omp sections lastprivate(ba, k)
{
foo();
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
}
#pragma omp parallel
-#pragma omp sections reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+#pragma omp sections reduction(+ : o, z) // expected-error 2 {{no viable overloaded '='}}
{
foo();
}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
}
#pragma omp parallel
-#pragma omp sections reduction(&& : argc)
+#pragma omp sections reduction(&& : argc, z)
{
foo();
}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
template<class I, class C> int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp simd linear(ref(e, g)) // expected-error 2 {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'ref'}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
+ #pragma omp simd linear(h, z) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp simd linear(uval(i)) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
for (int k = 0; k < argc; ++k) ++k;
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp simd linear(f) linear(f) // expected-error {{linear variable cannot be linear}} expected-note {{defined as linear}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
// expected-error@+2 {{linear variable with incomplete type 'S1'}}
// expected-error@+1 {{argument of a linear clause should be of integral or pointer type, not 'S2'}}
- #pragma omp simd linear(a, b)
+ #pragma omp simd linear(a, b, z)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp simd linear (argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50 -Wuninitialized
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -fopenmp-version=50 -DOMP50 -Wuninitialized
static int sii;
// expected-note@+1 {{defined as threadprivate or thread local}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp simd'}}
#pragma omp simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp simd reduction(&& : argc)
+#pragma omp simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, class C>
T tmain(T argc, C **argv) {
- T i;
+ T i, z;
static T TA;
+#pragma omp single copyprivate(z)
+ ;
#pragma omp parallel
#pragma omp single copyprivate // expected-error {{expected '(' after 'copyprivate'}}
#pragma omp parallel
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
static int intA;
#pragma omp parallel
#pragma omp single copyprivate // expected-error {{expected '(' after 'copyprivate'}}
#pragma omp parallel
#pragma omp single copyprivate(m) // expected-error {{'operator=' is a private member of 'S5'}}
foo();
-#pragma omp parallel private(i)
+#pragma omp parallel private(i, z)
{
-#pragma omp single copyprivate(i)
+#pragma omp single copyprivate(i, z)
foo();
}
#pragma omp parallel shared(i) // expected-note {{defined as shared}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp single firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp single firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
foo();
#pragma omp parallel
-#pragma omp single firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp single firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
foo();
#pragma omp parallel
#pragma omp single firstprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp single firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp single firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
foo();
#pragma omp parallel
-#pragma omp single firstprivate(argc)
+#pragma omp single firstprivate(argc, z)
foo();
#pragma omp parallel
#pragma omp single firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int a;
+ int a, z;
#pragma omp target data map(to: a) device // expected-error {{expected '(' after 'device'}}
#pragma omp target data map(to: a) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target data map(to: a) device () // expected-error {{expected expression}}
#pragma omp target data map(to: a) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target data map(to: a) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target data' are ignored}}
#pragma omp target data map(to: a) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
- #pragma omp target data map(to: a) device (argc + argc)
+ #pragma omp target data map(to: a) device (argc + argc + z)
#pragma omp target data map(to: a) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target data' cannot contain more than one 'device' clause}}
#pragma omp target data map(to: a) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target data map(to: a) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int a;
+ int a, z;
#pragma omp target data map(to: a) if // expected-error {{expected '(' after 'if'}}
#pragma omp target data map(to: a) if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target data map(to: a) if () // expected-error {{expected expression}}
#pragma omp target data map(to: a) if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target data map(to: a) if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target data' are ignored}}
#pragma omp target data map(to: a) if (argc > 0 ? argv[1] : argv[2])
- #pragma omp target data map(to: a) if (argc + argc)
+ #pragma omp target data map(to: a) if (argc + argc + z)
#pragma omp target data map(to: a) if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target data' cannot contain more than one 'if' clause}}
#pragma omp target data map(to: a) if (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target data map(to: a) if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() { }
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
+ int z;
#pragma omp target device // expected-error {{expected '(' after 'device'}}
foo();
#pragma omp target device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
- #pragma omp target device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
+ #pragma omp target device (z-argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
#pragma omp target device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target enter data map(to: i) device // expected-error {{expected '(' after 'device'}}
#pragma omp target enter data map(to: i) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target enter data map(to: i) device () // expected-error {{expected expression}}
#pragma omp target enter data map(to: i) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target enter data map(to: i) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
#pragma omp target enter data map(to: i) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
- #pragma omp target enter data map(to: i) device (argc + argc)
+ #pragma omp target enter data map(to: i) device (argc +z + argc )
#pragma omp target enter data map(to: i) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'device' clause}}
#pragma omp target enter data map(to: i) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target enter data map(to: i) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target enter data map(to: i) if // expected-error {{expected '(' after 'if'}}
#pragma omp target enter data map(to: i) if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target enter data map(to: i) if () // expected-error {{expected expression}}
#pragma omp target enter data map(to: i) if(target enter data : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target enter data map(to: i) if(target enter data : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target enter data map(to: i) if(target enter data : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp target enter data map(to: i) if(target enter data : argc)
+ #pragma omp target enter data map(to: i) if(target enter data : argc + z)
#pragma omp target enter data map(to: i) if(target enter data : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target enter data'}}
#pragma omp target enter data map(to: i) if(target enter data : argc) if (target enter data:argc) // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'if' clause with 'target enter data' name modifier}}
#pragma omp target enter data map(to: i) if(target enter data : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - -x c++ %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - -x c++ %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - -x c++ %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - -x c++ %s -Wuninitialized
int main(int argc, char **argv) {
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
int main(int argc, char **argv) {
int i;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target exit data map(from: i) device // expected-error {{expected '(' after 'device'}}
#pragma omp target exit data map(from: i) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target exit data map(from: i) device () // expected-error {{expected expression}}
#pragma omp target exit data map(from: i) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'device' clause}}
#pragma omp target exit data map(from: i) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target exit data map(from: i) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
- #pragma omp target exit data map(from: i) device (-10u)
+ #pragma omp target exit data map(from: i) device (-10u + z)
#pragma omp target exit data map(from: i) device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
foo();
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target exit data map(from: i) if // expected-error {{expected '(' after 'if'}}
#pragma omp target exit data map(from: i) if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target exit data map(from: i) if () // expected-error {{expected expression}}
#pragma omp target exit data map(from: i) if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target exit data map(from: i) if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
#pragma omp target exit data map(from: i) if (argc > 0 ? argv[1] : argv[2])
- #pragma omp target exit data map(from: i) if (argc + argc)
+ #pragma omp target exit data map(from: i) if (argc + argc + z)
#pragma omp target exit data map(from: i) if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'if' clause}}
#pragma omp target exit data map(from: i) if (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target exit data map(from: i) if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - -x c++ %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - -x c++ %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - -x c++ %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - -x c++ %s -Wuninitialized
int main(int argc, char **argv) {
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
int main(int argc, char **argv) {
int i;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target firstprivate // expected-error {{expected '(' after 'firstprivate'}}
{}
int v = 0;
int i;
}
-#pragma omp parallel shared(i)
-#pragma omp parallel firstprivate(i)
+#pragma omp parallel shared(i, z)
+#pragma omp parallel firstprivate(i, z)
#pragma omp target firstprivate(j)
{}
#pragma omp target firstprivate(i)
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0);
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp target firstprivate // expected-error {{expected '(' after 'firstprivate'}}
{}
{}
#pragma omp target firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
{}
-#pragma omp target firstprivate(argc)
+#pragma omp target firstprivate(argc, z)
{}
#pragma omp target firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
{}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp target if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
- #pragma omp target if(argc)
+ #pragma omp target if(argc+z)
foo();
#pragma omp target if(target : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
}
int main(int argc, char **argv) {
+int z;
#pragma omp target if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target if(target : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
- #pragma omp target if(target : argc)
+ #pragma omp target if(target : argc/z)
foo();
#pragma omp target if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target'}}
foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
struct ST {
int *a;
};
#pragma omp target is_device_ptr(aa) // OK
{}
#pragma omp target is_device_ptr(raa) // OK
- {}
+ {}
#pragma omp target is_device_ptr(e) // expected-error{{expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'}}
{}
#pragma omp target is_device_ptr(g) // OK
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp-simd -ferror-limit 200 -x c %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify -fopenmp-simd -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
#ifdef CCODE
void foo(int arg) {
const int n = 0;
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
+ int k;
#pragma omp target parallel device // expected-error {{expected '(' after 'device'}}
foo();
#pragma omp target parallel device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target parallel device (argc + argc)
foo();
- #pragma omp target parallel device (argc), device (argc+1) // expected-error {{directive '#pragma omp target parallel' cannot contain more than one 'device' clause}}
+ #pragma omp target parallel device (k), device (argc+1) // expected-error {{directive '#pragma omp target parallel' cannot contain more than one 'device' clause}}
foo();
#pragma omp target parallel device (S1) // expected-error {{'S1' does not refer to a value}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
static int m;
#pragma omp target parallel firstprivate // expected-error {{expected '(' after 'firstprivate'}}
foo();
#pragma omp target parallel firstprivate(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel' directive}}
foo();
- #pragma omp target parallel firstprivate(ca)
+ #pragma omp target parallel firstprivate(ca, z)
foo();
#pragma omp target parallel firstprivate(da)
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target parallel for device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for device (argc + argc)
+ #pragma omp target parallel for device (z + argc)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for device (argc), device (argc+1) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp target parallel for firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for firstprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp target parallel for firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp target parallel for firstprivate(z, a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target parallel for firstprivate(argv[1]) // expected-error {{expected variable name}}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
int i;
+ T z;
#pragma omp target parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for if(argc)
+ #pragma omp target parallel for if(argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if(target : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target parallel for if (argc > 0 ? argv[1] : argv[2] - z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'if' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for allocate(omp_thread_mem_alloc: e) linear(e, g) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target parallel for' directive}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
+#pragma omp target parallel for linear(z, h) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for linear(i)
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for linear(argc)
+#pragma omp target parallel for linear(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for linear(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for'}}
#pragma omp target parallel for
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
+ #pragma omp target parallel for num_threads (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads ((argc > 0) ? argv[1] : argv[2]) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
+ #pragma omp target parallel for num_threads (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for private(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
+#pragma omp target parallel for private(a, b, z) // expected-error {{private variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for private(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0);
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i ,z;
int &j = i;
#pragma omp target parallel for private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for private(argc)
+#pragma omp target parallel for private(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for private(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp target parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target parallel for reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp target parallel for reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target parallel for reduction(&& : argc)
+#pragma omp target parallel for reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target parallel for reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp target parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
// expected-error@+1 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
#pragma omp target parallel for schedule (guided, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp target parallel for schedule (dynamic, 1)
+ #pragma omp target parallel for schedule (dynamic, 1 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for schedule (static, N) // expected-error {{argument to 'schedule' clause must be a strictly positive integer value}}
for (T i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target parallel for schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target parallel for schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target parallel for schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp target parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+ #pragma omp target parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2 + z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target parallel for simd device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd device (argc + argc)
+ #pragma omp target parallel for simd device (argc + argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd device (argc), device (argc+1) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i,z;
int &j = i;
#pragma omp target parallel for simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp target parallel for simd firstprivate(z, a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd firstprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp target parallel for simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for simd firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp target parallel for simd firstprivate(z, a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp target parallel for simd firstprivate(argv[1]) // expected-error {{expected variable name}}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- int i;
+ int i, k;
#pragma omp target parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(argc)
+ #pragma omp target parallel for simd if(k)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(target : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, k;
#pragma omp target parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd if(parallel : argc)
+ #pragma omp target parallel for simd if(parallel : k)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target parallel for simd'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp target parallel for simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd lastprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp target parallel for simd lastprivate(2 * 2) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for simd lastprivate(ba)
+#pragma omp target parallel for simd lastprivate(ba, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp target parallel for simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd linear(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd linear(e, g)
+#pragma omp target parallel for simd linear(e, g, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd linear(argc)
+#pragma omp target parallel for simd linear(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd linear(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
T &j = i;
T *k = &j;
T x;
- T y;
+ T y ,z;
T to, tofrom, always;
const T (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(S2::S2sc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target parallel for simd map(x)
+#pragma omp target parallel for simd map(x, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(to: x)
for (i = 0; i < argc; ++i) foo();
int &j = i;
int *k = &j;
int x;
- int y;
+ int y, z;
int to, tofrom, always;
const int (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(to: to)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target parallel for simd map(to)
+#pragma omp target parallel for simd map(to, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(to, x)
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target parallel for simd'}}
#pragma omp target parallel for simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
+ #pragma omp target parallel for simd num_threads (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads ((argc > 0) ? argv[1] : argv[2]) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
+ #pragma omp target parallel for simd num_threads (z-argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd private(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd private(e, g)
+#pragma omp target parallel for simd private(e, g, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel for simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target parallel for simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target parallel for simd private(argc)
+#pragma omp target parallel for simd private(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target parallel for simd private(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp target parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target parallel for simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp target parallel for simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target parallel for simd reduction(&& : argc)
+#pragma omp target parallel for simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target parallel for simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp target parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target parallel for simd schedule (dynamic, 1)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
- #pragma omp target parallel for simd schedule (guided, (ST > 0) ? 1 + ST : 2)
+ #pragma omp target parallel for simd schedule (guided, (ST > 0) ? 1 + ST : 2 + z)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target parallel for simd schedule // expected-error {{expected '(' after 'schedule'}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target parallel for simd schedule ( // expected-error {{expected 'static', 'dynamic', 'guided', 'auto', 'runtime', 'monotonic', 'nonmonotonic' or 'simd' in OpenMP clause 'schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target parallel for simd schedule (static, 2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
- #pragma omp target parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+ #pragma omp target parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2 - z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+2 2 {{directive '#pragma omp target parallel for simd' cannot contain more than one 'schedule' clause}}
// expected-error@+1 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp target parallel if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target parallel if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target parallel if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
- #pragma omp target parallel if (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target parallel if (argc > 0 ? argv[1] : argv[2] + z)
foo();
#pragma omp target parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target parallel' cannot contain more than one 'if' clause}}
foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target parallel if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target parallel if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target parallel if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
- #pragma omp target parallel if(parallel : argc)
+ #pragma omp target parallel if(parallel : argc * z)
foo();
#pragma omp target parallel if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target parallel'}}
foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
T &j = i;
T *k = &j;
T x;
- T y;
+ T y, z;
T to, tofrom, always;
const T (&l)[5] = da;
foo();
#pragma omp target parallel map(l[true:true])
foo();
-#pragma omp target parallel map(x)
+#pragma omp target parallel map(x, z)
foo();
#pragma omp target parallel map(tofrom: t[:I])
foo();
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
// RUN: not %clang_cc1 -fopenmp -std=c++11 -fopenmp-targets=aaa-bbb-ccc-ddd -o - %s 2>&1 | FileCheck %s
// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
#pragma omp target parallel num_threads // expected-error {{expected '(' after 'num_threads'}}
foo();
#pragma omp target parallel num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target parallel num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
- #pragma omp target parallel num_threads (argc)
+ #pragma omp target parallel num_threads (argc + z)
foo();
#pragma omp target parallel num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target parallel num_threads // expected-error {{expected '(' after 'num_threads'}}
foo();
#pragma omp target parallel num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target parallel num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
- #pragma omp target parallel num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
+ #pragma omp target parallel num_threads (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
#pragma omp target parallel num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target parallel reduction(^ : T) // expected-error {{'T' does not refer to a value}}
foo();
-#pragma omp target parallel reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target parallel reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
foo();
#pragma omp target parallel reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp target parallel reduction(~ : argc) // expected-error {{expected unqualified-id}}
foo();
-#pragma omp target parallel reduction(&& : argc)
+#pragma omp target parallel reduction(&& : argc, z)
foo();
#pragma omp target parallel reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target parallel shared // expected-error {{expected '(' after 'shared'}}
foo();
foo();
#pragma omp target parallel shared (S1) // expected-error {{'S1' does not refer to a value}}
foo();
- #pragma omp target parallel shared (a, b, c, d, f)
+ #pragma omp target parallel shared (a, b, c, d, f, z)
foo();
#pragma omp target parallel shared (argv[1]) // expected-error {{expected variable name}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
foo();
-#pragma omp target reduction(&& : argc)
+#pragma omp target reduction(&& : argc, z)
foo();
#pragma omp target reduction(^ : T) // expected-error {{'T' does not refer to a value}}
foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp target reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
foo();
-#pragma omp target reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+#pragma omp target reduction(min : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
foo();
#pragma omp target reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
foo();
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST>
T tmain(T argc, S **argv) {
- int i;
+ int i, k;
#pragma omp target simd defaultmap // expected-error {{expected '(' after 'defaultmap'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd defaultmap ( // expected-error {{expected 'tofrom' in OpenMP clause 'defaultmap'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target simd device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd device (argc + argc)
+ #pragma omp target simd device (argc + argc * z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd device (argc), device (argc+1) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
#pragma omp target simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target simd firstprivate(a, b) // expected-error {{firstprivate variable with incomplete type 'S1'}}
+#pragma omp target simd firstprivate(a, b, z) // expected-error {{firstprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target simd firstprivate(argv[1]) // expected-error {{expected variable name}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
#pragma omp target simd firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target simd firstprivate(argc)
+#pragma omp target simd firstprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp target simd firstprivate(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
int i;
#pragma omp target simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(argc)
+ #pragma omp target simd if(argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd if(target : argc) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
+ #pragma omp target simd if(target : argc + z) if (simd:argc) // expected-error {{directive name modifier 'simd' is not allowed for '#pragma omp target simd'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target simd' cannot contain more than one 'if' clause with 'target' name modifier}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target simd linear(i)
+#pragma omp target simd linear(i, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k)
#pragma omp target simd linear(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target simd linear(argc)
+#pragma omp target simd linear(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target simd linear(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target simd'}}
#pragma omp target simd
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target simd private(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target simd private(e, g)
+#pragma omp target simd private(e, g, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp target simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp target simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp target simd private(argc)
+#pragma omp target simd private(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp target simd private(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp target simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp target simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp target simd reduction(&& : argc)
+#pragma omp target simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp target simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams device // expected-error {{expected '(' after 'device'}}
foo();
#pragma omp target teams device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target teams device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-#pragma omp target teams device (argc + argc)
+#pragma omp target teams device (argc + argc + z)
foo();
#pragma omp target teams device (argc), device (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'device' clause}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute device (argc + argc)
+#pragma omp target teams distribute device (argc + argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute device (argc), device (argc+1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target teams distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute dist_schedule (static), dist_schedule (static, 1+z) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp teams distribute firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}} expected-warning {{Non-trivial type 'const S3 [5]' is mapped, only trivial types are guaranteed to be mapped correctly}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute firstprivate(da)
+#pragma omp target teams distribute firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute firstprivate(S2::S2s)
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
int i;
+ T z;
#pragma omp target teams distribute if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
+#pragma omp target teams distribute if (z+argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute if (argc > 0 ? argv[1] : argv[2])
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
+#pragma omp target teams distribute if (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute if (argc > 0 ? argv[1] : argv[2])
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute'}}
#pragma omp target teams distribute
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute num_teams(T) // expected-error {{'T' does not refer to a value}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute num_teams(argc + argc)
+#pragma omp target teams distribute num_teams(argc + argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'num_teams' clause}}
for (int i=0; i<100; i++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute num_teams (argc + argc)
+#pragma omp target teams distribute num_teams (argc + argc+z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute' cannot contain more than one 'num_teams' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11 -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11 -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute parallel for device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
+#pragma omp target teams distribute parallel for device (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target teams distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute parallel for dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute parallel for dist_schedule (static), dist_schedule (static, 1+z) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute parallel for firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp target teams distribute parallel for firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for firstprivate(da)
+#pragma omp target teams distribute parallel for firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for firstprivate(S2::S2s)
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(argc)
+#pragma omp target teams distribute parallel for if(argc -z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for if(parallel : argc)
+#pragma omp target teams distribute parallel for if(parallel : argc / z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
T &j = i;
T *k = &j;
T x;
- T y;
+ T y, z;
T to, tofrom, always;
const T (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for map(S2::S2sc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for map(x)
+#pragma omp target teams distribute parallel for map(x, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for map(to: x)
for (i = 0; i < argc; ++i) foo();
int &j = i;
int *k = &j;
int x;
- int y;
+ int y, z;
int to, tofrom, always;
const int (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for map(argv[1])
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for map(ba)
+#pragma omp target teams distribute parallel for map(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for map(ca)
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for'}}
#pragma omp target teams distribute parallel for
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute parallel for num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for num_teams(T) // expected-error {{'T' does not refer to a value}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute parallel for num_teams(argc + argc)
+#pragma omp target teams distribute parallel for num_teams(argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'num_teams' clause}}
for (int i=0; i<100; i++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute parallel for num_teams (argc + argc)
+#pragma omp target teams distribute parallel for num_teams (argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'num_teams' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target teams distribute parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
+#pragma omp target teams distribute parallel for num_threads (argc - z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads ((argc > 0) ? argv[1] : argv[2]) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute parallel for num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
+#pragma omp target teams distribute parallel for num_threads (z - argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
+#pragma omp target teams distribute parallel for reduction(+ : z, ba) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
+#pragma omp target teams distribute parallel for reduction(- : da, z) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
// expected-error@+1 {{expected '(' after 'schedule'}}
#pragma omp target teams distribute parallel for schedule
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
-#pragma omp target teams distribute parallel for schedule (dynamic, 1))
+#pragma omp target teams distribute parallel for schedule (dynamic, z+1))
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for schedule (guided, (ST > 0) ? 1 + ST : 2)
}
int main(int argc, char **argv) {
+ int z;
// expected-error@+1 {{expected '(' after 'schedule'}}
#pragma omp target teams distribute parallel for schedule
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
-#pragma omp target teams distribute parallel for schedule (static, 2+2))
+#pragma omp target teams distribute parallel for schedule (static, 2+2 + z))
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target teams distribute parallel for schedule (dynamic, foobool(1) > 0 ? 1 : 2)
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp target teams distribute parallel for shared // expected-error {{expected '(' after 'shared'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for shared (S1) // expected-error {{'S1' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for shared (a, b, c, d, f)
+#pragma omp target teams distribute parallel for shared (a, b, c, d, f, k)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for shared (argv[1]) // expected-error {{expected variable name}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11 -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11 -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute parallel for simd device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd device (argc + argc)
+#pragma omp target teams distribute parallel for simd device (argc + argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd device (argc), device (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target teams distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute parallel for simd dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1+z) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute parallel for simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
extern S1 a;
class S2 {
mutable int a;
-
+
public:
S2() : a(0) {}
S2(const S2 &s2) : a(s2.a) {}
class S3 {
int a;
S3 &operator=(const S3 &s3);
-
+
public:
S3() : a(0) {} // expected-note 2 {{candidate constructor not viable: requires 0 arguments, but 1 was provided}}
S3(S3 &s3) : a(s3.a) {} // expected-note 2 {{candidate constructor not viable: 1st argument ('const S3') would lose const qualifier}}
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute parallel for simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp target teams distribute parallel for simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd firstprivate(da)
+#pragma omp target teams distribute parallel for simd firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd firstprivate(S2::S2s)
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, k;
#pragma omp target teams distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
+#pragma omp target teams distribute parallel for simd if (k)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if (argc > 0 ? argv[1] : argv[2])
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, k;
#pragma omp target teams distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
+#pragma omp target teams distribute parallel for simd if (k)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd if (argc > 0 ? argv[1] : argv[2])
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute parallel for simd lastprivate(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute parallel for simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+#pragma omp target teams distribute parallel for simd lastprivate(e, g, z) // expected-error 2 {{calling a private constructor of class 'S4'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute parallel for simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
float k;
#pragma omp target teams distribute parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
#pragma omp target teams distribute parallel for simd lastprivate(2 * 2) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd lastprivate(ba)
+#pragma omp target teams distribute parallel for simd lastprivate(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
T &j = i;
T *k = &j;
T x;
- T y;
+ T y, z;
T to, tofrom, always;
const T (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd map(l[true:true])
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd map(x)
+#pragma omp target teams distribute parallel for simd map(x, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd map(tofrom: t[:I])
for (i = 0; i < argc; ++i) foo();
int &j = i;
int *k = &j;
int x;
- int y;
+ int y, z;
int to, tofrom, always;
const int (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd map(to)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd map(to, x)
+#pragma omp target teams distribute parallel for simd map(to, x, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd map(to x) // expected-error {{expected ',' or ')' in 'map' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute parallel for simd'}}
#pragma omp target teams distribute parallel for simd
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute parallel for simd num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for simd num_teams(T) // expected-error {{'T' does not refer to a value}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for simd num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute parallel for simd num_teams(argc + argc)
+#pragma omp target teams distribute parallel for simd num_teams(argc + argc/z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for simd num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'num_teams' clause}}
for (int i=0; i<100; i++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for simd num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for simd num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute parallel for simd num_teams (argc + argc)
+#pragma omp target teams distribute parallel for simd num_teams (argc + argc-z)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute parallel for simd num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'num_teams' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, k;
#pragma omp target teams distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd num_threads (argc)
+#pragma omp target teams distribute parallel for simd num_threads (argc + k)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads (N) // expected-error {{argument to 'num_threads' clause must be a strictly positive integer value}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, k;
#pragma omp target teams distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
+#pragma omp target teams distribute parallel for simd num_threads (k)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target teams distribute parallel for simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
+#pragma omp target teams distribute parallel for simd reduction(min : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T z;
// expected-error@+1 {{expected '(' after 'schedule'}}
#pragma omp target teams distribute parallel for simd schedule
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-warning@+1 {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
-#pragma omp target teams distribute parallel for simd schedule (dynamic, 1))
+#pragma omp target teams distribute parallel for simd schedule (dynamic, 1 + z))
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for simd schedule (guided, (ST > 0) ? 1 + ST : 2)
}
int main(int argc, char **argv) {
+ int z;
// expected-error@+1 {{expected '(' after 'schedule'}}
#pragma omp target teams distribute parallel for simd schedule
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
#pragma omp target teams distribute parallel for simd schedule (static, 2+2))
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
-#pragma omp target teams distribute parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : 2)
+#pragma omp target teams distribute parallel for simd schedule (dynamic, foobool(1) > 0 ? 1 : z)
for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4];
// expected-error@+2 2 {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'schedule' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute parallel for simd shared // expected-error {{expected '(' after 'shared'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd shared (S1) // expected-error {{'S1' does not refer to a value}}
for (int j=0; j<100; j++) foo();
- #pragma omp target teams distribute parallel for simd shared (a, b, c, d, f)
+ #pragma omp target teams distribute parallel for simd shared (a, b, c, d, f, z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd shared (argv[1]) // expected-error {{expected variable name}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for simd safelen (argc // expected-note {{to match this '('}} expected-error 2 {{expression is not an integral constant expression}} expected-note 2 {{read of non-const variable 'argc' is not allowed in a constant expression}} expected-error {{expected ')'}}
- for (int i = ST; i < N; i++)
+ for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
-
+
#pragma omp target teams distribute parallel for simd safelen (ST // expected-error {{argument to 'safelen' clause must be a strictly positive integer value}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target teams distribute parallel for simd safelen ((ST > 0) ? 1 + ST : 2)
- for (int i = ST; i < N; i++)
+ for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
#if __cplusplus >= 201103L
#pragma omp target teams distribute parallel for simd safelen (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-
+
#if __cplusplus >= 201103L
// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}}
#endif
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute parallel for simd thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd thread_limit(T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for simd thread_limit(argc + argc)
+#pragma omp target teams distribute parallel for simd thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'thread_limit' clause}}
for (int j=0; j<100; j++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd thread_limit (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for simd thread_limit (argc + argc)
+#pragma omp target teams distribute parallel for simd thread_limit (argc + argc-z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for simd thread_limit (argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for simd' cannot contain more than one 'thread_limit' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute parallel for thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for thread_limit(argc + argc)
+#pragma omp target teams distribute parallel for thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute parallel for thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for thread_limit (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute parallel for thread_limit (argc + argc)
+#pragma omp target teams distribute parallel for thread_limit (argc -z + argc)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute parallel for thread_limit (argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'thread_limit' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target teams distribute reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
+#pragma omp target teams distribute reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
struct S1; // expected-note {{declared here}}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute simd device // expected-error {{expected '(' after 'device'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd device (argc + argc)
+#pragma omp target teams distribute simd device (argc + argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd device (argc), device (argc+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'device' clause}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute simd dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i = 0; i < 10; ++i) foo();
-#pragma omp target teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp target teams distribute simd dist_schedule (static), dist_schedule (static, 1+z) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target teams distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp target teams distribute simd firstprivate(ca) // expected-error {{no matching constructor for initialization of 'S3'}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd firstprivate(da)
+#pragma omp target teams distribute simd firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd firstprivate(S2::S2s)
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target teams distribute simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(argc)
+#pragma omp target teams distribute simd if(argc * z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target // expected-error {{use of undeclared identifier 'target'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target: argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd if(target: argc)
+#pragma omp target teams distribute simd if(target: z/argc)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd if(target : argc) if (distribute:argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute simd'}}
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute simd lastprivate(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute simd lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+#pragma omp target teams distribute simd lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute simd lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
float k;
#pragma omp target teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
#pragma omp target teams distribute simd lastprivate(2 * 2) // expected-error {{expected variable name}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd lastprivate(ba)
+#pragma omp target teams distribute simd lastprivate(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd lastprivate(ca) // expected-error {{const-qualified variable without mutable fields cannot be lastprivate}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wno-openmp-target -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
T &j = i;
T *k = &j;
T x;
- T y;
+ T y, z;
T to, tofrom, always;
const T (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd map(S2::S2sc)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd map(x)
+#pragma omp target teams distribute simd map(x, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd map(to: x)
for (i = 0; i < argc; ++i) foo();
int &j = i;
int *k = &j;
int x;
- int y;
+ int y, z;
int to, tofrom, always;
const int (&l)[5] = da;
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd map(argv[1])
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd map(ba)
+#pragma omp target teams distribute simd map(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd map(ca)
for (i = 0; i < argc; ++i) foo();
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp target teams distribute simd'}}
#pragma omp target teams distribute simd
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute simd num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(T) // expected-error {{'T' does not refer to a value}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute simd num_teams(argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
+#pragma omp target teams distribute simd num_teams(argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i=0; i<100; i++) foo();
-#pragma omp target teams distribute simd num_teams (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
+#pragma omp target teams distribute simd num_teams (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = { 0 }; // expected-note {{'da' defined here}}
S4 e(4);
S5 g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp target teams distribute simd private // expected-error {{expected '(' after 'private'}}
#pragma omp target teams distribute simd private (a, b, c, d, f) // expected-error {{private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}}
for (int k = 0; k < argc; ++k) ++k;
-#pragma omp target teams distribute simd private (argv[1]) // expected-error {{expected variable name}}
+#pragma omp target teams distribute simd private (k, argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target teams distribute simd private(ba) allocate(omp_thread_mem_alloc: ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams distribute simd' directive}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target teams distribute simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+#pragma omp target teams distribute simd reduction(min : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
for (int j=0; j<100; j++) foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+#pragma omp target teams distribute simd reduction(* : ca, z) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams distribute simd shared // expected-error {{expected '(' after 'shared'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int j=0; j<100; j++) foo();
- #pragma omp target teams distribute simd shared (argc)
+ #pragma omp target teams distribute simd shared (argc, z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd shared (S1) // expected-error {{'S1' does not refer to a value}}
for (int j=0; j<100; j++) foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams distribute simd thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd thread_limit(T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd thread_limit(argc + argc)
+#pragma omp target teams distribute simd thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'thread_limit' clause}}
for (int j=0; j<100; j++) foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams distribute simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd thread_limit (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
-#pragma omp target teams distribute simd thread_limit (argc + argc)
+#pragma omp target teams distribute simd thread_limit (argc + argc - z)
for (int j=0; j<100; j++) foo();
#pragma omp target teams distribute simd thread_limit (argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'thread_limit' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams firstprivate // expected-error {{expected '(' after 'firstprivate'}}
foo();
foo();
#pragma omp target teams allocate(omp_thread_mem_alloc: ba) firstprivate(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'target teams' directive}}
foo();
-#pragma omp target teams firstprivate(ca)
+#pragma omp target teams firstprivate(ca, z)
foo();
#pragma omp target teams firstprivate(da)
foo();
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp target teams if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target teams if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target teams if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
-#pragma omp target teams if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
+#pragma omp target teams if (z)) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
foo();
#pragma omp target teams if (argc > 0 ? argv[1] : argv[2])
foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams if // expected-error {{expected '(' after 'if'}}
foo();
#pragma omp target teams if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
#pragma omp target teams if(target : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
foo();
-#pragma omp target teams if(target : argc)
+#pragma omp target teams if(target : z)
foo();
#pragma omp target teams if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams'}}
foo();
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp -ferror-limit 200 %s -Wuninitialized
-// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s
+// RUN: %clang_cc1 -std=c++11 -verify -fopenmp-simd -ferror-limit 200 %s -Wuninitialized
struct ST {
int *a;
};
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target
-// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 200 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -DCCODE -verify -fopenmp -ferror-limit 200 -x c %s -Wno-openmp-target -Wuninitialized
#ifdef CCODE
void foo(int arg) {
const int n = 0;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams num_teams(C)
foo();
#pragma omp target teams num_teams(T) // expected-error {{'T' does not refer to a value}}
foo();
#pragma omp target teams num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-#pragma omp target teams num_teams(argc + argc)
+#pragma omp target teams num_teams(argc + argc + z)
foo();
#pragma omp target teams num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'num_teams' clause}}
foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams num_teams // expected-error {{expected '(' after 'num_teams'}}
foo();
#pragma omp target teams num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-#pragma omp target teams num_teams (argc + argc)
+#pragma omp target teams num_teams (argc + argc*z)
foo();
#pragma omp target teams num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'num_teams' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = { 0 }; // expected-note {{'da' defined here}}
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target teams private // expected-error {{expected '(' after 'private'}}
foo();
foo();
#pragma omp target teams firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}}
foo();
-#pragma omp target teams private(i)
+#pragma omp target teams private(i, z)
foo();
#pragma omp target teams private(j)
foo();
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp target teams reduction(^ : T) // expected-error {{'T' does not refer to a value}}
foo();
-#pragma omp target teams reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp target teams reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
foo();
#pragma omp target teams reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
foo();
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp target teams reduction(~ : argc) // expected-error {{expected unqualified-id}}
foo();
-#pragma omp target teams reduction(&& : argc)
+#pragma omp target teams reduction(&& : argc, z)
foo();
#pragma omp target teams reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target teams thread_limit(C)
foo();
#pragma omp target teams thread_limit(T) // expected-error {{'T' does not refer to a value}}
foo();
#pragma omp target teams thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-#pragma omp target teams thread_limit(argc + argc)
+#pragma omp target teams thread_limit(argc + argc + z)
foo();
#pragma omp target teams thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'thread_limit' clause}}
foo();
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target teams thread_limit // expected-error {{expected '(' after 'thread_limit'}}
foo();
#pragma omp target teams thread_limit (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
-#pragma omp target teams thread_limit (argc + argc)
+#pragma omp target teams thread_limit (argc + argc/ z)
foo();
#pragma omp target teams thread_limit (argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp target teams' cannot contain more than one 'thread_limit' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S>
int tmain(T argc, S **argv) {
- int i;
+ int i, z;
#pragma omp target update to(i) device // expected-error {{expected '(' after 'device'}}
#pragma omp target update to(i) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(i) device () // expected-error {{expected expression}}
#pragma omp target update to(i) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(i) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
#pragma omp target update from(i) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-#pragma omp target update from(i) device (argc + argc)
+#pragma omp target update from(i) device (argc + z)
#pragma omp target update from(i) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target update' cannot contain more than one 'device' clause}}
#pragma omp target update from(i) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target update from(i) device (3.14) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'double'}}
}
int main(int argc, char **argv) {
- int j;
+ int j, z;
#pragma omp target update to(j) device // expected-error {{expected '(' after 'device'}}
#pragma omp target update from(j) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(j) device () // expected-error {{expected expression}}
#pragma omp target update from(j) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(j) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
#pragma omp target update from(j) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
-#pragma omp target update to(j) device (argc + argc)
+#pragma omp target update to(j) device (z + argc)
#pragma omp target update from(j) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target update' cannot contain more than one 'device' clause}}
#pragma omp target update to(j) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target update from(j) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
#pragma omp target update from(n) if (S) // expected-error {{'S' does not refer to a value}}
#pragma omp target update to(n) if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update from(n) if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-#pragma omp target update to(n) if(argc)
+#pragma omp target update to(n) if(argc + n)
#pragma omp target update from(n) if(target update // expected-error {{use of undeclared identifier 'target'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(n) if(target update : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update from(n) if(target update : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-#pragma omp target update to(n) if(target update : argc)
+#pragma omp target update to(n) if(target update : argc + n)
#pragma omp target update from(n) if(target update : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target update'}}
#pragma omp target update to(n) if(target update : argc) if (target update:argc) // expected-error {{directive '#pragma omp target update' cannot contain more than one 'if' clause with 'target update' name modifier}}
#pragma omp target update from(n) if(target update : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
#pragma omp target update to(m) if(target update // expected-error {{use of undeclared identifier 'target'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update from(m) if(target update : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(m) if(target update : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
-#pragma omp target update from(m) if(target update : argc)
+#pragma omp target update from(m) if(target update : argc + m)
#pragma omp target update to(m) if(target update : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target update'}}
#pragma omp target update from(m) if(target update : argc) if (target update:argc) // expected-error {{directive '#pragma omp target update' cannot contain more than one 'if' clause with 'target update' name modifier}}
#pragma omp target update to(m) if(target update : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int main(int argc, char **argv) {
int i;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp task final // expected-error {{expected '(' after 'final'}}
#pragma omp task final ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task final () // expected-error {{expected expression}}
#pragma omp task final (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp task final (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
+ #pragma omp task final (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
#pragma omp task final (argc > 0 ? argv[1] : argv[2])
#pragma omp task final (foobool(argc)), final (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'final' clause}}
#pragma omp task final (S) // expected-error {{'S' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp task final // expected-error {{expected '(' after 'final'}}
#pragma omp task final ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task final () // expected-error {{expected expression}}
#pragma omp task final (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp task final (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
+ #pragma omp task final (z+argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
#pragma omp task final (argc > 0 ? argv[1] : argv[2])
#pragma omp task final (foobool(argc)), final (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'final' clause}}
#pragma omp task final (S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
static int m;
#pragma omp task firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp task firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}}
#pragma omp task firstprivate(argv[1]) // expected-error {{expected variable name}}
#pragma omp task allocate(omp_thread_mem_alloc: ba) firstprivate(ba) // expected-warning {{allocator with the 'thread' trait access has unspecified behavior on 'task' directive}}
-#pragma omp task firstprivate(ca)
+#pragma omp task firstprivate(ca,z )
#pragma omp task firstprivate(da)
#pragma omp task firstprivate(S2::S2s)
#pragma omp task firstprivate(S2::S2sc)
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp task if // expected-error {{expected '(' after 'if'}}
#pragma omp task if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if () // expected-error {{expected expression}}
#pragma omp task if (S) // expected-error {{'S' does not refer to a value}}
#pragma omp task if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp task if(argc)
+ #pragma omp task if(argc + z)
#pragma omp task if(task : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if(task : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if(task : argc)
}
int main(int argc, char **argv) {
+int z;
#pragma omp task if // expected-error {{expected '(' after 'if'}}
#pragma omp task if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if () // expected-error {{expected expression}}
#pragma omp task if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if(task : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task if(task : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp task if(task : argc)
+ #pragma omp task if(task : argc + z)
#pragma omp task if(task : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp task'}}
#pragma omp task if(task : argc) if (task:argc) // expected-error {{directive '#pragma omp task' cannot contain more than one 'if' clause with 'task' name modifier}}
#pragma omp task if(task : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp task priority // expected-error {{expected '(' after 'priority'}}
#pragma omp task priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task priority () // expected-error {{expected expression}}
#pragma omp task priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
- #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc] + z)
#pragma omp task priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'priority' clause}}
#pragma omp task priority (S) // expected-error {{'S' does not refer to a value}}
#pragma omp task priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
}
int main(int argc, char **argv) {
+int z;
#pragma omp task priority // expected-error {{expected '(' after 'priority'}}
#pragma omp task priority ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task priority () // expected-error {{expected expression}}
#pragma omp task priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
- #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp task priority (argc > 0 ? argv[1][0] : argv[2][argc] - z)
#pragma omp task priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'priority' clause}}
#pragma omp task priority (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp task priority (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const int da[5] = {0}; // expected-note {{'da' defined here}}
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp task private // expected-error {{expected '(' after 'private'}}
#pragma omp task private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp task private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
#pragma omp task private(argc argv) // expected-error {{expected ',' or ')' in 'private' clause}}
#pragma omp task private(S1) // expected-error {{'S1' does not refer to a value}}
-#pragma omp task private(a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}}
+#pragma omp task private(z, a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 1 {{const-qualified variable without mutable fields cannot be private}} expected-error 2 {{const-qualified variable cannot be private}}
#pragma omp task private(argv[1]) // expected-error {{expected variable name}}
#pragma omp task private(ba) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
#pragma omp task private(ca) // expected-error {{const-qualified variable without mutable fields cannot be private}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
const int da[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp task shared // expected-error {{expected '(' after 'shared'}}
foo();
foo();
#pragma omp task shared(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
foo();
-#pragma omp task shared(argc)
+#pragma omp task shared(argc, z)
foo();
#pragma omp task shared(S1) // expected-error {{'S1' does not refer to a value}}
foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
int foo();
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
foo();
#pragma omp taskgroup task_reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
foo();
-#pragma omp taskgroup task_reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+#pragma omp taskgroup task_reduction(+ : o, z) // expected-error 2 {{no viable overloaded '='}}
foo();
#pragma omp parallel private(k)
#pragma omp taskgroup task_reduction(+ : p), task_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'task_reduction' must reference the same object in all threads}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
foo();
#pragma omp taskgroup task_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
foo();
-#pragma omp taskgroup task_reduction(+ : o) // expected-error {{no viable overloaded '='}}
+#pragma omp taskgroup task_reduction(+ : o, z) // expected-error {{no viable overloaded '='}}
foo();
#pragma omp parallel private(k)
#pragma omp taskgroup task_reduction(+ : p), task_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'task_reduction' must reference the same object in all threads}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
- #pragma omp taskloop collapse (argc
+ #pragma omp taskloop collapse (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp taskloop collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop final // expected-error {{expected '(' after 'final'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop final(argc > 0 ? argv[1] : argv[2])
+#pragma omp taskloop final(argc > 0 ? argv[1] : argv[2] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'final' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop final // expected-error {{expected '(' after 'final'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop final(argc > 0 ? argv[1] : argv[2])
+#pragma omp taskloop final(argc > 0 ? argv[1] : argv[2] - z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop final(foobool(argc)), final(true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'final' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp taskloop firstprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
+#pragma omp taskloop firstprivate(z, e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'grainsize' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop grainsize // expected-error {{expected '(' after 'grainsize'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop grainsize (argc > 0 ? argv[1][0] : argv[2][argc] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop grainsize (foobool(argc)), grainsize (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'grainsize' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp taskloop lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
+#pragma omp taskloop lastprivate(z, e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp taskloop lastprivate(argc)
+#pragma omp taskloop lastprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp taskloop'}}
#pragma omp taskloop
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'num_tasks' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'num_tasks' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop priority // expected-error {{expected '(' after 'priority'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'priority' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop priority // expected-error {{expected '(' after 'priority'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop priority (argc > 0 ? argv[1][0] : argv[2][argc] - z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop priority (foobool(argc)), priority (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'priority' clause}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp taskloop private(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp taskloop private(e, g)
+#pragma omp taskloop private(e, g, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp taskloop private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp taskloop private(j)
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp taskloop private(i)
+#pragma omp taskloop private(i, z)
for (int k = 0; k < argc; ++k)
++k;
static int si;
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp taskloop reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp taskloop reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp taskloop reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop reduction(&& : argc)
+#pragma omp taskloop reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop simd final // expected-error {{expected '(' after 'final'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop simd final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+#pragma omp taskloop simd final(argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd final(argc > 0 ? argv[1] : argv[2])
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop simd final // expected-error {{expected '(' after 'final'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd final(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop simd final(argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+#pragma omp taskloop simd final(z+argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd final(argc > 0 ? argv[1] : argv[2])
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
C g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp taskloop simd firstprivate(argv[1]) // expected-error {{expected variable name}}
+#pragma omp taskloop simd firstprivate(z, argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop simd firstprivate // expected-error {{expected '(' after 'firstprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp taskloop simd firstprivate(argc)
+#pragma omp taskloop simd firstprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+ #pragma omp taskloop simd grainsize (z + argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop simd grainsize // expected-error {{expected '(' after 'grainsize'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd grainsize (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd grainsize (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+ #pragma omp taskloop simd grainsize (argc+z)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd grainsize (argc > 0 ? argv[1][0] : argv[2][argc])
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp taskloop simd in_reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskgroup task_reduction(|:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
-#pragma omp taskloop simd in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp taskgroup task_reduction(|:z) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp taskloop simd in_reduction(| : z, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd in_reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp taskloop simd in_reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskgroup task_reduction(&&:argc)
-#pragma omp taskloop simd in_reduction(&& : argc)
+#pragma omp taskgroup task_reduction(&&:argc, z)
+#pragma omp taskloop simd in_reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd in_reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
-#pragma omp taskloop simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp taskloop simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp parallel
#pragma omp taskloop simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-#pragma omp taskloop simd lastprivate(argc)
+#pragma omp taskloop simd lastprivate(argc, z)
for (i = 0; i < argc; ++i)
foo();
#pragma omp parallel
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
template<class I, class C> int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop simd linear // expected-error {{expected '(' after 'linear'}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear(ref(e, g)) // expected-error 2 {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'ref'}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp taskloop simd linear(h) // expected-error {{threadprivate or thread local variable cannot be linear}}
+ #pragma omp taskloop simd linear(h, z) // expected-error {{threadprivate or thread local variable cannot be linear}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear(uval(i)) // expected-error {{variable of non-reference type 'int' can be used only with 'val' modifier, but used with 'uval'}}
for (int k = 0; k < argc; ++k) ++k;
S4 e(4); // expected-note {{'e' defined here}}
S5 g(5); // expected-note {{'g' defined here}}
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop simd linear(f) linear(f) // expected-error {{linear variable cannot be linear}} expected-note {{defined as linear}}
for (int k = 0; k < argc; ++k) ++k;
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k) ++k;
- #pragma omp taskloop simd linear (argc)
+ #pragma omp taskloop simd linear (argc, z)
for (int k = 0; k < argc; ++k) ++k;
#pragma omp taskloop simd linear (S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k) ++k;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -triple x86_64-unknown-unknown -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -triple x86_64-unknown-unknown -verify %s -Wuninitialized
// expected-error@+1 {{unexpected OpenMP directive '#pragma omp taskloop simd'}}
#pragma omp taskloop simd
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] + z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'num_tasks' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
+ #pragma omp taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc] - z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'num_tasks' clause}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
+ T z;
#pragma omp taskloop simd priority // expected-error {{expected '(' after 'priority'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+ #pragma omp taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
}
int main(int argc, char **argv) {
+ int z;
#pragma omp taskloop simd priority // expected-error {{expected '(' after 'priority'}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd priority (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 0; i < 10; ++i)
foo();
- #pragma omp taskloop simd priority (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
+ #pragma omp taskloop simd priority (argc + z)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd priority (argc > 0 ? argv[1][0] : argv[2][argc])
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
int foomain(I argc, C **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp taskloop simd private(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp taskloop simd private(e, g)
+#pragma omp taskloop simd private(e, g, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp taskloop simd private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0); // expected-note {{in instantiation of member function 'S6<float>::S6' requested here}}
S7<S6<float> > s7(0.0) , s7_0(1.0);
- int i;
+ int i, z;
int &j = i;
#pragma omp taskloop simd private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
#pragma omp taskloop simd private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
-#pragma omp taskloop simd private(argc)
+#pragma omp taskloop simd private(argc, z)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp taskloop simd private(S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
typedef void **omp_allocator_handle_t;
extern const omp_allocator_handle_t omp_default_mem_alloc;
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp taskloop simd reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop simd reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}}
+#pragma omp taskloop simd reduction(* : z, ca) // expected-error {{const-qualified variable cannot be reduction}}
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp taskloop simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int i = 0; i < 10; ++i)
foo();
-#pragma omp taskloop simd reduction(&& : argc)
+#pragma omp taskloop simd reduction(&& : argc, z)
for (int i = 0; i < 10; ++i)
foo();
#pragma omp taskloop simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
// expected-error@+3 {{expected ')'}} expected-note@+3 {{to match this '('}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
// expected-note@+1 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
- #pragma omp taskloop simd simdlen (argc
+ #pragma omp taskloop simd simdlen (argc
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+1 {{argument to 'simdlen' clause must be a strictly positive integer value}}
#pragma omp taskloop simd simdlen (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
template <class T>
T tmain(T argc) {
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
template <class T>
T tmain(T argc) {
-// RUN: %clang_cc1 -verify -fopenmp -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11 -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11 -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target
#pragma omp teams distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute dist_schedule (static), dist_schedule (static, 1<<z) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute firstprivate(ba)
+#pragma omp teams distribute firstprivate(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp teams distribute num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute num_teams(argc + argc)
+#pragma omp teams distribute num_teams(argc + argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target
#pragma omp teams distribute num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'num_teams' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute num_teams (argc + argc)
+#pragma omp teams distribute num_teams (argc + argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11 -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11 -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target
#pragma omp teams distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute parallel for dist_schedule (static), dist_schedule (static, 1+z) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute parallel for dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute parallel for dist_schedule (static), dist_schedule (static, z+1) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for firstprivate(da)
+#pragma omp teams distribute parallel for firstprivate(da, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target
#pragma omp teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for if(argc)
+#pragma omp teams distribute parallel for if(argc+z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for if(parallel : argc)
+#pragma omp teams distribute parallel for if(parallel : argc + z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp teams distribute parallel for'}}
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute parallel for num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp teams distribute parallel for num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for num_teams(argc + argc)
+#pragma omp teams distribute parallel for num_teams(argc + argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target
#pragma omp teams distribute parallel for num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'num_teams' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute parallel for num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for num_teams (argc + argc)
+#pragma omp teams distribute parallel for num_teams (argc + argc - z)
for (int i=0; i<100; i++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp teams distribute parallel for reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp teams distribute parallel for reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp teams distribute parallel for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
+#pragma omp teams distribute parallel for reduction(^ : z, fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N, int ST> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
+ T k;
// expected-error@+2 {{expected '(' after 'schedule'}}
#pragma omp target
#pragma omp teams distribute parallel for schedule
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target
-#pragma omp teams distribute parallel for schedule (dynamic, 1)
+#pragma omp teams distribute parallel for schedule (dynamic, k)
for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST];
// expected-error@+2 {{argument to 'schedule' clause must be a strictly positive integer value}}
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11 -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++98 -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -std=c++11 -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target
#pragma omp teams distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1*z) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute parallel for simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute parallel for simd dist_schedule (static), dist_schedule (static, z>>1) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, z;
int &j = i;
#pragma omp target
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd firstprivate(ba)
+#pragma omp teams distribute parallel for simd firstprivate(ba, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, class S> // expected-note {{declared here}}
int tmain(T argc, S **argv) {
- T i;
+ T i, z;
#pragma omp target
#pragma omp teams distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for simd if (argc > 0 ? argv[1] : argv[2])
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'if' clause}}
+#pragma omp teams distribute parallel for simd if (foobool(argc)*z), if (true) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'if' clause}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if (S) // expected-error {{'S' does not refer to a value}}
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target
#pragma omp teams distribute parallel for simd if // expected-error {{expected '(' after 'if'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
+#pragma omp teams distribute parallel for simd if (argc/z)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd if (argc > 0 ? argv[1] : argv[2])
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams distribute parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute parallel for simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp teams distribute parallel for simd lastprivate(z, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams distribute parallel for simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd lastprivate(argc)
+#pragma omp teams distribute parallel for simd lastprivate(argc, z)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T k;
#pragma omp target
#pragma omp teams distribute parallel for simd num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp teams distribute parallel for simd num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd num_teams(argc + argc)
+#pragma omp teams distribute parallel for simd num_teams(argc + k)
for (int i=0; i<100; i++) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'num_teams' clause}}
}
int main(int argc, char **argv) {
+ int k;
#pragma omp target
#pragma omp teams distribute parallel for simd num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd num_teams (argc + argc)
+#pragma omp teams distribute parallel for simd num_teams (argc + k)
for (int i=0; i<100; i++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
void foo() {
}
template <class T, typename S, int N> // expected-note {{declared here}}
T tmain(T argc, S **argv) {
- T i;
+ T i, k;
#pragma omp target
#pragma omp teams distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
+#pragma omp teams distribute parallel for simd num_threads (k)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd num_threads ((argc > 0) ? argv[1] : argv[2]) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'char *'}}
}
int main(int argc, char **argv) {
- int i;
+ int i, k;
#pragma omp target
#pragma omp teams distribute parallel for simd num_threads // expected-error {{expected '(' after 'num_threads'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp teams distribute parallel for simd num_threads (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd num_threads (argc)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
+#pragma omp teams distribute parallel for simd num_threads (k)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd num_threads (argc > 0 ? argv[1] : argv[2]) // expected-error {{integral }}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
public:
S4(int v):a(v) { }
};
-class S5 {
+class S5 {
int a;
S5():a(0) {} // expected-note {{implicitly declared private here}}
public:
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp teams distribute parallel for simd reduction(^ : T) // expected-error {{'T' does not refer to a value}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp teams distribute parallel for simd reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp teams distribute parallel for simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd reduction(&& : argc)
+#pragma omp teams distribute parallel for simd reduction(&& : argc, z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute parallel for simd thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp teams distribute parallel for simd thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd thread_limit(argc + argc)
+#pragma omp teams distribute parallel for simd thread_limit(argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for simd thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute parallel for simd' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute parallel for simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for simd thread_limit (argc + argc)
+#pragma omp teams distribute parallel for simd thread_limit (argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute parallel for thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp teams distribute parallel for thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for thread_limit(argc + argc)
+#pragma omp teams distribute parallel for thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute parallel for thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute parallel for' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute parallel for thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute parallel for thread_limit (argc + argc)
+#pragma omp teams distribute parallel for thread_limit (argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp teams distribute reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
+#pragma omp teams distribute reduction(min : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp teams distribute reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute reduction(+ : fl)
+#pragma omp teams distribute reduction(+ : fl, z)
for (int j=0; j<100; j++) foo();
static int m;
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -verify -fopenmp-simd %s -Wuninitialized
struct B {
static int ib[20]; // expected-note 0 {{'B::ib' declared here}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo();
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
void foo() {
}
T b = argc, c, d, e, f, g;
char ** argv;
static T a;
-// CHECK: static T a;
+ T z;
#pragma omp target
#pragma omp teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, z) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}
for (int i = 0; i < 10; ++i) foo();
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, 1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
+#pragma omp teams distribute simd dist_schedule (static), dist_schedule (static, 1 + z) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'dist_schedule' clause}}
for (int i = 0; i < 10; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
S4 e(4);
S5 g(5);
S6 p;
- int i;
+ int i, k;
int &j = i;
#pragma omp target
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute simd firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}}
+#pragma omp teams distribute simd firstprivate (k, a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} expected-error {{incomplete type 'S1' where a complete type is required}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
int foomain(int argc, char **argv) {
I e(4);
I g(5);
- int i;
+ int i, k;
int &j = i;
#pragma omp target
#pragma omp teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
-#pragma omp teams distribute simd lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
+#pragma omp teams distribute simd lastprivate(k, a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k) ++k;
#pragma omp target
S5 g(5);
S3 m;
S6 n(2);
- int i;
+ int i, k;
int &j = i;
#pragma omp target
#pragma omp teams distribute simd lastprivate // expected-error {{expected '(' after 'lastprivate'}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-#pragma omp teams distribute simd lastprivate(ba)
+#pragma omp teams distribute simd lastprivate(ba, k)
for (i = 0; i < argc; ++i) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
namespace X {
-// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fopenmp-simd -x c++ -std=c++11 -fexceptions -fcxx-exceptions -verify %s -Wuninitialized
class S {
int a;
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute simd num_teams(C)
for (int i=0; i<100; i++) foo();
#pragma omp teams distribute simd num_teams(argc + argc)
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute simd num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'num_teams' clause}}
+#pragma omp teams distribute simd num_teams(argc + z), num_teams (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'num_teams' clause}}
for (int i=0; i<100; i++) foo();
#pragma omp target
#pragma omp teams distribute simd num_teams(S1) // expected-error {{'S1' does not refer to a value}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
for (int i=0; i<100; i++) foo();
for (int i=0; i<100; i++) foo();
#pragma omp target
-#pragma omp teams distribute simd num_teams (argc + argc)
+#pragma omp teams distribute simd num_teams (argc + argc + z)
for (int i=0; i<100; i++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
public:
S4(int v):a(v) { }
};
-class S5 {
+class S5 {
int a;
S5():a(0) {} // expected-note {{implicitly declared private here}}
public:
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp teams distribute simd reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute simd reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
+#pragma omp teams distribute simd reduction(+ : z, o) // expected-error 2 {{no viable overloaded '='}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 4 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp teams distribute simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute simd reduction(&& : argc)
+#pragma omp teams distribute simd reduction(&& : argc, z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams distribute simd shared // expected-error {{expected '(' after 'shared'}}
#pragma omp teams distribute simd shared(da)
for (int j=0; j<100; j++) foo();
#pragma omp target
- #pragma omp teams distribute simd shared(e, g)
+ #pragma omp teams distribute simd shared(e, g, z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute simd shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
-// RUN: %clang_cc1 -verify -fopenmp %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 %s -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute simd thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp teams distribute simd thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute simd thread_limit(argc + argc)
+#pragma omp teams distribute simd thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute simd thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute simd' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute simd thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute simd thread_limit (argc + argc)
+#pragma omp teams distribute simd thread_limit (argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams distribute thread_limit(C)
for (int j=0; j<100; j++) foo();
#pragma omp teams distribute thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute thread_limit(argc + argc)
+#pragma omp teams distribute thread_limit(argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams distribute' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams distribute thread_limit // expected-error {{expected '(' after 'thread_limit'}}
for (int j=0; j<100; j++) foo();
for (int j=0; j<100; j++) foo();
#pragma omp target
-#pragma omp teams distribute thread_limit (argc + argc)
+#pragma omp teams distribute thread_limit (argc + argc + z)
for (int j=0; j<100; j++) foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const int da[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams firstprivate // expected-error {{expected '(' after 'firstprivate'}}
#pragma omp teams firstprivate(argv[1]) // expected-error {{expected variable name}}
foo();
#pragma omp target
-#pragma omp teams firstprivate(ba)
+#pragma omp teams firstprivate(ba, z)
foo();
#pragma omp target
#pragma omp teams firstprivate(ca)
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wuninitialized
void foo() {
}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams num_teams(C)
foo();
#pragma omp teams num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
#pragma omp target
-#pragma omp teams num_teams(argc + argc)
+#pragma omp teams num_teams(argc + argc+z)
foo();
#pragma omp target
#pragma omp teams num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp teams' cannot contain more than one 'num_teams' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams num_teams // expected-error {{expected '(' after 'num_teams'}}
foo();
foo();
#pragma omp target
-#pragma omp teams num_teams (argc + argc)
+#pragma omp teams num_teams (argc + argc-z)
foo();
#pragma omp target
-// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
-// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-target
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -o - %s -Wno-openmp-target -Wuninitialized
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -o - %s -Wno-openmp-target -Wuninitialized
extern int omp_default_mem_alloc;
void foo() {
const T d = T(); // expected-note 4 {{'d' defined here}}
const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
T qa[5] = {T()};
- T i;
+ T i, z;
T &j = i; // expected-note 4 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
#pragma omp teams reduction(^ : T) // expected-error {{'T' does not refer to a value}}
foo();
#pragma omp target
-#pragma omp teams reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
+#pragma omp teams reduction(+ : z, a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}}
foo();
#pragma omp target
#pragma omp teams reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be reduction}}
int qa[5] = {0};
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i; // expected-note 2 {{'j' defined here}}
S3 &p = k; // expected-note 2 {{'p' defined here}}
const int &r = da[i]; // expected-note {{'r' defined here}}
#pragma omp teams reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
foo();
#pragma omp target
-#pragma omp teams reduction(+ : o) // expected-error {{no viable overloaded '='}}
+#pragma omp teams reduction(+ : z, o) // expected-error {{no viable overloaded '='}}
foo();
#pragma omp target
#pragma omp teams private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
-// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp %s -Wno-openmp-target -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target
+// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wno-openmp-target -Wuninitialized
void foo() {
}
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
- int i;
+ int i, z;
int &j = i;
#pragma omp target
#pragma omp teams shared // expected-error {{expected '(' after 'shared'}}
#pragma omp teams shared(da)
foo();
#pragma omp target
- #pragma omp teams shared(e, g)
+ #pragma omp teams shared(e, g, z)
foo();
#pragma omp target
#pragma omp teams shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
-// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s
+// RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
template <typename T, int C> // expected-note {{declared here}}
T tmain(T argc) {
char **a;
+ T z;
#pragma omp target
#pragma omp teams thread_limit(C)
foo();
#pragma omp teams thread_limit(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
foo();
#pragma omp target
-#pragma omp teams thread_limit(argc + argc)
+#pragma omp teams thread_limit(argc + argc + z)
foo();
#pragma omp target
#pragma omp teams thread_limit(argc), thread_limit (argc+1) // expected-error {{directive '#pragma omp teams' cannot contain more than one 'thread_limit' clause}}
}
int main(int argc, char **argv) {
+ int z;
#pragma omp target
#pragma omp teams thread_limit // expected-error {{expected '(' after 'thread_limit'}}
foo();
foo();
#pragma omp target
-#pragma omp teams thread_limit (argc + argc)
+#pragma omp teams thread_limit (argc + argc - z)
foo();
#pragma omp target