[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / attr-target-clones-riscv.cpp
blob102bb4b9b3d2bf5ee496be74146fe6cd42e87282
1 // RUN: %clang_cc1 -triple riscv64-linux-gnu -fsyntax-only -verify -fexceptions -fcxx-exceptions %s -std=c++14
3 // expected-warning@+1 {{unsupported 'mcpu=sifive-u74' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
4 void __attribute__((target_clones("default", "mcpu=sifive-u74"))) mcpu() {}
6 // expected-warning@+1 {{unsupported 'mtune=sifive-u74' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
7 void __attribute__((target_clones("default", "mtune=sifive-u74"))) mtune() {}
9 // expected-warning@+1 {{version list contains duplicate entries}}
10 void __attribute__((target_clones("default", "arch=+c", "arch=+c"))) dupVersion() {}
12 // expected-warning@+1 {{unsupported '' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
13 void __attribute__((target_clones("default", ""))) emptyVersion() {}
15 // expected-error@+1 {{'target_clones' multiversioning requires a default target}}
16 void __attribute__((target_clones("arch=+c"))) withoutDefault() {}
18 // expected-warning@+1 {{unsupported '+c' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
19 void __attribute__((target_clones("default", "+c"))) invaildVersion() {}
21 // expected-warning@+1 {{unsupported 'arch=rv64g' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
22 void __attribute__((target_clones("default", "arch=rv64g"))) fullArchString() {}
24 // expected-warning@+1 {{unsupported 'arch=+zicsr' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
25 void __attribute__((target_clones("default", "arch=+zicsr"))) UnsupportBitMaskExt() {}
27 // expected-warning@+1 {{unsupported 'arch=+c;priority=NotADigit' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
28 void __attribute__((target_clones("default", "arch=+c;priority=NotADigit"))) UnsupportPriority() {}
30 // expected-warning@+1 {{unsupported 'default;priority=2' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
31 void __attribute__((target_clones("default;priority=2", "arch=+c"))) UnsupportDefaultPriority() {}
33 // expected-warning@+1 {{unsupported 'priority=2;default' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
34 void __attribute__((target_clones("priority=2;default", "arch=+c"))) UnsupportDefaultPriority2() {}
36 // expected-warning@+1 {{unsupported 'arch=+c;priority=-1' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
37 void __attribute__((target_clones("default", "arch=+c;priority=-1"))) UnsupportNegativePriority() {}
39 // expected-warning@+1 {{unsupported 'arch=+c,zbb' in the 'target_clones' attribute string; 'target_clones' attribute ignored}}
40 void __attribute__((target_clones("default", "arch=+c,zbb"))) WithoutAddSign() {}
43 void lambda() {
44 // expected-error@+1 {{attribute 'target_clones' multiversioned functions do not yet support lambdas}}
45 auto x = []() __attribute__((target_clones("default"))){};
46 x();
47 // expected-error@+1 {{attribute 'target_clones' multiversioned functions do not yet support lambdas}}
48 auto y = []() __attribute__((target_clones("arch=+v", "default"))){};
49 y();