https://github.com/tmatheson-arm created https://github.com/llvm/llvm-project/pull/91490
None >From 9097058fe1c6e661efe60899f0da7cfd966c6ee7 Mon Sep 17 00:00:00 2001 From: Tomas Matheson <tomas.mathe...@arm.com> Date: Wed, 8 May 2024 16:42:24 +0100 Subject: [PATCH] [AArch64] add some more tests for FMV --- clang/test/CodeGen/aarch64-fmv-dependencies.c | 381 ++++++++++++++++++ clang/test/Driver/aarch64-fmv.c | 25 ++ 2 files changed, 406 insertions(+) create mode 100644 clang/test/CodeGen/aarch64-fmv-dependencies.c create mode 100644 clang/test/Driver/aarch64-fmv.c diff --git a/clang/test/CodeGen/aarch64-fmv-dependencies.c b/clang/test/CodeGen/aarch64-fmv-dependencies.c new file mode 100644 index 0000000000000..3f5f970eda96a --- /dev/null +++ b/clang/test/CodeGen/aarch64-fmv-dependencies.c @@ -0,0 +1,381 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-attributes --check-globals all --filter "define|attributes" --include-generated-funcs --version 4 + +// Test/document all of the dependencies between possible AArch64 FMV extensions. +// Also test the name mangling. + +// RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -emit-llvm -S -o - %s | FileCheck %s + + +int __attribute__((target_version("aes"))) fmv(void) { return 0; } +int __attribute__((target_version("bf16"))) fmv(void) { return 0; } +int __attribute__((target_version("bti"))) fmv(void) { return 0; } +int __attribute__((target_version("crc"))) fmv(void) { return 0; } +int __attribute__((target_version("dgh"))) fmv(void) { return 0; } +int __attribute__((target_version("dit"))) fmv(void) { return 0; } +int __attribute__((target_version("dotprod"))) fmv(void) { return 0; } +int __attribute__((target_version("dpb"))) fmv(void) { return 0; } +int __attribute__((target_version("dpb2"))) fmv(void) { return 0; } +int __attribute__((target_version("ebf16"))) fmv(void) { return 0; } +int __attribute__((target_version("f32mm"))) fmv(void) { return 0; } +int __attribute__((target_version("f64mm"))) fmv(void) { return 0; } +int __attribute__((target_version("fcma"))) fmv(void) { return 0; } +int __attribute__((target_version("flagm"))) fmv(void) { return 0; } +int __attribute__((target_version("flagm2"))) fmv(void) { return 0; } +int __attribute__((target_version("fp"))) fmv(void) { return 0; } +int __attribute__((target_version("fp16"))) fmv(void) { return 0; } +int __attribute__((target_version("fp16fml"))) fmv(void) { return 0; } +int __attribute__((target_version("frintts"))) fmv(void) { return 0; } +int __attribute__((target_version("i8mm"))) fmv(void) { return 0; } +int __attribute__((target_version("jscvt"))) fmv(void) { return 0; } +int __attribute__((target_version("ls64"))) fmv(void) { return 0; } +int __attribute__((target_version("ls64_accdata"))) fmv(void) { return 0; } +int __attribute__((target_version("ls64_v"))) fmv(void) { return 0; } +int __attribute__((target_version("lse"))) fmv(void) { return 0; } +int __attribute__((target_version("memtag"))) fmv(void) { return 0; } +int __attribute__((target_version("memtag2"))) fmv(void) { return 0; } +int __attribute__((target_version("memtag3"))) fmv(void) { return 0; } +int __attribute__((target_version("mops"))) fmv(void) { return 0; } +int __attribute__((target_version("pmull"))) fmv(void) { return 0; } +int __attribute__((target_version("predres"))) fmv(void) { return 0; } +int __attribute__((target_version("rcpc"))) fmv(void) { return 0; } +int __attribute__((target_version("rcpc2"))) fmv(void) { return 0; } +int __attribute__((target_version("rcpc3"))) fmv(void) { return 0; } +int __attribute__((target_version("rdm"))) fmv(void) { return 0; } +int __attribute__((target_version("rng"))) fmv(void) { return 0; } +int __attribute__((target_version("rpres"))) fmv(void) { return 0; } +int __attribute__((target_version("sb"))) fmv(void) { return 0; } +int __attribute__((target_version("sha1"))) fmv(void) { return 0; } +int __attribute__((target_version("sha2"))) fmv(void) { return 0; } +int __attribute__((target_version("sha3"))) fmv(void) { return 0; } +int __attribute__((target_version("simd"))) fmv(void) { return 0; } +int __attribute__((target_version("sm4"))) fmv(void) { return 0; } +int __attribute__((target_version("sme"))) fmv(void) { return 0; } +int __attribute__((target_version("sme-f64f64"))) fmv(void) { return 0; } +int __attribute__((target_version("sme-i16i64"))) fmv(void) { return 0; } +int __attribute__((target_version("sme2"))) fmv(void) { return 0; } +int __attribute__((target_version("ssbs"))) fmv(void) { return 0; } +int __attribute__((target_version("ssbs2"))) fmv(void) { return 0; } +int __attribute__((target_version("sve"))) fmv(void) { return 0; } +int __attribute__((target_version("sve-bf16"))) fmv(void) { return 0; } +int __attribute__((target_version("sve-ebf16"))) fmv(void) { return 0; } +int __attribute__((target_version("sve-i8mm"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2-aes"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2-bitperm"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2-pmull128"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2-sha3"))) fmv(void) { return 0; } +int __attribute__((target_version("sve2-sm4"))) fmv(void) { return 0; } +int __attribute__((target_version("wfxt"))) fmv(void) { return 0; } + +int __attribute__((target_version("default"))) fmv(void); + +int caller() { + return fmv(); +} + +//. +// CHECK: @__aarch64_cpu_features = external dso_local global { i64 } +// CHECK: @fmv.ifunc = weak_odr dso_local alias i32 (), ptr @fmv +// CHECK: @fmv = weak_odr dso_local ifunc i32 (), ptr @fmv.resolver +//. +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Maes( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @caller( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK-LABEL: define weak_odr ptr @fmv.resolver() comdat { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mbf16( +// CHECK-SAME: ) #[[ATTR1:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mbti( +// CHECK-SAME: ) #[[ATTR2:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mcrc( +// CHECK-SAME: ) #[[ATTR3:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mdgh( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mdit( +// CHECK-SAME: ) #[[ATTR4:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mdotprod( +// CHECK-SAME: ) #[[ATTR5:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mdpb( +// CHECK-SAME: ) #[[ATTR6:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mdpb2( +// CHECK-SAME: ) #[[ATTR7:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mebf16( +// CHECK-SAME: ) #[[ATTR1:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mf32mm( +// CHECK-SAME: ) #[[ATTR8:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mf64mm( +// CHECK-SAME: ) #[[ATTR9:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mfcma( +// CHECK-SAME: ) #[[ATTR10:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mflagm( +// CHECK-SAME: ) #[[ATTR11:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mflagm2( +// CHECK-SAME: ) #[[ATTR12:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mfp( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mfp16( +// CHECK-SAME: ) #[[ATTR13:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mfp16fml( +// CHECK-SAME: ) #[[ATTR14:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mfrintts( +// CHECK-SAME: ) #[[ATTR15:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mi8mm( +// CHECK-SAME: ) #[[ATTR16:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mjscvt( +// CHECK-SAME: ) #[[ATTR17:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mls64( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mls64_accdata( +// CHECK-SAME: ) #[[ATTR18:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mls64_v( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mlse( +// CHECK-SAME: ) #[[ATTR19:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag2( +// CHECK-SAME: ) #[[ATTR20:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag3( +// CHECK-SAME: ) #[[ATTR20:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mmops( +// CHECK-SAME: ) #[[ATTR21:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mpmull( +// CHECK-SAME: ) #[[ATTR22:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mpredres( +// CHECK-SAME: ) #[[ATTR23:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc( +// CHECK-SAME: ) #[[ATTR24:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc2( +// CHECK-SAME: ) #[[ATTR24:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc3( +// CHECK-SAME: ) #[[ATTR25:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrdm( +// CHECK-SAME: ) #[[ATTR26:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrng( +// CHECK-SAME: ) #[[ATTR27:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mrpres( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msb( +// CHECK-SAME: ) #[[ATTR28:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msha1( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msha2( +// CHECK-SAME: ) #[[ATTR29:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msha3( +// CHECK-SAME: ) #[[ATTR30:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msimd( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msm4( +// CHECK-SAME: ) #[[ATTR31:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msme( +// CHECK-SAME: ) #[[ATTR32:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msme-f64f64( +// CHECK-SAME: ) #[[ATTR33:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msme-i16i64( +// CHECK-SAME: ) #[[ATTR34:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msme2( +// CHECK-SAME: ) #[[ATTR35:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mssbs( +// CHECK-SAME: ) #[[ATTR0:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mssbs2( +// CHECK-SAME: ) #[[ATTR36:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve( +// CHECK-SAME: ) #[[ATTR37:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve-bf16( +// CHECK-SAME: ) #[[ATTR38:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve-ebf16( +// CHECK-SAME: ) #[[ATTR38:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve-i8mm( +// CHECK-SAME: ) #[[ATTR39:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2( +// CHECK-SAME: ) #[[ATTR40:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2-aes( +// CHECK-SAME: ) #[[ATTR41:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2-bitperm( +// CHECK-SAME: ) #[[ATTR42:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2-pmull128( +// CHECK-SAME: ) #[[ATTR41:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2-sha3( +// CHECK-SAME: ) #[[ATTR43:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Msve2-sm4( +// CHECK-SAME: ) #[[ATTR44:[0-9]+]] { +// +// CHECK: Function Attrs: noinline nounwind optnone uwtable +// CHECK-LABEL: define dso_local i32 @fmv._Mwfxt( +// CHECK-SAME: ) #[[ATTR45:[0-9]+]] { +//. +// CHECK: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR1:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR2:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bti,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR3:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+crc,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR4:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+dit,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR5:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+dotprod,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR6:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR7:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+ccdp,+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR8:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+f32mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" } +// CHECK: attributes #[[ATTR9:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+f64mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" } +// CHECK: attributes #[[ATTR10:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+complxnum,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR11:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+flagm,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR12:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+altnzcv,+flagm,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR13:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR14:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fp16fml,+fullfp16,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR15:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fptoint,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR16:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+i8mm,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR17:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+jsconv,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR18:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+ls64,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR19:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+lse,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR20:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+mte,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR21:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+mops,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR22:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+aes,+fp-armv8,+neon,+outline-atomics,+v8a" } +// CHECK: attributes #[[ATTR23:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+predres,+v8a" } +// CHECK: attributes #[[ATTR24:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+rcpc,+v8a" } +// CHECK: attributes #[[ATTR25:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+rcpc,+rcpc3,+v8a" } +// CHECK: attributes #[[ATTR26:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+rdm,+v8a" } +// CHECK: attributes #[[ATTR27:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+rand,+v8a" } +// CHECK: attributes #[[ATTR28:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+sb,+v8a" } +// CHECK: attributes #[[ATTR29:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+sha2,+v8a" } +// CHECK: attributes #[[ATTR30:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+sha2,+sha3,+v8a" } +// CHECK: attributes #[[ATTR31:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+sm4,+v8a" } +// CHECK: attributes #[[ATTR32:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+sme,+v8a" } +// CHECK: attributes #[[ATTR33:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+sme,+sme-f64f64,+v8a" } +// CHECK: attributes #[[ATTR34:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+sme,+sme-i16i64,+v8a" } +// CHECK: attributes #[[ATTR35:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+sme,+sme2,+v8a" } +// CHECK: attributes #[[ATTR36:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+ssbs,+v8a" } +// CHECK: attributes #[[ATTR37:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" } +// CHECK: attributes #[[ATTR38:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" } +// CHECK: attributes #[[ATTR39:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+i8mm,+neon,+outline-atomics,+sve,+v8a" } +// CHECK: attributes #[[ATTR40:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+v8a" } +// CHECK: attributes #[[ATTR41:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-aes,+v8a" } +// CHECK: attributes #[[ATTR42:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-bitperm,+v8a" } +// CHECK: attributes #[[ATTR43:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-sha3,+v8a" } +// CHECK: attributes #[[ATTR44:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+sve2-sm4,+v8a" } +// CHECK: attributes #[[ATTR45:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a,+wfxt" } +// CHECK: attributes #[[ATTR46:[0-9]+]] = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a" } +//. +// CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +// CHECK: [[META1:![0-9]+]] = !{i32 8, !"PIC Level", i32 2} +// CHECK: [[META2:![0-9]+]] = !{i32 7, !"PIE Level", i32 2} +// CHECK: [[META3:![0-9]+]] = !{i32 7, !"uwtable", i32 2} +// CHECK: [[META4:![0-9]+]] = !{i32 7, !"frame-pointer", i32 1} +// CHECK: [[META5:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"} +//. diff --git a/clang/test/Driver/aarch64-fmv.c b/clang/test/Driver/aarch64-fmv.c new file mode 100644 index 0000000000000..a8b04acfe0a02 --- /dev/null +++ b/clang/test/Driver/aarch64-fmv.c @@ -0,0 +1,25 @@ +// Test which driver flags enable/disable Function Multiversioning on aarch64. + +// FMV is enabled for non-android aarch64 targets: +// RUN: %clang --target=aarch64 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s +// RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s + +// android23 defaults to --rtlib=compiler-rt: +// RUN: %clang --target=aarch64-linux-android23 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s +// RUN: %clang --target=aarch64-linux-android23 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s + +// FMV is disabled without compiler-rt: +// RUN: %clang --target=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s +// RUN: %clang --target=aarch64-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s + +// Disabled for older android versions: +// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s +// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s +// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s + +// Disabled explicitly: +// RUN: %clang --rtlib=compiler-rt --target=aarch64 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s +// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android23 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s + +// FMV-ENABLED-NOT: "-target-feature" "-fmv" +// FMV-DISABLED: "-target-feature" "-fmv" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits