Files
clang-p2996/clang-tools-extra/test/cpp11-migrate/LoopConvert/dependency.cpp
Edwin Vane 31896624da Transferred loop-convert tests to cpp11-migrate
- Turned off -count-only tests as they aren't supported in cpp11-migrate
  yet.
- Updated tests to use new binary name and options to access
  loop-convert transform.
- Fixed header guards to not use restricted names.

Reviewers: klimek, gribozavr
llvm-svn: 171852
2013-01-08 14:36:29 +00:00

27 lines
602 B
C++

// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: cpp11-migrate -loop-convert %t.cpp -- && FileCheck -input-file=%t.cpp %s
void f() {
const int N = 6;
const int M = 8;
int arr[N][M];
for (int i = 0; i < N; ++i) {
int a = 0;
int b = arr[i][a];
}
// CHECK: for (auto & [[VAR:[a-z_]+]] : arr) {
// CHECK-NEXT: int a = 0;
// CHECK-NEXT: int b = [[VAR]][a];
// CHECK-NEXT: }
for (int j = 0; j < M; ++j) {
int a = 0;
int b = arr[a][j];
}
// CHECK: for (int j = 0; j < M; ++j) {
// CHECK-NEXT: int a = 0;
// CHECK-NEXT: int b = arr[a][j];
// CHECK-NEXT: }
}