Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from llvm:master #23

Merged
merged 8 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export function activate(context: vscode.ExtensionContext) {
serverOptions, clientOptions);
const semanticHighlightingFeature =
new semanticHighlighting.SemanticHighlightingFeature();
context.subscriptions.push(
vscode.Disposable.from(semanticHighlightingFeature));
clangdClient.registerFeature(semanticHighlightingFeature);
console.log('Clang Language Server is now active!');
context.subscriptions.push(clangdClient.start());
Expand All @@ -133,9 +135,10 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showTextDocument(doc);
}));
const status = new FileStatus();
context.subscriptions.push(vscode.Disposable.from(status));
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(
() => { status.updateStatus(); }));
clangdClient.onDidChangeState(({newState}) => {
context.subscriptions.push(clangdClient.onDidChangeState(({newState}) => {
if (newState == vscodelc.State.Running) {
// clangd starts or restarts after crash.
clangdClient.onNotification(
Expand All @@ -150,7 +153,7 @@ export function activate(context: vscode.ExtensionContext) {
status.clear();
semanticHighlightingFeature.dispose();
}
})
}));
// An empty place holder for the activate command, otherwise we'll get an
// "command is not registered" error.
context.subscriptions.push(vscode.commands.registerCommand(
Expand Down
3 changes: 0 additions & 3 deletions clang/.gitattributes

This file was deleted.

7 changes: 6 additions & 1 deletion clang/include/clang/AST/OpenMPClause.h
Original file line number Diff line number Diff line change
Expand Up @@ -5025,12 +5025,17 @@ class OMPMapClause final : public OMPMappableExprListClause<OMPMapClause>,
}

child_range used_children() {
if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_tofrom)
return child_range(reinterpret_cast<Stmt **>(varlist_begin()),
reinterpret_cast<Stmt **>(varlist_end()));
return child_range(child_iterator(), child_iterator());
}
const_child_range used_children() const {
return const_child_range(const_child_iterator(), const_child_iterator());
auto Children = const_cast<OMPMapClause *>(this)->used_children();
return const_child_range(Children.begin(), Children.end());
}


static bool classof(const OMPClause *T) {
return T->getClauseKind() == OMPC_map;
}
Expand Down
104 changes: 55 additions & 49 deletions clang/test/Analysis/cfg-openmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ void xxx(int argc) {
// CHECK-NEXT: 4: int rd;
// CHECK-NEXT: 5: int lin;
// CHECK-NEXT: 6: int step;
int x, cond, fp, rd, lin, step;
// CHECK-NEXT: 7: int map;
int x, cond, fp, rd, lin, step, map;
// CHECK-NEXT: [[#ATOM:]]: x
// CHECK-NEXT: [[#ATOM+1]]: [B1.[[#ATOM]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#ATOM+2]]: argc
Expand Down Expand Up @@ -219,10 +220,10 @@ void xxx(int argc) {
: argc) if(cond) firstprivate(fp) reduction(-:rd)
argc = x;
// CHECK-NEXT: [[#TPF:]]:
// CHECK-SAME: [B1.[[#TPF+13]]]
// CHECK-NEXT: [[#TPF+1]]: [B1.[[#TPF+13]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPF+2]]: [B1.[[#TPF+12]]]
// CHECK-NEXT: [[#TPF+3]]: [B1.[[#TPF+12]]] = [B1.[[#TPF+1]]]
// CHECK-SAME: [B1.[[#TPF+14]]]
// CHECK-NEXT: [[#TPF+1]]: [B1.[[#TPF+14]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPF+2]]: [B1.[[#TPF+13]]]
// CHECK-NEXT: [[#TPF+3]]: [B1.[[#TPF+13]]] = [B1.[[#TPF+1]]]
// CHECK-NEXT: [[#TPF+4]]: cond
// CHECK-NEXT: [[#TPF+5]]: [B1.[[#TPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPF+6]]: [B1.[[#TPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
Expand All @@ -231,19 +232,20 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TPF+9]]: lin
// CHECK-NEXT: [[#TPF+10]]: step
// CHECK-NEXT: [[#TPF+11]]: [B1.[[#TPF+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPF+12]]: argc
// CHECK-NEXT: [[#TPF+13]]: x
// CHECK-NEXT: [[#TPF+14]]: #pragma omp target parallel for if(parallel: cond) firstprivate(fp) reduction(max: rd) linear(lin: step)
// CHECK-NEXT: [[#TPF+12]]: map
// CHECK-NEXT: [[#TPF+13]]: argc
// CHECK-NEXT: [[#TPF+14]]: x
// CHECK-NEXT: [[#TPF+15]]: #pragma omp target parallel for if(parallel: cond) firstprivate(fp) reduction(max: rd) linear(lin: step) map(tofrom: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TPF+3]]];
#pragma omp target parallel for if(parallel:cond) firstprivate(fp) reduction(max:rd) linear(lin: step)
#pragma omp target parallel for if(parallel:cond) firstprivate(fp) reduction(max:rd) linear(lin: step) map(map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TPFS:]]:
// CHECK-SAME: [B1.[[#TPFS+13]]]
// CHECK-NEXT: [[#TPFS+1]]: [B1.[[#TPFS+13]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPFS+2]]: [B1.[[#TPFS+12]]]
// CHECK-NEXT: [[#TPFS+3]]: [B1.[[#TPFS+12]]] = [B1.[[#TPFS+1]]]
// CHECK-SAME: [B1.[[#TPFS+14]]]
// CHECK-NEXT: [[#TPFS+1]]: [B1.[[#TPFS+14]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPFS+2]]: [B1.[[#TPFS+13]]]
// CHECK-NEXT: [[#TPFS+3]]: [B1.[[#TPFS+13]]] = [B1.[[#TPFS+1]]]
// CHECK-NEXT: [[#TPFS+4]]: cond
// CHECK-NEXT: [[#TPFS+5]]: [B1.[[#TPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPFS+6]]: [B1.[[#TPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
Expand All @@ -252,29 +254,31 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TPFS+9]]: lin
// CHECK-NEXT: [[#TPFS+10]]: step
// CHECK-NEXT: [[#TPFS+11]]: [B1.[[#TPFS+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TPFS+12]]: argc
// CHECK-NEXT: [[#TPFS+13]]: x
// CHECK-NEXT: [[#TPFS+14]]: #pragma omp target parallel for simd if(target: cond) firstprivate(fp) reduction(*: rd) linear(lin: step)
// CHECK-NEXT: [[#TPFS+12]]: map
// CHECK-NEXT: [[#TPFS+13]]: argc
// CHECK-NEXT: [[#TPFS+14]]: x
// CHECK-NEXT: [[#TPFS+15]]: #pragma omp target parallel for simd if(target: cond) firstprivate(fp) reduction(*: rd) linear(lin: step) map(tofrom: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TPFS+3]]];
#pragma omp target parallel for simd if(target:cond) firstprivate(fp) reduction(*:rd) linear(lin: step)
#pragma omp target parallel for simd if(target:cond) firstprivate(fp) reduction(*:rd) linear(lin: step) map(tofrom:map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TP:]]:
// CHECK-SAME: [B1.[[#TP+10]]]
// CHECK-NEXT: [[#TP+1]]: [B1.[[#TP+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TP+2]]: [B1.[[#TP+9]]]
// CHECK-NEXT: [[#TP+3]]: [B1.[[#TP+9]]] = [B1.[[#TP+1]]]
// CHECK-SAME: [B1.[[#TP+11]]]
// CHECK-NEXT: [[#TP+1]]: [B1.[[#TP+11]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TP+2]]: [B1.[[#TP+10]]]
// CHECK-NEXT: [[#TP+3]]: [B1.[[#TP+10]]] = [B1.[[#TP+1]]]
// CHECK-NEXT: [[#TP+4]]: cond
// CHECK-NEXT: [[#TP+5]]: [B1.[[#TP+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TP+6]]: [B1.[[#TP+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
// CHECK-NEXT: [[#TP+7]]: fp
// CHECK-NEXT: [[#TP+8]]: rd
// CHECK-NEXT: [[#TP+9]]: argc
// CHECK-NEXT: [[#TP+10]]: x
// CHECK-NEXT: [[#TP+11]]: #pragma omp target parallel if(cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TP+9]]: map
// CHECK-NEXT: [[#TP+10]]: argc
// CHECK-NEXT: [[#TP+11]]: x
// CHECK-NEXT: [[#TP+12]]: #pragma omp target parallel if(cond) firstprivate(fp) reduction(+: rd) map(to: map)
// CHECK-NEXT: [B1.[[#TP+3]]];
#pragma omp target parallel if(cond) firstprivate(fp) reduction(+:rd)
#pragma omp target parallel if(cond) firstprivate(fp) reduction(+:rd) map(to:map)
argc = x;
// CHECK-NEXT: [[#TSIMD:]]:
// CHECK-SAME: [B1.[[#TSIMD+13]]]
Expand All @@ -291,10 +295,10 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TSIMD+11]]: [B1.[[#TSIMD+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TSIMD+12]]: argc
// CHECK-NEXT: [[#TSIMD+13]]: x
// CHECK-NEXT: [[#TSIMD+14]]: #pragma omp target simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step)
// CHECK-NEXT: [[#TSIMD+14]]: #pragma omp target simd if(cond) firstprivate(fp) reduction(+: rd) linear(lin: step) map(alloc: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TSIMD+3]]];
#pragma omp target simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step)
#pragma omp target simd if(cond) firstprivate(fp) reduction(+:rd) linear(lin: step) map(alloc:map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TTD:]]:
Expand All @@ -309,10 +313,10 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TTD+8]]: rd
// CHECK-NEXT: [[#TTD+9]]: argc
// CHECK-NEXT: [[#TTD+10]]: x
// CHECK-NEXT: [[#TTD+11]]: #pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TTD+11]]: #pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+: rd) map(release: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TTD+3]]];
#pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+:rd)
#pragma omp target teams distribute if(cond) firstprivate(fp) reduction(+:rd) map(release:map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TTDPF:]]:
Expand All @@ -327,10 +331,10 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TTDPF+8]]: rd
// CHECK-NEXT: [[#TTDPF+9]]: argc
// CHECK-NEXT: [[#TTDPF+10]]: x
// CHECK-NEXT: [[#TTDPF+11]]: #pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TTDPF+11]]: #pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+: rd) map(delete: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TTDPF+3]]];
#pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd)
#pragma omp target teams distribute parallel for if(cond) firstprivate(fp) reduction(+:rd) map(delete:map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TTDPFS:]]:
Expand All @@ -345,45 +349,47 @@ void xxx(int argc) {
// CHECK-NEXT: [[#TTDPFS+8]]: rd
// CHECK-NEXT: [[#TTDPFS+9]]: argc
// CHECK-NEXT: [[#TTDPFS+10]]: x
// CHECK-NEXT: [[#TTDPFS+11]]: #pragma omp target teams distribute parallel for simd if(parallel: cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TTDPFS+11]]: #pragma omp target teams distribute parallel for simd if(parallel: cond) firstprivate(fp) reduction(+: rd) map(from: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TTDPFS+3]]];
#pragma omp target teams distribute parallel for simd if(parallel:cond) firstprivate(fp) reduction(+:rd)
#pragma omp target teams distribute parallel for simd if(parallel:cond) firstprivate(fp) reduction(+:rd) map(from:map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TTDS:]]:
// CHECK-SAME: [B1.[[#TTDS+10]]]
// CHECK-NEXT: [[#TTDS+1]]: [B1.[[#TTDS+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TTDS+2]]: [B1.[[#TTDS+9]]]
// CHECK-NEXT: [[#TTDS+3]]: [B1.[[#TTDS+9]]] = [B1.[[#TTDS+1]]]
// CHECK-SAME: [B1.[[#TTDS+11]]]
// CHECK-NEXT: [[#TTDS+1]]: [B1.[[#TTDS+11]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TTDS+2]]: [B1.[[#TTDS+10]]]
// CHECK-NEXT: [[#TTDS+3]]: [B1.[[#TTDS+10]]] = [B1.[[#TTDS+1]]]
// CHECK-NEXT: [[#TTDS+4]]: cond
// CHECK-NEXT: [[#TTDS+5]]: [B1.[[#TTDS+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TTDS+6]]: [B1.[[#TTDS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
// CHECK-NEXT: [[#TTDS+7]]: fp
// CHECK-NEXT: [[#TTDS+8]]: rd
// CHECK-NEXT: [[#TTDS+9]]: argc
// CHECK-NEXT: [[#TTDS+10]]: x
// CHECK-NEXT: [[#TTDS+11]]: #pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TTDS+9]]: map
// CHECK-NEXT: [[#TTDS+10]]: argc
// CHECK-NEXT: [[#TTDS+11]]: x
// CHECK-NEXT: [[#TTDS+12]]: #pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
// CHECK-NEXT: for (int i = 0; i < 10; ++i)
// CHECK-NEXT: [B1.[[#TTDS+3]]];
#pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+:rd)
#pragma omp target teams distribute simd if(cond) firstprivate(fp) reduction(+:rd) map(map)
for (int i = 0; i < 10; ++i)
argc = x;
// CHECK-NEXT: [[#TT:]]:
// CHECK-SAME: [B1.[[#TT+10]]]
// CHECK-NEXT: [[#TT+1]]: [B1.[[#TT+10]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TT+2]]: [B1.[[#TT+9]]]
// CHECK-NEXT: [[#TT+3]]: [B1.[[#TT+9]]] = [B1.[[#TT+1]]]
// CHECK-SAME: [B1.[[#TT+11]]]
// CHECK-NEXT: [[#TT+1]]: [B1.[[#TT+11]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TT+2]]: [B1.[[#TT+10]]]
// CHECK-NEXT: [[#TT+3]]: [B1.[[#TT+10]]] = [B1.[[#TT+1]]]
// CHECK-NEXT: [[#TT+4]]: cond
// CHECK-NEXT: [[#TT+5]]: [B1.[[#TT+4]]] (ImplicitCastExpr, LValueToRValue, int)
// CHECK-NEXT: [[#TT+6]]: [B1.[[#TT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
// CHECK-NEXT: [[#TT+7]]: fp
// CHECK-NEXT: [[#TT+8]]: rd
// CHECK-NEXT: [[#TT+9]]: argc
// CHECK-NEXT: [[#TT+10]]: x
// CHECK-NEXT: [[#TT+11]]: #pragma omp target teams if(cond) firstprivate(fp) reduction(+: rd)
// CHECK-NEXT: [[#TT+9]]: map
// CHECK-NEXT: [[#TT+10]]: argc
// CHECK-NEXT: [[#TT+11]]: x
// CHECK-NEXT: [[#TT+12]]: #pragma omp target teams if(cond) firstprivate(fp) reduction(+: rd) map(tofrom: map)
// CHECK-NEXT: [B1.[[#TT+3]]];
#pragma omp target teams if(cond) firstprivate(fp) reduction(+:rd)
#pragma omp target teams if(cond) firstprivate(fp) reduction(+:rd) map(tofrom:map)
argc = x;
// CHECK-NEXT: [[#TU:]]: cond
// CHECK-NEXT: [[#TU+1]]: [B1.[[#TU]]] (ImplicitCastExpr, LValueToRValue, int)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Test CF+LF are properly handled along with quoted, multi-line #error
// RUN: %clang_cc1 -DOTHER -print-dependency-directives-minimized-source %s 2>&1 | FileCheck %s

#ifndef TEST
#error "message \
more message \
even more"
#endif

#ifdef OTHER
#include <string>
#endif

// CHECK: #ifdef OTHER
// CHECK-NEXT: #include <string>
// CHECK-NEXT: #endif
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_data_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

void foo() { }

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target data map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

int main(int argc, char **argv) {
int a;
#pragma omp target data // expected-error {{expected at least one 'map' or 'use_device_ptr' clause for '#pragma omp target data'}}
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_enter_data_map_messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// 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

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target enter data map(to: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

int main(int argc, char **argv) {

int r;
Expand Down
8 changes: 8 additions & 0 deletions clang/test/OpenMP/target_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ void foo(int arg) {
}
#else

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}


struct SREF {
int &a;
int b;
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_parallel_for_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target parallel for map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_parallel_for_simd_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target parallel for simd map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_parallel_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target parallel map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_simd_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target simd map(to: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
7 changes: 7 additions & 0 deletions clang/test/OpenMP/target_teams_distribute_map_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target teams distribute map(map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ bool foobool(int argc) {
return argc;
}

void xxx(int argc) {
int map; // expected-note {{initialize the variable 'map' to silence this warning}}
#pragma omp target teams distribute parallel for map(tofrom: map) // expected-warning {{variable 'map' is uninitialized when used here}}
for (int i = 0; i < 10; ++i)
;
}

struct S1; // expected-note 2 {{declared here}}
extern S1 a;
class S2 {
Expand Down
Loading