llvm-project/clang/test/Sema/attr-target-version-unsupported.c
Piyou Chen 7d8d51ed34
Recommit "[TargetVersion] Only enable on RISC-V and AArch64" (#117110)" (#117128)
Remain InheritableAttr to avoid the warning `TypePrinter.cpp:1953:10:
warning: enumeration value ‘TargetVersion’ not handled in switch`

origin messenge

[TargetVersion] Only enable on RISC-V and AArch64 (#115991) Address
#115000.

This patch constrains the target_version feature to work only on RISC-V
and AArch64 to prevent crashes in Clang.

Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2024-11-25 17:10:50 +08:00

5 lines
212 B
C

// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
//expected-warning@+1 {{unknown attribute 'target_version' ignored}}
int __attribute__((target_version("aes"))) foo(void) { return 3; }