xref: /llvm-project/clang/test/CodeGen/X86/32bit-behavior.c (revision 39db5e1ed87363a9ffea81e53520b542201b3262)
1 // SSE
2 // 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 %s
6 
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 %s
11 
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 %s
16 
17 // NO SSE
18 // 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 %s
22 
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 %s
27 
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 %s
32 
addit(float a,float b,float c)33 float addit(float a, float b, float c) {
34   // CHECK-SRC: load float, ptr
35   // CHECK-SRC: load float, ptr
36   // CHECK-SRC: fadd float
37   // CHECK-SRC: load float, ptr
38   // CHECK-SRC: fadd float
39 
40   // CHECK-DBL: load float, ptr
41   // CHECK-DBL: fpext float {{.*}} to double
42   // CHECK-DBL: load float, ptr
43   // CHECK-DBL: fpext float {{.*}} to double
44   // CHECK-DBL: fadd double
45   // CHECK-DBL: load float, ptr
46   // CHECK-DBL: fpext float {{.*}} to double
47   // CHECK-DBL: fadd double
48   // CHECK-DBL: fptrunc double {{.*}} to float
49 
50   // CHECK: ret float
51   return a + b + c;
52 }
53