mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 06:56:44 +00:00

The spurious -Wunused-function warning issue for `target_version` #80227 also applied to `__attribute__((target(...)))` based FMV. #81167 removed warnings for all `target`-based FMV. This patch restores the warnings for `__attribute__((target("default")))`.
17 lines
648 B
C++
17 lines
648 B
C++
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify -Wunused %s
|
|
|
|
__attribute__((target("sse3")))
|
|
static int not_used_fmv() { return 1; }
|
|
__attribute__((target("avx2")))
|
|
static int not_used_fmv() { return 2; }
|
|
__attribute__((target("default")))
|
|
static int not_used_fmv() { return 0; } // expected-warning {{unused function 'not_used_fmv'}}
|
|
|
|
__attribute__((target("sse3")))
|
|
static int definitely_used_fmv() { return 1; }
|
|
__attribute__((target("avx2")))
|
|
static int definitely_used_fmv() { return 2; }
|
|
__attribute__((target("default")))
|
|
static int definitely_used_fmv() { return 0; }
|
|
int definite_user() { return definitely_used_fmv(); }
|