brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 42b7f1c Raw
28 lines · c
1// RUN: %clang_cc1 -triple x86_64-linux-gnu -ffast-math \2// RUN: -ffp-contract=fast -emit-llvm -o - %s | \3// RUN: FileCheck %s --check-prefixes=CHECK,FINITEONLY4 5// RUN: %clang_cc1 -triple x86_64-linux-gnu -funsafe-math-optimizations \6// RUN: -ffp-contract=fast -emit-llvm -o - %s | \7// RUN: FileCheck %s --check-prefixes=CHECK,NOFINITEONLY8 9// RUN: %clang_cc1 -triple x86_64-linux-gnu -funsafe-math-optimizations \10// RUN: -ffp-contract=on -emit-llvm -o - %s | \11// RUN: FileCheck %s --check-prefixes=CHECK,NOFINITEONLY12 13// RUN: %clang_cc1 -triple x86_64-linux-gnu -funsafe-math-optimizations \14// RUN: -ffp-contract=off -emit-llvm -o - %s | \15// RUN: FileCheck %s --check-prefixes=CHECK,NOFINITEONLY16 17float foo(float a, float b) {18  return a+b;19}20 21// FINITEONLY:    define{{.*}} float @foo(float noundef nofpclass(nan inf) %{{.*}}, float noundef nofpclass(nan inf) %{{.*}}){{.*}} [[ATTRS:#[0-9]+]]22// NOFINITEONLY:    define{{.*}} float @foo(float noundef %{{.*}}, float noundef %{{.*}}){{.*}} [[ATTRS:#[0-9]+]]23 24// CHECK:              attributes [[ATTRS]] = {25// CHECK-SAME:           "no-signed-zeros-fp-math"="true"26// CHECK-SAME:           "no-trapping-math"="true"27// CHECK-SAME:         }28