llvm-project

Форк
0
/
parse-clauses.cpp 
97 строк · 4.1 Кб
1
// RUN: %clang_cc1 %s -verify -fopenacc
2

3
template<unsigned I, typename T>
4
void templ() {
5
  // expected-warning@+1{{OpenACC clause 'collapse' not yet implemented, clause ignored}}
6
#pragma acc loop collapse(I)
7
  for(;;){}
8

9
  // expected-warning@+1{{OpenACC clause 'collapse' not yet implemented, clause ignored}}
10
#pragma acc loop collapse(T::value)
11
  for(;;){}
12

13
#pragma acc parallel vector_length(T::value)
14
  for(;;){}
15

16
#pragma acc parallel vector_length(I)
17
  for(;;){}
18

19
#pragma acc parallel async(T::value)
20
  for(;;){}
21

22
#pragma acc parallel async(I)
23
  for(;;){}
24

25
#pragma acc parallel async
26
  for(;;){}
27
}
28

29
struct S {
30
  static constexpr unsigned value = 5;
31
};
32

33
void use() {
34
  templ<7, S>();
35
}
36

37
namespace NS {
38
void NSFunc();
39

40
class RecordTy { // #RecTy
41
  static constexpr bool Value = false; // #VAL
42
  void priv_mem_function(); // #PrivMemFun
43
  public:
44
  static constexpr bool ValuePub = true;
45
  void mem_function();
46
};
47
template<typename T>
48
class TemplTy{};
49
void function();
50
}
51

52

53
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
54
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
55
#pragma acc routine(use) bind(NS::NSFunc)
56
  // expected-error@+3{{'RecordTy' does not refer to a value}}
57
  // expected-note@#RecTy{{declared here}}
58
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
59
#pragma acc routine(use) bind(NS::RecordTy)
60
  // expected-error@+4{{'Value' is a private member of 'NS::RecordTy'}}
61
  // expected-note@#VAL{{implicitly declared private here}}
62
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
63
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
64
#pragma acc routine(use) bind(NS::RecordTy::Value)
65
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
66
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
67
#pragma acc routine(use) bind(NS::RecordTy::ValuePub)
68
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
69
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
70
#pragma acc routine(use) bind(NS::TemplTy<int>)
71
  // expected-error@+2{{no member named 'unknown' in namespace 'NS'}}
72
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
73
#pragma acc routine(use) bind(NS::unknown<int>)
74
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
75
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
76
#pragma acc routine(use) bind(NS::function)
77
  // expected-error@+4{{'priv_mem_function' is a private member of 'NS::RecordTy'}}
78
  // expected-note@#PrivMemFun{{implicitly declared private here}}
79
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
80
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
81
#pragma acc routine(use) bind(NS::RecordTy::priv_mem_function)
82
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
83
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
84
#pragma acc routine(use) bind(NS::RecordTy::mem_function)
85

86
  // expected-error@+2{{string literal with user-defined suffix cannot be used here}}
87
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
88
#pragma acc routine(use) bind("unknown udl"_UDL)
89

90
  // expected-warning@+3{{encoding prefix 'u' on an unevaluated string literal has no effect}}
91
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
92
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
93
#pragma acc routine(use) bind(u"16 bits")
94
  // expected-warning@+3{{encoding prefix 'U' on an unevaluated string literal has no effect}}
95
  // expected-warning@+2{{OpenACC clause 'bind' not yet implemented, clause ignored}}
96
  // expected-warning@+1{{OpenACC construct 'routine' not yet implemented, pragma ignored}}
97
#pragma acc routine(use) bind(U"32 bits")
98

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.