|
1 | 1 | // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify -std=c2x %s
|
2 | 2 | // RUN: %clang_cc1 -triple aarch64-linux-gnu -fsyntax-only -verify -std=c2x %s
|
3 | 3 | // RUN: %clang_cc1 -triple arm-linux-gnu -fsyntax-only -verify -std=c2x %s
|
| 4 | +// RUN: %clang_cc1 -triple powerpc-linux-gnu -fsyntax-only -verify -std=c2x %s |
| 5 | +// RUN: %clang_cc1 -triple ppc64le-linux-gnu -fsyntax-only -verify -std=c2x %s |
4 | 6 |
|
5 | 7 | #ifdef __x86_64__
|
6 | 8 |
|
@@ -61,6 +63,28 @@ int __attribute__((target("tune=cortex-a710,tune=neoverse-n2"))) pear_tree(void)
|
61 | 63 | // no warning - branch-protection should work on aarch64
|
62 | 64 | int __attribute__((target("branch-protection=none"))) birch_tree(void) { return 5; }
|
63 | 65 |
|
| 66 | +#elifdef __powerpc__ |
| 67 | + |
| 68 | +int __attribute__((target("float128,arch=pwr9"))) foo(void) { return 4; } |
| 69 | +//expected-error@+1 {{'target' attribute takes one argument}} |
| 70 | +int __attribute__((target())) bar(void) { return 4; } |
| 71 | +// no warning, tune is supported for PPC |
| 72 | +int __attribute__((target("tune=pwr8"))) baz(void) { return 4; } |
| 73 | +//expected-warning@+1 {{unsupported 'fpmath=' in the 'target' attribute string; 'target' attribute ignored}} |
| 74 | +int __attribute__((target("fpmath=387"))) walrus(void) { return 4; } |
| 75 | +//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}} |
| 76 | +int __attribute__((target("float128,arch=hiss"))) meow(void) { return 4; } |
| 77 | +// no warning, same as saying 'nothing'. |
| 78 | +int __attribute__((target("arch="))) turtle(void) { return 4; } |
| 79 | +//expected-warning@+1 {{unknown CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}} |
| 80 | +int __attribute__((target("arch=hiss,arch=woof"))) pine_tree(void) { return 4; } |
| 81 | +//expected-warning@+1 {{duplicate 'arch=' in the 'target' attribute string; 'target' attribute ignored}} |
| 82 | +int __attribute__((target("arch=pwr9,arch=pwr10"))) oak_tree(void) { return 4; } |
| 83 | +//expected-warning@+1 {{unsupported 'branch-protection' in the 'target' attribute string; 'target' attribute ignored}} |
| 84 | +int __attribute__((target("branch-protection=none"))) birch_tree(void) { return 5; } |
| 85 | +//expected-warning@+1 {{unknown tune CPU 'hiss' in the 'target' attribute string; 'target' attribute ignored}} |
| 86 | +int __attribute__((target("tune=hiss,tune=woof"))) apple_tree(void) { return 4; } |
| 87 | + |
64 | 88 | #else
|
65 | 89 |
|
66 | 90 | // tune is not supported by other targets.
|
|
0 commit comments