Author: Fangrui Song Date: 2023-08-25T20:45:45-07:00 New Revision: 9de3b35ac9159d5bae6e6796cb91e4f877a07189
URL: https://github.com/llvm/llvm-project/commit/9de3b35ac9159d5bae6e6796cb91e4f877a07189 DIFF: https://github.com/llvm/llvm-project/commit/9de3b35ac9159d5bae6e6796cb91e4f877a07189.diff LOG: [X86][test] Test that target("x86-64") and cpu_specific(x86_64) attributes are invalid Added: Modified: clang/test/Sema/attr-cpuspecific.c clang/test/Sema/attr-target.c Removed: ################################################################################ diff --git a/clang/test/Sema/attr-cpuspecific.c b/clang/test/Sema/attr-cpuspecific.c index f3d46cf8f1801a..3cd58f49faa5e6 100644 --- a/clang/test/Sema/attr-cpuspecific.c +++ b/clang/test/Sema/attr-cpuspecific.c @@ -181,3 +181,8 @@ int __attribute__((__overloadable__)) __attribute__((cpu_specific(ivybridge))) g // expected-error@+1 {{attribute 'cpu_specific' multiversioning cannot be combined with attribute 'overloadable'}} int __attribute__((__overloadable__)) __attribute__((cpu_specific(atom))) good_overload7(void); int __attribute__((cpu_specific(ivybridge))) good_overload7(int); + +// expected-error@+1 {{invalid option 'x86_64'}} +int __attribute__((cpu_specific(x86_64))) baseline(void); +// expected-error@+1 {{invalid option 'x86_64_v2'}} +int __attribute__((cpu_specific(x86_64_v2))) baseline(void); diff --git a/clang/test/Sema/attr-target.c b/clang/test/Sema/attr-target.c index 653550757bda76..3416a3d0a6ba13 100644 --- a/clang/test/Sema/attr-target.c +++ b/clang/test/Sema/attr-target.c @@ -26,6 +26,11 @@ int __attribute__((target("branch-protection=none"))) birch_tree(void) { return //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) {} + #elifdef __aarch64__ int __attribute__((target("sve,arch=armv8-a"))) foo(void) { return 4; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits