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
53 lines
3.1 KiB
C++
53 lines
3.1 KiB
C++
// RUN: clang-format -style="{BasedOnStyle: Google, IndentWidth: 8}" %s | FileCheck -strict-whitespace -check-prefix=CHECK1 %s
|
|
// RUN: clang-format -style="{BasedOnStyle: LLVM, IndentWidth: 7}" %s | FileCheck -strict-whitespace -check-prefix=CHECK2 %s
|
|
// RUN: not clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" -fallback-style=LLVM %s 2>&1 | FileCheck -DMSG=%errc_EINVAL -strict-whitespace -check-prefix=CHECK3 %s
|
|
// RUN: not clang-format -style="{lsjd}" %s -fallback-style=LLVM 2>&1 | FileCheck -DMSG=%errc_EINVAL -strict-whitespace -check-prefix=CHECK4 %s
|
|
// RUN: mkdir -p %t
|
|
// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %t/.clang-format
|
|
// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s
|
|
// RUN: printf "Invalid:\n" > %t/.clang-format
|
|
// RUN: not clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -DMSG=%errc_EINVAL -strict-whitespace -check-prefix=CHECK6 %s
|
|
// RUN: rm %t/.clang-format
|
|
// RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %t/_clang-format
|
|
// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK7 %s
|
|
// RUN: clang-format -style="{BasedOnStyle: LLVM, PointerBindsToType: true}" %s | FileCheck -strict-whitespace -check-prefix=CHECK8 %s
|
|
// RUN: clang-format -style="{BasedOnStyle: WebKit, PointerBindsToType: false}" %s | FileCheck -strict-whitespace -check-prefix=CHECK9 %s
|
|
|
|
// Fallback style tests
|
|
// Test config file with no based style, and fallback style "none", formatting is applied
|
|
// RUN: printf "IndentWidth: 6\n" > %t/_clang-format
|
|
// RUN: clang-format -style=file -fallback-style=none -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK10 %s
|
|
// Test yaml with no based style, and fallback style "none", LLVM formatting applied
|
|
// RUN: clang-format -style="{IndentWidth: 7}" -fallback-style=none %s | FileCheck -strict-whitespace -check-prefix=CHECK11 %s
|
|
|
|
// Empty config file tests
|
|
// RUN: touch %t/.clang-format
|
|
// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK12 %s
|
|
// RUN: rm %t/.clang-format
|
|
// RUN: printf "\n" > %t/_clang-format
|
|
// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK13 %s
|
|
|
|
void f() {
|
|
// CHECK1: {{^ int\* i;$}}
|
|
// CHECK2: {{^ int \*i;$}}
|
|
// CHECK3: Unknown value for BasedOnStyle: invalid
|
|
// CHECK3: Error parsing -style: [[MSG]]
|
|
// CHECK4: Error parsing -style: [[MSG]]
|
|
// CHECK5: {{^ int\* i;$}}
|
|
// CHECK6: unknown key 'Invalid'
|
|
// CHECK6: {{^Error reading .*\.clang-format:}} [[MSG]]
|
|
// CHECK7: {{^ int\* i;$}}
|
|
// CHECK8: {{^ int\* i;$}}
|
|
// CHECK9: {{^ int \*i;$}}
|
|
// CHECK10: {{^ int \*i;$}}
|
|
// CHECK11: {{^ int \*i;$}}
|
|
// CHECK12: {{^ int \*i;$}}
|
|
// CHECK13: {{^ int \*i;$}}
|
|
int*i;
|
|
int j;
|
|
}
|
|
|
|
// On Windows, the 'rm' commands fail when the previous process is still alive.
|
|
// This happens enough to make the test useless.
|
|
// UNSUPPORTED: system-windows
|