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
1.9 KiB
TableGen
95 lines
1.9 KiB
TableGen
// RUN: llvm-tblgen %s | FileCheck %s
|
|
// RUN: not llvm-tblgen -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s
|
|
|
|
// Tests for the true and false literals.
|
|
|
|
defvar otherwise = true;
|
|
defvar do_it = true;
|
|
|
|
// CHECK: def rec1
|
|
// CHECK: bit flag1 = 1;
|
|
// CHECK: bit flag2 = 0;
|
|
// CHECK: int true_int = 1;
|
|
|
|
def rec1 {
|
|
bit flag1 = true;
|
|
bit flag2 = false;
|
|
int true_int = true;
|
|
}
|
|
|
|
// CHECK: def rec2_true
|
|
|
|
if true then
|
|
def rec2_true {}
|
|
else
|
|
def rec2_bad {}
|
|
|
|
// CHECK: def rec3_false
|
|
|
|
if false then
|
|
def rec3_bad {}
|
|
else
|
|
def rec3_false {}
|
|
|
|
// CHECK: def rec4
|
|
// CHECK: int value = 52;
|
|
|
|
def rec4 {
|
|
int value = !add(10, !if(!and(do_it, true), 42, 0));
|
|
}
|
|
|
|
// CHECK: def rec5
|
|
// CHECK: string name = "snork";
|
|
|
|
def rec5 {
|
|
string name = !cond(false: "foo",
|
|
!not(do_it): "bar",
|
|
otherwise: "snork");
|
|
}
|
|
|
|
// CHECK: def rec6
|
|
// CHECK: bit xorFF = 0;
|
|
// CHECK: bit xorFT = 1;
|
|
// CHECK: bit xorTF = 1;
|
|
// CHECK: bit xorTT = 0;
|
|
|
|
def rec6 {
|
|
bit xorFF = !xor(false, false);
|
|
bit xorFT = !xor(false, true);
|
|
bit xorTF = !xor(true, false);
|
|
bit xorTT = !xor(true, true);
|
|
}
|
|
|
|
// CHECK: def rec7
|
|
// CHECK: bits<3> flags = { 1, 0, 1 };
|
|
|
|
def rec7 {
|
|
bits<3> flags = { true, false, true };
|
|
}
|
|
|
|
// `!and` and `!or` should be short-circuited such that any of the `!head` or
|
|
// `!tail` on empty list below will never be evaluated.
|
|
// CHECK: def rec8
|
|
// CHECK: bit v = 0;
|
|
// CHECK: int v2 = -1;
|
|
// CHECK: list<int> newSeq = [];
|
|
// CHECK: list<int> newSeq2 = [];
|
|
|
|
class Foo <list<int> seq = []> {
|
|
bit v = !and(false, !head(seq));
|
|
int v2 = !or(-1, !head(seq));
|
|
|
|
bit unresolved = !ne(!find(NAME, "BAR"), -1);
|
|
list<int> newSeq = !if(!and(false, unresolved), !tail(seq), seq);
|
|
list<int> newSeq2 = !if(!or(-1, unresolved), seq, !tail(seq));
|
|
}
|
|
|
|
def rec8 : Foo<>;
|
|
|
|
#ifdef ERROR1
|
|
// ERROR1: Record name '1' is not a string
|
|
|
|
def true {}
|
|
#endif
|
|
|