diff options
| author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2016-08-30 08:09:45 +0000 |
|---|---|---|
| committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2016-08-30 08:09:45 +0000 |
| commit | 0a8d4216ad52aeffc14597a2d946134afa0d89ec (patch) | |
| tree | a93cd5532ced3f54265fdc9fd20b9585d63363e9 /clang/test | |
| parent | 5a99207d11f3ea72ca9424596e1d0cdf4bdb9f3f (diff) | |
| download | bcm5719-llvm-0a8d4216ad52aeffc14597a2d946134afa0d89ec.tar.gz bcm5719-llvm-0a8d4216ad52aeffc14597a2d946134afa0d89ec.zip | |
This adds new options -fdenormal-fp-math and passes through option -ffast-math
to CC1, which are translated to function attributes and can e.g. be mapped on
build attributes FP_exceptions and FP_denormal. Setting these build attributes
allows better selection of floating point libraries.
Differential Revision: https://reviews.llvm.org/D23840
llvm-svn: 280064
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGen/denormalfpmode.c | 12 | ||||
| -rw-r--r-- | clang/test/CodeGen/noexceptionsfpmath.c | 8 | ||||
| -rw-r--r-- | clang/test/Driver/fast-math.c | 17 |
3 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/CodeGen/denormalfpmode.c b/clang/test/CodeGen/denormalfpmode.c new file mode 100644 index 00000000000..b0013daefbf --- /dev/null +++ b/clang/test/CodeGen/denormalfpmode.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -S -fdenormal-fp-math=ieee %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-IEEE +// RUN: %clang_cc1 -S -fdenormal-fp-math=preserve-sign %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-PS +// RUN: %clang_cc1 -S -fdenormal-fp-math=positive-zero %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-PZ + +// CHECK-LABEL: main +// CHECK-IEEE: attributes #0 = {{.*}}"denormal-fp-math"="ieee"{{.*}} +// CHECK-PS: attributes #0 = {{.*}}"denormal-fp-math"="preserve-sign"{{.*}} +// CHECK-PZ: attributes #0 = {{.*}}"denormal-fp-math"="positive-zero"{{.*}} + +int main() { + return 0; +} diff --git a/clang/test/CodeGen/noexceptionsfpmath.c b/clang/test/CodeGen/noexceptionsfpmath.c new file mode 100644 index 00000000000..a22e285bb72 --- /dev/null +++ b/clang/test/CodeGen/noexceptionsfpmath.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -S -fno-trapping-math %s -emit-llvm -o - | FileCheck %s + +// CHECK-LABEL: main +// CHECK: attributes #0 = {{.*}}"no-trapping-math"="true"{{.*}} + +int main() { + return 0; +} diff --git a/clang/test/Driver/fast-math.c b/clang/test/Driver/fast-math.c index 24c30386da1..c31f3766a51 100644 --- a/clang/test/Driver/fast-math.c +++ b/clang/test/Driver/fast-math.c @@ -231,3 +231,20 @@ // CHECK-NO-UNSAFE-MATH: "-cc1" // CHECK-NO-UNSAFE-MATH-NOT: "-menable-unsafe-fp-math" // CHECK-NO-UNSAFE-MATH: "-o" +// +// RUN: %clang -### -fexceptions-fp-math -fno-exceptions-fp-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NO-FP-EXCEPTIONS %s +// RUN: %clang -### -fno-exceptions-fp-math -fexceptions-fp-math -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FP-EXCEPTIONS %s +// CHECK-NO-FP-EXCEPTIONS: "-fno-exceptions-fp-math" +// CHECK-FP-EXCEPTIONS-NOT: "-fno-exceptions-fp-math" +// +// RUN: %clang -### -fdenormal-fp-math=ieee -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FP-DENORMAL-IEEE %s +// RUN: %clang -### -fdenormal-fp-math=preserve-sign -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FP-DENORMAL-PS %s +// RUN: %clang -### -fdenormal-fp-math=positive-zero -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FP-DENORMAL-PZ %s +// CHECK-FP-DENORMAL-IEEE: "-fdenormal-fp-math=ieee" +// CHECK-FP-DENORMAL-PS: "-fdenormal-fp-math=preserve-sign" +// CHECK-FP-DENORMAL-PZ: "-fdenormal-fp-math=positive-zero" |

