| 1 |
// RUN: %clang_cc1 -triple aarch64-linux-gnu -verify -emit-llvm-only %s -DCHECK_IMPLICIT_DEFAULT |
| 2 |
// RUN: %clang_cc1 -triple aarch64-linux-gnu -verify -emit-llvm-only %s -DCHECK_EXPLICIT_DEFAULT |
| 3 |
// RUN: %clang_cc1 -triple aarch64-linux-gnu -verify -emit-llvm-only %s -DCHECK_EXPLICIT_VERSION_PRIORITY |
| 4 |
// RUN: %clang_cc1 -triple aarch64-linux-gnu -verify -emit-llvm-only %s -DCHECK_EXPLICIT_CLONES_PRIORITY |
| 5 |
|
| 6 |
#if defined(CHECK_IMPLICIT_DEFAULT) |
| 7 |
|
| 8 |
int implicit_default_ok(void) { return 0; } |
| 9 |
__attribute__((target_clones("aes", "lse"))) int implicit_default_ok(void) { return 1; } |
| 10 |
|
| 11 |
int implicit_default_bad(void) { return 0; } |
| 12 |
// expected-error@+2 {{definition with same mangled name 'implicit_default_bad.default' as another definition}} |
| 13 |
// expected-note@-2 {{previous definition is here}} |
| 14 |
__attribute__((target_clones("aes", "lse", "default"))) int implicit_default_bad(void) { return 1; } |
| 15 |
|
| 16 |
#elif defined(CHECK_EXPLICIT_DEFAULT) |
| 17 |
|
| 18 |
__attribute__((target_version("default"))) int explicit_default_ok(void) { return 0; } |
| 19 |
__attribute__((target_clones("aes", "lse"))) int explicit_default_ok(void) { return 1; } |
| 20 |
|
| 21 |
__attribute__((target_version("default"))) int explicit_default_bad(void) { return 0; } |
| 22 |
// expected-error@+2 {{definition with same mangled name 'explicit_default_bad.default' as another definition}} |
| 23 |
// expected-note@-2 {{previous definition is here}} |
| 24 |
__attribute__((target_clones("aes", "lse", "default"))) int explicit_default_bad(void) { return 1; } |
| 25 |
|
| 26 |
#elif defined(CHECK_EXPLICIT_VERSION_PRIORITY) |
| 27 |
|
| 28 |
__attribute__((target_version("aes"))) int explicit_version_priority(void) { return 0; } |
| 29 |
// expected-error@+2 {{definition with same mangled name 'explicit_version_priority._Maes' as another definition}} |
| 30 |
// expected-note@-2 {{previous definition is here}} |
| 31 |
__attribute__((target_version("aes;priority=10"))) int explicit_version_priority(void) { return 1; } |
| 32 |
|
| 33 |
#elif defined(CHECK_EXPLICIT_CLONES_PRIORITY) |
| 34 |
|
| 35 |
__attribute__((target_version("aes;priority=20"))) int explicit_clones_priority(void) { return 0; } |
| 36 |
// expected-error@+2 {{definition with same mangled name 'explicit_clones_priority._Maes' as another definition}} |
| 37 |
// expected-note@-2 {{previous definition is here}} |
| 38 |
__attribute__((target_clones("aes;priority=5", "lse"))) int explicit_clones_priority(void) { return 1; } |
| 39 |
|
| 40 |
#endif |