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
52 lines
2.8 KiB
C
52 lines
2.8 KiB
C
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
// Test checks that 'mode' attribute is handled correctly with enums, i. e. code
|
|
// 1. "typedef enum { A } __attribute__((mode(HI))) T;" is accepted,
|
|
// 2. "enum X __attribute__((mode(QI))) var;" forms a complete integer type.
|
|
// 3. "enum { A } __attribute__((mode(V4SI))) var;" is not accepted (vector mode).
|
|
|
|
typedef enum { E4 } EnumType;
|
|
|
|
int main(void) {
|
|
// Vector mode are not allowed with enums.
|
|
typedef enum { E1 } __attribute__((mode(V4QI))) RejectedType1; // expected-error{{mode 'V4QI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{specifying vector types with the 'mode' attribute is deprecated}}
|
|
typedef enum __attribute__((mode(V8HI))) { E2 } RejectedType2; // expected-error{{mode 'V8HI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{deprecated}}
|
|
typedef enum E3 __attribute__((mode(V2SI))) RejectedType3; // expected-error{{mode 'V2SI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{deprecated}}
|
|
typedef EnumType __attribute__((mode(V4DI))) RejectedType4; // expected-error{{mode 'V4DI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{deprecated}}
|
|
EnumType v1 __attribute__((mode(V4QI))); // expected-error{{mode 'V4QI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{deprecated}}
|
|
enum __attribute__((mode(V8HI))) { E5 } v2; // expected-error{{mode 'V8HI' is not supported for enumeration types}}
|
|
// expected-warning@-1{{deprecated}}
|
|
|
|
// Incomplete enums without mode attribute are not allowed.
|
|
typedef enum Y IncompleteYType; // expected-note{{forward declaration of 'enum Y'}}
|
|
|
|
enum X a1; // expected-error{{variable has incomplete type 'enum X'}}
|
|
// expected-note@-1{{forward declaration of 'enum X'}}
|
|
IncompleteYType a2; // expected-error{{variable has incomplete type 'IncompleteYType' (aka 'enum Y')}}
|
|
|
|
// OK with 'mode' attribute.
|
|
typedef enum Y __attribute__((mode(QI))) CompleteYType1;
|
|
typedef enum Y CompleteYType2 __attribute__((mode(HI)));
|
|
typedef enum { A1, B1 } __attribute__((mode(QI))) CompleteType3;
|
|
typedef enum { A2, B2 } CompleteType4 __attribute__((mode(QI)));
|
|
typedef enum __attribute__((mode(QI))) { A3, B3 } CompleteType5;
|
|
|
|
enum X __attribute__((mode(QI))) a3;
|
|
enum X a4 __attribute__((mode(HI)));
|
|
IncompleteYType __attribute__((mode(QI))) a5;
|
|
IncompleteYType a6 __attribute__((mode(HI)));
|
|
CompleteYType1 a7;
|
|
CompleteYType2 a8;
|
|
CompleteType3 a9;
|
|
CompleteType4 a10;
|
|
CompleteType5 a11;
|
|
enum __attribute__((mode(QI))) { A4, B4 } a12;
|
|
|
|
return 0;
|
|
}
|