brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 794681c Raw
124 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized2 3// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized4 5void foo() {6}7 8bool foobool(int argc) {9  return argc;10}11 12struct S1; // expected-note {{declared here}} expected-note {{declared here}}13 14template <class T, int N>15T tmain(T argc) {16  T b = argc, c, d, e, f, g;17  char ** argv;18  static T a;19  T z;20 21#pragma omp target22#pragma omp teams23#pragma omp distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}24  for (int i = 0; i < 10; ++i) foo();25 26#pragma omp target27#pragma omp teams28#pragma omp distribute simd dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}29  for (int i = 0; i < 10; ++i) foo();30 31#pragma omp target32#pragma omp teams33#pragma omp distribute simd dist_schedule () // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}}34  for (int i = 0; i < 10; ++i) foo();35 36#pragma omp target37#pragma omp teams38#pragma omp distribute simd dist_schedule (static // expected-error {{expected ')'}} expected-note {{to match this '('}}39  for (int i = 0; i < 10; ++i) foo();40 41#pragma omp target42#pragma omp teams43#pragma omp distribute simd dist_schedule (static, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}44  for (int i = 0; i < 10; ++i) foo();45 46#pragma omp target47#pragma omp teams48#pragma omp distribute simd dist_schedule (argc)) // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-warning {{extra tokens at the end of '#pragma omp distribute simd' are ignored}}49  for (int i = 0; i < 10; ++i) foo();50 51#pragma omp target52#pragma omp teams53#pragma omp distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error2 {{expression must have integral or unscoped enumeration type, not 'char *'}}54  for (int i = 0; i < 10; ++i) foo();55 56#pragma omp target57#pragma omp teams58#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}}59  for (int i = 0; i < 10; ++i) foo();60#pragma omp target61#pragma omp teams62#pragma omp distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}63  for (int i = 0; i < 10; ++i) foo();64#pragma omp target65#pragma omp teams66#pragma omp distribute simd dist_schedule (static, argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error3 {{expression must have integral or unscoped enumeration type, not 'char *'}}67  for (int i = 0; i < 10; ++i) foo();68  return T();69}70 71int main(int argc, char **argv) {72  int z;73#pragma omp target74#pragma omp teams75#pragma omp distribute simd dist_schedule // expected-error {{expected '(' after 'dist_schedule'}}76  for (int i = 0; i < 10; ++i) foo();77 78#pragma omp target79#pragma omp teams80#pragma omp distribute simd dist_schedule ( // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-error {{expected ')'}} expected-note {{to match this '('}}81  for (int i = 0; i < 10; ++i) foo();82 83#pragma omp target84#pragma omp teams85#pragma omp distribute simd dist_schedule () // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}}86  for (int i = 0; i < 10; ++i) foo();87 88#pragma omp target89#pragma omp teams90#pragma omp distribute simd dist_schedule (static // expected-error {{expected ')'}} expected-note {{to match this '('}}91  for (int i = 0; i < 10; ++i) foo();92 93#pragma omp target94#pragma omp teams95#pragma omp distribute simd dist_schedule (static, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}96  for (int i = 0; i < 10; ++i) foo();97 98#pragma omp target99#pragma omp teams100#pragma omp distribute simd dist_schedule (argc)) // expected-error {{expected 'static' in OpenMP clause 'dist_schedule'}} expected-warning {{extra tokens at the end of '#pragma omp distribute simd' are ignored}}101  for (int i = 0; i < 10; ++i) foo();102 103#pragma omp target104#pragma omp teams105#pragma omp distribute simd dist_schedule (static, argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}106  for (int i = 0; i < 10; ++i) foo();107 108#pragma omp target109#pragma omp teams110#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}}111  for (int i = 0; i < 10; ++i) foo();112 113#pragma omp target114#pragma omp teams115#pragma omp distribute simd dist_schedule (static, S1) // expected-error {{'S1' does not refer to a value}}116  for (int i = 0; i < 10; ++i) foo();117 118#pragma omp target119#pragma omp teams120#pragma omp distribute simd dist_schedule (static, argv[1]=2) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}} expected-error {{expected ')'}} expected-note {{to match this '('}}121  for (int i = 0; i < 10; ++i) foo();122  return (tmain<int, 5>(argc) + tmain<char, 1>(argv[0][0])); // expected-note {{in instantiation of function template specialization 'tmain<int, 5>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<char, 1>' requested here}}123}124