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
95 lines
6.0 KiB
C
95 lines
6.0 KiB
C
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify -std=c2x %s
|
|
// RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -std=c2x %s
|
|
// RUN: %clang_cc1 -triple arm-linux-gnu -fsyntax-only -verify -std=c2x %s
|
|
// RUN: %clang_cc1 -triple powerpc-linux-gnu -fsyntax-only -verify -std=c2x %s
|
|
// RUN: %clang_cc1 -triple ppc64le-linux-gnu -fsyntax-only -verify -std=c2x %s
|
|
|
|
#ifdef __x86_64__
|
|
|
|
int __attribute__((target("avx,sse4.2,arch=ivybridge"))) foo(void) { return 4; }
|
|
//expected-error@+1 {{'target' attribute takes one argument}}
|
|
int __attribute__((target())) bar(void) { return 4; }
|
|
// no warning, tune is supported for x86
|
|
int __attribute__((target("tune=sandybridge"))) baz(void) { return 4; }
|
|
//expected-warning@+1 {{unsupported 'fpmath=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("fpmath=387"))) walrus(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("avx,sse4.2,arch=hiss"))) meow(void) { return 4; }
|
|
//expected-warning@+1 {{unsupported 'woof' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("woof"))) bark(void) { return 4; }
|
|
// no warning, same as saying 'nothing'.
|
|
int __attribute__((target("arch="))) turtle(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("arch=hiss,arch=woof"))) pine_tree(void) { return 4; }
|
|
//expected-warning@+1 {{duplicate 'arch=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("arch=ivybridge,arch=haswell"))) oak_tree(void) { return 4; }
|
|
//expected-warning@+1 {{unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("branch-protection=none"))) birch_tree(void) { return 5; }
|
|
//expected-warning@+1 {{unknown tune CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("tune=hiss,tune=woof"))) apple_tree(void) { return 4; }
|
|
|
|
//expected-warning@+1 {{unsupported 'x86-64' in the 'target' attribute string}}
|
|
void __attribute__((target("x86-64"))) baseline(void) {}
|
|
//expected-warning@+1 {{unsupported 'x86-64-v2' in the 'target' attribute string}}
|
|
void __attribute__((target("x86-64-v2"))) v2(void) {}
|
|
|
|
int __attribute__((target("sha"))) good_target_but_not_for_fmv() { return 5; }
|
|
|
|
#elifdef __aarch64__
|
|
|
|
int __attribute__((target("sve,arch=armv8-a"))) foo(void) { return 4; }
|
|
//expected-error@+1 {{'target' attribute takes one argument}}
|
|
int __attribute__((target())) bar(void) { return 4; }
|
|
// no warning, tune is supported for aarch64
|
|
int __attribute__((target("tune=cortex-a710"))) baz(void) { return 4; }
|
|
//expected-warning@+1 {{unsupported 'fpmath=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("fpmath=387"))) walrus(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("sve,cpu=hiss"))) meow(void) { return 4; }
|
|
// FIXME: We currently have no implementation of isValidFeatureName, so this is not noticed as an error.
|
|
int __attribute__((target("woof"))) bark(void) { return 4; }
|
|
// FIXME: Same
|
|
int __attribute__((target("arch=armv8-a+woof"))) buff(void) { return 4; }
|
|
// FIXME: Same
|
|
int __attribute__((target("+noway"))) noway(void) { return 4; }
|
|
// no warning, same as saying 'nothing'.
|
|
int __attribute__((target("arch="))) turtle(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("cpu=hiss,cpu=woof"))) pine_tree(void) { return 4; }
|
|
//expected-warning@+1 {{duplicate 'arch=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("arch=armv8.1-a,arch=armv8-a"))) oak_tree(void) { return 4; }
|
|
//expected-warning@+1 {{duplicate 'cpu=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("cpu=cortex-a710,cpu=neoverse-n2"))) apple_tree(void) { return 4; }
|
|
//expected-warning@+1 {{duplicate 'tune=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("tune=cortex-a710,tune=neoverse-n2"))) pear_tree(void) { return 4; }
|
|
// no warning - branch-protection should work on aarch64
|
|
int __attribute__((target("branch-protection=none"))) birch_tree(void) { return 5; }
|
|
|
|
#elifdef __powerpc__
|
|
|
|
int __attribute__((target("float128,arch=pwr9"))) foo(void) { return 4; }
|
|
//expected-error@+1 {{'target' attribute takes one argument}}
|
|
int __attribute__((target())) bar(void) { return 4; }
|
|
// no warning, tune is supported for PPC
|
|
int __attribute__((target("tune=pwr8"))) baz(void) { return 4; }
|
|
//expected-warning@+1 {{unsupported 'fpmath=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("fpmath=387"))) walrus(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("float128,cpu=hiss"))) meow(void) { return 4; }
|
|
// no warning, same as saying 'nothing'.
|
|
int __attribute__((target("cpu="))) turtle(void) { return 4; }
|
|
//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("cpu=hiss,cpu=woof"))) pine_tree(void) { return 4; }
|
|
//expected-warning@+1 {{duplicate 'cpu=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("cpu=pwr9,cpu=pwr10"))) oak_tree(void) { return 4; }
|
|
//expected-warning@+1 {{unknown tune CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("tune=hiss,tune=woof"))) apple_tree(void) { return 4; }
|
|
|
|
#else
|
|
|
|
// tune is not supported by other targets.
|
|
//expected-warning@+1 {{unsupported 'tune=' in the 'target' attribute string; 'target' attribute ignored}}
|
|
int __attribute__((target("tune=hiss"))) baz(void) { return 4; }
|
|
|
|
#endif
|