|
1 | | -// RUN: %clang_cc1 -triple aarch64 -verify=expected,aarch64 -fsyntax-only %s |
| 1 | +// RUN: %clang_cc1 -triple aarch64 -verify=expected,unsupported -fsyntax-only %s |
2 | 2 | // RUN: %clang_cc1 -triple loongarch64 -verify=expected,loongarch64 -fsyntax-only %s |
3 | | -// RUN: %clang_cc1 -triple mips64 -verify=expected,mips64 -fsyntax-only %s |
4 | | -// RUN: %clang_cc1 -triple powerpc64 -verify=expected,powerpc64 -fsyntax-only %s |
5 | | -// RUN: %clang_cc1 -triple riscv64 -verify=expected,riscv64 -fsyntax-only %s |
| 3 | +// RUN: %clang_cc1 -triple mips64 -verify=expected,unsupported -fsyntax-only %s |
| 4 | +// RUN: %clang_cc1 -triple powerpc64 -verify=expected,unsupported -fsyntax-only %s |
| 5 | +// RUN: %clang_cc1 -triple riscv64 -verify=expected,unsupported -fsyntax-only %s |
6 | 6 | // RUN: %clang_cc1 -triple x86_64 -verify=expected,x86_64 -fsyntax-only %s |
| 7 | +// RUN: %clang_cc1 -triple nvptx64 -fcuda-is-device -verify=expected,unsupported -fsyntax-only %s |
7 | 8 |
|
8 | 9 | #if (defined(__loongarch__) || defined(__x86_64__)) && !__has_attribute(model) |
9 | 10 | #error "Should support model attribute" |
10 | 11 | #endif |
11 | 12 |
|
12 | | -int a __attribute((model("tiny"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
| 13 | +int a __attribute((model("tiny"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
13 | 14 | // loongarch64-error {{code model 'tiny' is not supported on this target}} \ |
14 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
15 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
16 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
17 | 15 | // x86_64-error {{code model 'tiny' is not supported on this target}} |
18 | | -int b __attribute((model("small"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
19 | | - // loongarch64-error {{code model 'small' is not supported on this target}} \ |
20 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
21 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
22 | | - // riscv64-warning {{unknown attribute 'model' ignored}} |
23 | | -int c __attribute((model("normal"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
24 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
25 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
26 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
| 16 | +int b __attribute((model("small"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
| 17 | + // loongarch64-error {{code model 'small' is not supported on this target}} |
| 18 | +int c __attribute((model("normal"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
27 | 19 | // x86_64-error {{code model 'normal' is not supported on this target}} |
28 | | -int d __attribute((model("kernel"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
| 20 | +int d __attribute((model("kernel"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
29 | 21 | // loongarch64-error {{code model 'kernel' is not supported on this target}} \ |
30 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
31 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
32 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
33 | 22 | // x86_64-error {{code model 'kernel' is not supported on this target}} |
34 | | -int e __attribute((model("medium"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
35 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
36 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
37 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
| 23 | +int e __attribute((model("medium"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
38 | 24 | // x86_64-error {{code model 'medium' is not supported on this target}} |
39 | | -int f __attribute((model("large"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
40 | | - // loongarch64-error {{code model 'large' is not supported on this target}} \ |
41 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
42 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
43 | | - // riscv64-warning {{unknown attribute 'model' ignored}} |
44 | | -int g __attribute((model("extreme"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
45 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
46 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
47 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
| 25 | +int f __attribute((model("large"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
| 26 | + // loongarch64-error {{code model 'large' is not supported on this target}} |
| 27 | +int g __attribute((model("extreme"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
48 | 28 | // x86_64-error {{code model 'extreme' is not supported on this target}} |
49 | 29 |
|
50 | | -void __attribute((model("extreme"))) h() {} // aarch64-warning {{unknown attribute 'model' ignored}} \ |
| 30 | +void __attribute((model("extreme"))) h() {} // unsupported-warning {{unknown attribute 'model' ignored}} \ |
51 | 31 | // loongarch64-error {{'model' attribute only applies to non-TLS global variables}} \ |
52 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
53 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
54 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
55 | 32 | // x86_64-error {{'model' attribute only applies to non-TLS global variables}} |
56 | 33 |
|
57 | | -thread_local int i __attribute((model("extreme"))); // aarch64-warning {{unknown attribute 'model' ignored}} \ |
58 | | - // loongarch64-error {{'model' attribute only applies to non-TLS global variables}} \ |
59 | | - // mips64-warning {{unknown attribute 'model' ignored}} \ |
60 | | - // powerpc64-warning {{unknown attribute 'model' ignored}} \ |
61 | | - // riscv64-warning {{unknown attribute 'model' ignored}} \ |
62 | | - // x86_64-error {{'model' attribute only applies to non-TLS global variables}} |
| 34 | +// NVPTX doesn't support thread_local at all. |
| 35 | +#ifndef __NVPTX__ |
| 36 | +thread_local |
| 37 | +#endif |
| 38 | +int i __attribute((model("extreme"))); // unsupported-warning {{unknown attribute 'model' ignored}} \ |
| 39 | + // loongarch64-error {{'model' attribute only applies to non-TLS global variables}} \ |
| 40 | + // x86_64-error {{'model' attribute only applies to non-TLS global variables}} |
0 commit comments