53 lines · c
1// SSE2// RUN: %clang_cc1 -fexperimental-strict-floating-point \3// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature +sse \4// RUN: -emit-llvm -o - %s -ffp-eval-method=source \5// RUN: | FileCheck -check-prefix=CHECK-SRC %s6 7// RUN: %clang_cc1 -fexperimental-strict-floating-point \8// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature +sse \9// RUN: -emit-llvm -o - %s -ffp-eval-method=double \10// RUN: | FileCheck -check-prefix=CHECK-DBL %s11 12// RUN: %clang_cc1 -fexperimental-strict-floating-point \13// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature +sse \14// RUN: -emit-llvm -o - %s -ffp-eval-method=extended \15// RUN: | FileCheck -check-prefix=CHECK-DBL %s16 17// NO SSE18// RUN: %clang_cc1 -fexperimental-strict-floating-point \19// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature -sse \20// RUN: -emit-llvm -o - %s -ffp-eval-method=source \21// RUN: | FileCheck -check-prefix=CHECK-SRC %s22 23// RUN: %clang_cc1 -fexperimental-strict-floating-point \24// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature -sse \25// RUN: -emit-llvm -o - %s -ffp-eval-method=double \26// RUN: | FileCheck -check-prefix=CHECK-DBL %s27 28// RUN: %clang_cc1 -fexperimental-strict-floating-point \29// RUN: -triple i386-pc-windows -target-cpu pentium4 -target-feature -sse \30// RUN: -emit-llvm -o - %s -ffp-eval-method=extended \31// RUN: | FileCheck -check-prefix=CHECK-DBL %s32 33float addit(float a, float b, float c) {34 // CHECK-SRC: load float, ptr35 // CHECK-SRC: load float, ptr36 // CHECK-SRC: fadd float37 // CHECK-SRC: load float, ptr38 // CHECK-SRC: fadd float39 40 // CHECK-DBL: load float, ptr41 // CHECK-DBL: fpext float {{.*}} to double42 // CHECK-DBL: load float, ptr43 // CHECK-DBL: fpext float {{.*}} to double44 // CHECK-DBL: fadd double45 // CHECK-DBL: load float, ptr46 // CHECK-DBL: fpext float {{.*}} to double47 // CHECK-DBL: fadd double48 // CHECK-DBL: fptrunc double {{.*}} to float49 50 // CHECK: ret float51 return a + b + c;52}53