CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
95 lines
2.3 KiB
C++
95 lines
2.3 KiB
C++
// RUN: cp %s %t
|
|
// RUN: %clang_cc1 -x c++ -Wunused-lambda-capture -Wno-unused-value -std=c++1z -fixit %t
|
|
// RUN: grep -v CHECK %t | FileCheck %s
|
|
|
|
void test() {
|
|
int i = 0;
|
|
int j = 0;
|
|
int k = 0;
|
|
int c = 10;
|
|
int a[c];
|
|
|
|
[i,j] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[i,j] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[&i,j] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[j,&i] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[i,j,k] {};
|
|
// CHECK: [] {};
|
|
[i,j,k] { return i + j; };
|
|
// CHECK: [i,j] { return i + j; };
|
|
[i,j,k] { return j + k; };
|
|
// CHECK: [j,k] { return j + k; };
|
|
[i,j,k] { return i + k; };
|
|
// CHECK: [i,k] { return i + k; };
|
|
[i,j,k] { return i + j + k; };
|
|
// CHECK: [i,j,k] { return i + j + k; };
|
|
[&,i] { return k; };
|
|
// CHECK: [&] { return k; };
|
|
[=,&i] { return k; };
|
|
// CHECK: [=] { return k; };
|
|
[=,&i,&j] { return j; };
|
|
// CHECK: [=,&j] { return j; };
|
|
[=,&i,&j] { return i; };
|
|
// CHECK: [=,&i] { return i; };
|
|
[z = i] {};
|
|
// CHECK: [] {};
|
|
[i,z = i] { return z; };
|
|
// CHECK: [z = i] { return z; };
|
|
[z = i,i] { return z; };
|
|
// CHECK: [z = i] { return z; };
|
|
[&a] {};
|
|
// CHECK: [] {};
|
|
[i,&a] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[&a,i] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
|
|
#define I_MACRO() i
|
|
#define I_REF_MACRO() &i
|
|
[I_MACRO()] {};
|
|
// CHECK: [] {};
|
|
[I_MACRO(),j] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[j,I_MACRO()] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[I_REF_MACRO(),j] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
[j,I_REF_MACRO()] { return j; };
|
|
// CHECK: [j] { return j; };
|
|
|
|
int n = 0;
|
|
[z = (n = i),j] {};
|
|
// CHECK: [z = (n = i)] {};
|
|
[j,z = (n = i)] {};
|
|
// CHECK: [z = (n = i)] {};
|
|
}
|
|
|
|
class ThisTest {
|
|
void test() {
|
|
int i = 0;
|
|
|
|
[this] {};
|
|
// CHECK: [] {};
|
|
[i,this] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[this,i] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[*this] {};
|
|
// CHECK: [] {};
|
|
[*this,i] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[i,*this] { return i; };
|
|
// CHECK: [i] { return i; };
|
|
[*this] { return this; };
|
|
// CHECK: [*this] { return this; };
|
|
[*this,i] { return this; };
|
|
// CHECK: [*this] { return this; };
|
|
[i,*this] { return this; };
|
|
// CHECK: [*this] { return this; };
|
|
}
|
|
};
|