mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 00:55:49 +03:00

LLVM 8 (D56351) introduced "frame-pointer" which was intended to replace "no-frame-pointer-elim"/"no-frame-pointer-elim-non-leaf".
28 lines
1 KiB
D
28 lines
1 KiB
D
// REQUIRES: atleast_llvm800
|
|
// Tests that our TargetMachine options are added as function attributes
|
|
|
|
// RUN: %ldc -c -output-ll -of=%t.ll %s
|
|
// RUN: FileCheck %s --check-prefix=COMMON --check-prefix=WITH_FP < %t.ll
|
|
// RUN: %ldc -c -output-ll -of=%t.ll %s -O2
|
|
// RUN: FileCheck %s --check-prefix=COMMON --check-prefix=NO_FP < %t.ll
|
|
// RUN: %ldc -c -output-ll -of=%t.ll %s -O2 %disable_fp_elim
|
|
// RUN: FileCheck %s --check-prefix=COMMON --check-prefix=WITH_FP < %t.ll
|
|
// RUN: %ldc -c -output-ll -of=%t.ll %s %enable_fp_elim -mattr=test
|
|
// RUN: FileCheck %s --check-prefix=COMMON --check-prefix=NO_FP --check-prefix=ATTR < %t.ll
|
|
|
|
// COMMON: define{{.*}} @{{.*}}3fooFZv{{.*}} #[[KEYVALUE:[0-9]+]]
|
|
void foo()
|
|
{
|
|
}
|
|
|
|
// COMMON: attributes #[[KEYVALUE]]
|
|
// COMMON-DAG: "target-cpu"=
|
|
// COMMON-DAG: "unsafe-fp-math"="false"
|
|
// COMMON-DAG: "less-precise-fpmad"="false"
|
|
// COMMON-DAG: "no-infs-fp-math"="false"
|
|
// COMMON-DAG: "no-nans-fp-math"="false"
|
|
|
|
// WITH_FP-DAG: "frame-pointer"="all"
|
|
// NO_FP-DAG: "frame-pointer"="none"
|
|
|
|
// ATTR-DAG: "target-features"="{{[^"]*}}+test
|