Debian Codegraph @

clang/test/AST/attr-target-version.c

raw
1 // RUN: %clang_cc1 -triple aarch64-linux-gnu -ast-dump %s | FileCheck %s
2
3 int __attribute__((target_version("sve2-bitperm + sha2"))) foov(void) { return 1; }
4 int __attribute__((target_clones(" lse + fp + sha3 ", "default"))) fooc(void) { return 2; }
5
6 int __attribute__((target_version("aes;priority=1"))) explicit_priority(void) { return 1; }
7 int __attribute__((target_version("bf16;priority=2"))) explicit_priority(void) { return 2; }
8 int __attribute__((target_version("crc;priority=4"))) explicit_priority(void) { return 4; }
9 int __attribute__((target_version("dpb2;priority=8"))) explicit_priority(void) { return 8; }
10 int __attribute__((target_version("fp16fml;priority=16"))) explicit_priority(void) { return 16; }
11 int __attribute__((target_version("dotprod;priority=32"))) explicit_priority(void) { return 32; }
12 int __attribute__((target_version("sve;priority=64"))) explicit_priority(void) { return 64; }
13 int __attribute__((target_version("mops;priority=128"))) explicit_priority(void) { return 128; }
14
15 int __attribute__((target_clones("simd;priority=255", "default"))) explicit_priority(void) {
16 return 0;
17 }
18
19 // CHECK: TargetVersionAttr {{.*}} "sve2-bitperm+sha2"
20 // CHECK: TargetClonesAttr {{.*}} fp+lse+sha3 default
21
22 // CHECK: TargetVersionAttr {{.*}} "aes+P0"
23 // CHECK: TargetVersionAttr {{.*}} "bf16+P1"
24 // CHECK: TargetVersionAttr {{.*}} "crc+P2"
25 // CHECK: TargetVersionAttr {{.*}} "dpb2+P3"
26 // CHECK: TargetVersionAttr {{.*}} "fp16fml+P4"
27 // CHECK: TargetVersionAttr {{.*}} "dotprod+P5"
28 // CHECK: TargetVersionAttr {{.*}} "sve+P6"
29 // CHECK: TargetVersionAttr {{.*}} "mops+P7"
30 // CHECK: TargetClonesAttr {{.*}} simd+P0+P1+P2+P3+P4+P5+P6+P7 default