mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 21:26:05 +00:00

The driver currently accepts but ignores the -fno-signed-zeros flag. This patch passes the flag through and enables 'nsz' fast-math-flag generation in IR. The existing OpenCL flag for the same functionality is made into an alias here. It may be removed in a subsequent patch. This should resolve bug 20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 ); patches for the optimizer were checked in at: http://llvm.org/viewvc/llvm-project?view=revision&revision=225050 http://llvm.org/viewvc/llvm-project?view=revision&revision=224583 Differential Revision: http://reviews.llvm.org/D6873 llvm-svn: 226915
16 lines
381 B
C
16 lines
381 B
C
// RUN: %clang_cc1 -ffinite-math-only -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=FINITE
|
|
// RUN: %clang_cc1 -fno-signed-zeros -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK -check-prefix=NSZ
|
|
|
|
float f0, f1, f2;
|
|
|
|
void foo(void) {
|
|
// CHECK-LABEL: define void @foo()
|
|
|
|
// FINITE: fadd nnan ninf
|
|
// NSZ: fadd nsz
|
|
f0 = f1 + f2;
|
|
|
|
// CHECK: ret
|
|
}
|
|
|