Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

97 lines
3.0 KiB
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
//===----------------------------------------------------------------------===//
// Baseline: struct with direct incomplete array
//===----------------------------------------------------------------------===//
struct S {
int a[];
};
export void fn(int A) {
// expected-error@+1{{too few initializers in list for type 'S' (expected 1 but found 0)}}
S s = {};
}
//===----------------------------------------------------------------------===//
// Multidimensional arrays with at least one incomplete dimension
//===----------------------------------------------------------------------===//
export void fn_multi_arrays() {
// Incomplete outer dimension
// expected-error@+1{{too few initializers in list for type 'int[][2]' (expected 2 but found 0)}}
int a[][2] = {};
// Incomplete middle dimension
// expected-error@+1{{array has incomplete element type 'int[][3]'}}
int b[2][][3] = {};
// Incomplete inner dimension
// expected-error@+1{{array has incomplete element type 'int[]'}}
int c[2][3][] = {};
}
//===----------------------------------------------------------------------===//
// Struct containing multidimensional incomplete arrays
//===----------------------------------------------------------------------===//
struct S2 {
int m[][4];
};
export void fn_struct_multi() {
// expected-error@+1{{too few initializers in list for type 'S2' (expected 1 but found 0)}}
S2 s = {};
}
//===----------------------------------------------------------------------===//
// Nested structs with incomplete arrays
//===----------------------------------------------------------------------===//
struct Inner {
int x[];
};
struct Outer {
Inner I;
};
export void fn_nested_struct() {
// expected-error@+1{{too few initializers in list for type 'Outer' (expected 1 but found 0)}}
Outer o = {};
}
//===----------------------------------------------------------------------===//
// Base-class inheritance containing incomplete arrays
//===----------------------------------------------------------------------===//
struct Base {
int b[];
};
// expected-error@+1{{base class 'Base' has a flexible array member}}
struct Derived : Base {
int d;
};
export void fn_derived() {
// expected-error@+1{{too few initializers in list for type 'Derived' (expected 1 but found 0)}}
Derived d = {};
}
//===----------------------------------------------------------------------===//
// Deep inheritance chain with incomplete array in base
//===----------------------------------------------------------------------===//
struct Base2 {
int x[];
};
// expected-error@+1{{base class 'Base2' has a flexible array member}}
struct Mid : Base2 {
int y;
};
struct Final : Mid {
int z;
};
export void fn_deep_inheritance() {
// expected-error@+1{{too few initializers in list for type 'Final' (expected 2 but found 0)}}
Final f = {};
}