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
72 lines
2.5 KiB
TableGen
72 lines
2.5 KiB
TableGen
// RUN: llvm-tblgen %s | FileCheck %s
|
|
// RUN: not llvm-tblgen -DERROR_NONLIST %s 2>&1 | FileCheck --check-prefix=ERROR_NONLIST %s
|
|
// RUN: not llvm-tblgen -DERROR_KEYTYPE %s 2>&1 | FileCheck --check-prefix=ERROR_KEYTYPE %s
|
|
|
|
// Sort an already-sorted list — should be a no-op.
|
|
// CHECK-LABEL: def idempotent
|
|
// CHECK: already = ["a", "b", "c"];
|
|
def idempotent {
|
|
list<string> already = !sort(item, ["a", "b", "c"], item);
|
|
}
|
|
|
|
// Sort records by a string field or an int field. The sort is stable, so order
|
|
// is preserved on elements with equal key.
|
|
// CHECK-LABEL: def key_expr
|
|
// CHECK: by_name = [thing_a20, thing_a10, thing_b20, thing_c30, thing_d10];
|
|
// CHECK: by_value = [thing_a10, thing_d10, thing_a20, thing_b20, thing_c30];
|
|
class Thing<string N, int V> {
|
|
string Name = N;
|
|
int Value = V;
|
|
}
|
|
def thing_a10 : Thing<"alpha", 10>;
|
|
def thing_a20 : Thing<"alpha", 20>;
|
|
def thing_b20 : Thing<"beta", 20>;
|
|
def thing_c30 : Thing<"charlie", 30>;
|
|
def thing_d10 : Thing<"delta", 10>;
|
|
defvar Things = [thing_c30, thing_a20, thing_a10, thing_b20, thing_d10];
|
|
def key_expr {
|
|
list<Thing> by_name = !sort(t, Things, t.Name);
|
|
list<Thing> by_value = !sort(t, Things, t.Value);
|
|
}
|
|
|
|
// Sort a single-element list.
|
|
// CHECK-LABEL: def single
|
|
// CHECK: one = ["only"];
|
|
def single {
|
|
list<string> one = !sort(item, ["only"], item);
|
|
}
|
|
|
|
// CHECK-LABEL: def sorted
|
|
// CHECK: sorted_strings = ["axolotl", "barracuda", "cephalopod", "dragonfly"];
|
|
// CHECK: sorted_ints = [1, 2, 3, 5, 8];
|
|
// CHECK: sorted_empty_strings = [];
|
|
// CHECK: sorted_empty_ints = [];
|
|
defvar EmptyStrings = []<string>;
|
|
defvar Creatures = ["cephalopod", "axolotl", "dragonfly", "barracuda"];
|
|
defvar EmptyInts = []<int>;
|
|
defvar Nums = [5, 2, 8, 1, 3];
|
|
def sorted {
|
|
list<string> sorted_strings = !sort(item, Creatures, item);
|
|
list<int> sorted_ints = !sort(n, Nums, n);
|
|
list<string> sorted_empty_strings = !sort(item, EmptyStrings, item);
|
|
list<int> sorted_empty_ints = !sort(n, EmptyInts, n);
|
|
}
|
|
|
|
#ifdef ERROR_NONLIST
|
|
// Dag is not a valid second argument.
|
|
def myop;
|
|
defvar mydag = (myop);
|
|
def err_nonlist {
|
|
// ERROR_NONLIST: sort.td:[[@LINE+1]]:38: error: !sort must have a list argument
|
|
list<string> bad = !sort(x, mydag, !cast<string>(x));
|
|
}
|
|
#endif
|
|
|
|
#ifdef ERROR_KEYTYPE
|
|
// Key that cannot be resolved to int or string leaves the op unfolded.
|
|
// ERROR_KEYTYPE: sort.td:[[@LINE+1]]:5: error: Initializer of 'bad' in 'err_keytype' could not be fully resolved
|
|
def err_keytype {
|
|
list<Thing> bad = !sort(t, Things, t);
|
|
}
|
|
#endif
|