-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Warn unused functions for FMV based on the target attribute (#…
…81302) 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")))`.
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// 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(); } |