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
107 lines
1.9 KiB
C++
107 lines
1.9 KiB
C++
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -Wno-c23-extensions
|
|
// RUN: %clang_cc1 %s -fsyntax-only --embed-dir=%S/Inputs -verify -fexperimental-new-constant-interpreter -Wno-c23-extensions
|
|
// expected-no-diagnostics
|
|
|
|
constexpr int value(int a, int b) {
|
|
return a + b;
|
|
}
|
|
|
|
constexpr int func_call() {
|
|
return value(
|
|
#embed <jk.txt>
|
|
);
|
|
}
|
|
|
|
constexpr int init_list_expr() {
|
|
int vals[] = {
|
|
#embed <jk.txt>
|
|
};
|
|
return value(vals[0], vals[1]);
|
|
}
|
|
|
|
template <int N, int M>
|
|
struct Hurr {
|
|
static constexpr int V1 = N;
|
|
static constexpr int V2 = M;
|
|
};
|
|
|
|
constexpr int template_args() {
|
|
Hurr<
|
|
#embed <jk.txt>
|
|
> H;
|
|
return value(H.V1, H.V2);
|
|
}
|
|
|
|
constexpr int ExpectedValue = 'j' + 'k';
|
|
static_assert(func_call() == ExpectedValue);
|
|
static_assert(init_list_expr() == ExpectedValue);
|
|
static_assert(template_args() == ExpectedValue);
|
|
|
|
static_assert(
|
|
#embed <jk.txt> limit(1) suffix(== 'j')
|
|
);
|
|
|
|
int array[
|
|
#embed <jk.txt> limit(1)
|
|
];
|
|
static_assert(sizeof(array) / sizeof(int) == 'j');
|
|
|
|
constexpr int comma_expr = (
|
|
#embed <jk.txt>
|
|
);
|
|
static_assert(comma_expr == 'k');
|
|
|
|
constexpr int comma_expr_init_list{ (
|
|
#embed <jk.txt> limit(1)
|
|
) };
|
|
static_assert(comma_expr_init_list == 'j');
|
|
|
|
constexpr int paren_init(
|
|
#embed <jk.txt> limit(1)
|
|
);
|
|
static_assert(paren_init == 'j');
|
|
|
|
struct S {
|
|
const char buffer[2] = {
|
|
#embed "jk.txt"
|
|
};
|
|
};
|
|
|
|
constexpr struct S s;
|
|
static_assert(s.buffer[1] == 'k');
|
|
|
|
struct S1 {
|
|
int x, y;
|
|
};
|
|
|
|
struct T {
|
|
int x, y;
|
|
struct S1 s;
|
|
};
|
|
|
|
constexpr struct T t[] = {
|
|
#embed <numbers.txt>
|
|
};
|
|
static_assert(t[0].s.x == '2');
|
|
|
|
constexpr int func(int i, int) { return i; }
|
|
static_assert(
|
|
func(
|
|
#embed <jk.txt>
|
|
) == 'j');
|
|
|
|
template <int N>
|
|
struct ST {};
|
|
|
|
ST<
|
|
#embed <jk.txt> limit(1)
|
|
> st;
|
|
|
|
struct HasCharArray { unsigned char h[10]; };
|
|
struct Wrapper { int a; struct HasCharArray d; };
|
|
constexpr struct Wrapper W = {
|
|
#embed "numbers.txt"
|
|
};
|
|
|
|
static_assert(W.d.h[2] == '3');
|