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
94 lines
1.9 KiB
MLIR
94 lines
1.9 KiB
MLIR
// RUN: mlir-opt -verify-diagnostics -split-input-file %s
|
|
|
|
func.func @switch_missing_case_value(%flag : i32, %caseOperand : i32) {
|
|
cf.switch %flag : i32, [
|
|
default: ^bb1(%caseOperand : i32),
|
|
45: ^bb2(%caseOperand : i32),
|
|
// expected-error@+1 {{expected integer value}}
|
|
: ^bb3(%caseOperand : i32)
|
|
]
|
|
|
|
^bb1(%bb1arg : i32):
|
|
return
|
|
^bb2(%bb2arg : i32):
|
|
return
|
|
^bb3(%bb3arg : i32):
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @switch_wrong_type_case_value(%flag : i32, %caseOperand : i32) {
|
|
cf.switch %flag : i32, [
|
|
default: ^bb1(%caseOperand : i32),
|
|
// expected-error@+1 {{expected integer value}}
|
|
"hello": ^bb2(%caseOperand : i32)
|
|
]
|
|
|
|
^bb1(%bb1arg : i32):
|
|
return
|
|
^bb2(%bb2arg : i32):
|
|
return
|
|
^bb3(%bb3arg : i32):
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @switch_missing_comma(%flag : i32, %caseOperand : i32) {
|
|
cf.switch %flag : i32, [
|
|
default: ^bb1(%caseOperand : i32),
|
|
// expected-error@+1 {{expected ']'}}
|
|
45: ^bb2(%caseOperand : i32)
|
|
43: ^bb3(%caseOperand : i32)
|
|
]
|
|
|
|
^bb1(%bb1arg : i32):
|
|
return
|
|
^bb2(%bb2arg : i32):
|
|
return
|
|
^bb3(%bb3arg : i32):
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
func.func @switch_missing_default(%flag : i32, %caseOperand : i32) {
|
|
cf.switch %flag : i32, [
|
|
// expected-error@+1 {{expected 'default'}}
|
|
45: ^bb2(%caseOperand : i32)
|
|
43: ^bb3(%caseOperand : i32)
|
|
]
|
|
|
|
^bb1(%bb1arg : i32):
|
|
return
|
|
^bb2(%bb2arg : i32):
|
|
return
|
|
^bb3(%bb3arg : i32):
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @wrong_weights_number
|
|
func.func @wrong_weights_number(%cond: i1) {
|
|
// expected-error@+1 {{expects number of branch weights to match number of successors: 1 vs 2}}
|
|
cf.cond_br %cond weights([100]), ^bb1, ^bb2
|
|
^bb1:
|
|
return
|
|
^bb2:
|
|
return
|
|
}
|
|
|
|
// -----
|
|
|
|
// CHECK-LABEL: func @zero_weights
|
|
func.func @wrong_total_weight(%cond: i1) {
|
|
// expected-error@+1 {{branch weights cannot all be zero}}
|
|
cf.cond_br %cond weights([0, 0]), ^bb1, ^bb2
|
|
^bb1:
|
|
return
|
|
^bb2:
|
|
return
|
|
}
|