Files
TheRock/compiler/amd-llvm/clang/test/Sema/PowerPC/builtins-aes-acceleration-error.c
T
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

252 lines
14 KiB
C

// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -target-cpu future \
// RUN: -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -target-cpu future \
// RUN: -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -target-cpu pwr11 \
// RUN: -fsyntax-only -verify=pwr11 %s
// Made with AI
void test_aes_encrypt_paired_invalid_imm(void) {
__vector_pair vp1, vp2;
// Test invalid immediate values (valid range is 0-2)
// expected-error@+2 {{argument value 3 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_encrypt_paired(vp1, vp2, 3);
// expected-error@+2 {{argument value -1 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_encrypt_paired(vp1, vp2, -1);
}
void test_aes_encrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_encrypt_paired(vc, vp, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_encrypt_paired(vp, vc, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type 'int'}}
// pwr11-error@+1 {{'__builtin_aes_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res3 = __builtin_aes_encrypt_paired(vp, vp, vc);
}
void test_aes128_encrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes128 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes128_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes128_encrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes128_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes128_encrypt_paired(vp, vc);
}
void test_aes192_encrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes192 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes192_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes192_encrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes192_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes192_encrypt_paired(vp, vc);
}
void test_aes256_encrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes256 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes256_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes256_encrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes256_encrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes256_encrypt_paired(vp, vc);
}
void test_aes_decrypt_paired_invalid_imm(void) {
__vector_pair vp1, vp2;
// Test invalid immediate values (valid range is 0-2)
// expected-error@+2 {{argument value 3 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_decrypt_paired(vp1, vp2, 3);
// expected-error@+2 {{argument value -1 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_decrypt_paired(vp1, vp2, -1);
}
void test_aes_decrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_decrypt_paired(vc, vp, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_decrypt_paired(vp, vc, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type 'int'}}
// pwr11-error@+1 {{'__builtin_aes_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res3 = __builtin_aes_decrypt_paired(vp, vp, vc);
}
void test_aes128_decrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes128 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes128_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes128_decrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes128_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes128_decrypt_paired(vp, vc);
}
void test_aes192_decrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes192 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes192_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes192_decrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes192_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes192_decrypt_paired(vp, vc);
}
void test_aes256_decrypt_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes256 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes256_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes256_decrypt_paired(vc, vp);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes256_decrypt_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes256_decrypt_paired(vp, vc);
}
void test_aes_genlastkey_paired_invalid_imm(void) {
__vector_pair vp1;
// Test invalid immediate values (valid range is 0-2)
// expected-error@+2 {{argument value 3 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_genlastkey_paired(vp1, 3);
// expected-error@+2 {{argument value -1 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_aes_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_genlastkey_paired(vp1, -1);
}
void test_aes_genlastkey_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes_genlastkey_paired(vc, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type 'int'}}
// pwr11-error@+1 {{'__builtin_aes_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res2 = __builtin_aes_genlastkey_paired(vp, vc);
}
void test_aes128_genlastkey_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes128 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes128_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes128_genlastkey_paired(vc);
}
void test_aes192_genlastkey_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes192 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes192_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes192_genlastkey_paired(vc);
}
void test_aes256_genlastkey_paired_type_mismatch(void) {
__vector_pair vp;
vector unsigned char vc;
// Test type mismatches for aes256 variant
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type '__vector_pair'}}
// pwr11-error@+1 {{'__builtin_aes256_genlastkey_paired' needs target feature future-vector,paired-vector-memops}}
__vector_pair res1 = __builtin_aes256_genlastkey_paired(vc);
}
void test_galois_field_mult_invalid_imm(void) {
vector unsigned char a, b;
// Test invalid immediate values (valid range is 0-1)
// expected-error@+2 {{argument value 2 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_galois_field_mult' needs target feature future-vector}}
vector unsigned char res1 = __builtin_galois_field_mult(a, b, 2);
// expected-error@+2 {{argument value -1 is outside the valid range}}
// pwr11-error@+1 {{'__builtin_galois_field_mult' needs target feature future-vector}}
vector unsigned char res2 = __builtin_galois_field_mult(a, b, -1);
}
void test_galois_field_mult_type_mismatch(void) {
vector unsigned char vc;
__vector_pair vp;
// Test type mismatches
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult' needs target feature future-vector}}
vector unsigned char res1 = __builtin_galois_field_mult(vp, vc, 0);
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult' needs target feature future-vector}}
vector unsigned char res2 = __builtin_galois_field_mult(vc, vp, 0);
// expected-error@+2 {{passing '__vector unsigned char' (vector of 16 'unsigned char' values) to parameter of incompatible type 'int'}}
// pwr11-error@+1 {{'__builtin_galois_field_mult' needs target feature future-vector}}
vector unsigned char res3 = __builtin_galois_field_mult(vc, vc, vc);
}
void test_galois_field_mult_gcm_type_mismatch(void) {
vector unsigned char vc;
__vector_pair vp;
// Test type mismatches for gcm variant
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult_gcm' needs target feature future-vector}}
vector unsigned char res1 = __builtin_galois_field_mult_gcm(vp, vc);
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult_gcm' needs target feature future-vector}}
vector unsigned char res2 = __builtin_galois_field_mult_gcm(vc, vp);
}
void test_galois_field_mult_xts_type_mismatch(void) {
vector unsigned char vc;
__vector_pair vp;
// Test type mismatches for xts variant
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult_xts' needs target feature future-vector}}
vector unsigned char res1 = __builtin_galois_field_mult_xts(vp, vc);
// expected-error@+2 {{passing '__vector_pair' to parameter of incompatible type '__vector unsigned char' (vector of 16 'unsigned char' values)}}
// pwr11-error@+1 {{'__builtin_galois_field_mult_xts' needs target feature future-vector}}
vector unsigned char res2 = __builtin_galois_field_mult_xts(vc, vp);
}