зеркало из https://github.com/microsoft/clang-1.git
FP_CONTRACT: Fix two tests for -Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165024 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
632dcc92f6
Коммит
438daee6ee
|
@ -3,8 +3,7 @@
|
|||
// Is FP_CONTRACT is honored in a simple case?
|
||||
float fp_contract_1(float a, float b, float c) {
|
||||
// CHECK: _Z13fp_contract_1fff
|
||||
// CHECK-NEXT: entry
|
||||
// CHECK-NEXT: %0 = tail call float @llvm.fmuladd
|
||||
// CHECK: tail call float @llvm.fmuladd
|
||||
#pragma STDC FP_CONTRACT ON
|
||||
return a * b + c;
|
||||
}
|
||||
|
@ -12,9 +11,8 @@ float fp_contract_1(float a, float b, float c) {
|
|||
// Is FP_CONTRACT state cleared on exiting compound statements?
|
||||
float fp_contract_2(float a, float b, float c) {
|
||||
// CHECK: _Z13fp_contract_2fff
|
||||
// CHECK-NEXT: entry
|
||||
// CHECK-NEXT: %mul = fmul float %a, %b
|
||||
// CHECK-NEXT: %add = fadd float %mul, %c
|
||||
// CHECK: %[[M:.+]] = fmul float %a, %b
|
||||
// CHECK-NEXT: fadd float %[[M]], %c
|
||||
{
|
||||
#pragma STDC FP_CONTRACT ON
|
||||
}
|
||||
|
@ -33,7 +31,6 @@ T template_muladd(T a, T b, T c) {
|
|||
|
||||
float fp_contract_3(float a, float b, float c) {
|
||||
// CHECK: _Z13fp_contract_3fff
|
||||
// CHECK-NEXT: entry
|
||||
// CHECK-NEXT: %0 = tail call float @llvm.fmuladd
|
||||
// CHECK: tail call float @llvm.fmuladd
|
||||
return template_muladd<float>(a, b, c);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// RUN: %clang_cc1 %s -cl-single-precision-constant -emit-llvm -o - | FileCheck %s
|
||||
|
||||
float fn(float f) {
|
||||
// CHECK: %0 = tail call float @llvm.fmuladd.f32(float %f, float 2.000000e+00, float 1.000000e+00)
|
||||
// CHECK: tail call float @llvm.fmuladd.f32(float %f, float 2.000000e+00, float 1.000000e+00)
|
||||
return f*2. + 1.;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче