brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 7b27760 Raw
35 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s2 3#pragma clang loop pipeline(disable) /* expected-error {{expected unqualified-id}} */4int main() {5  for (int i = 0; i < 10; ++i)6    ;7}8 9void test(int *List, int Length, int Value) {10  int i = 0;11 12/* expected-error {{invalid argument of type 'double'; expected an integer type}} */ #pragma clang loop pipeline_initiation_interval(1.0)13/* expected-error {{invalid value '0'; must be positive}} */ #pragma clang loop pipeline_initiation_interval(0)14/* expected-error {{invalid value '-1'; must be positive}} */ #pragma clang loop pipeline_initiation_interval(-1)15  for (int i = 0; i < Length; i++) {16    for (int j = 0; j < Length; j++) {17      List[i * Length + j] = Value;18    }19  }20 21#pragma clang loop pipeline(disable) 22/* expected-error {{expected a for, while, or do-while loop to follow '#pragma clang loop'}} */ int j = Length;23#pragma clang loop pipeline_initiation_interval(4)24/* expected-error {{expected a for, while, or do-while loop to follow '#pragma clang loop'}} */ int k = Length;25 26#pragma clang loop pipeline(disable)27#pragma clang loop pipeline_initiation_interval(4) /* expected-error {{incompatible directives 'pipeline(disable)' and 'pipeline_initiation_interval(4)'}} */28  for (int i = 0; i < Length; i++) {29    List[i] = Value;30  }31 32#pragma clang loop pipeline(disable)33/* expected-error {{expected statement}} */ }34 35