OLD | NEW |
1 ; This is a smoke test for floating-point constant pooling. It tests | 1 ; This is a smoke test for floating-point constant pooling. It tests |
2 ; pooling of various float and double constants (including positive | 2 ; pooling of various float and double constants (including positive |
3 ; and negative NaN) within functions and across functions. Note that | 3 ; and negative NaN) within functions and across functions. Note that |
4 ; in LLVM bitcode, hex constants are used for an FP constant whenever | 4 ; in LLVM bitcode, hex constants are used for an FP constant whenever |
5 ; the constant "cannot be represented as a decimal floating point | 5 ; the constant "cannot be represented as a decimal floating point |
6 ; number in a reasonable number of digits". See | 6 ; number in a reasonable number of digits". See |
7 ; http://llvm.org/docs/LangRef.html#simple-constants . | 7 ; http://llvm.org/docs/LangRef.html#simple-constants . |
8 | 8 |
| 9 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s |
9 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 10 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
10 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 11 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
11 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 12 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
12 ; RUN: | FileCheck --check-prefix=DUMP %s | 13 ; RUN: | FileCheck --check-prefix=DUMP %s |
13 | 14 |
14 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 15 @__init_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
15 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 | 16 @__fini_array_start = internal constant [0 x i8] zeroinitializer, align 4 |
16 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 | 17 @__tls_template_start = internal constant [0 x i8] zeroinitializer, align 8 |
17 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 | 18 @__tls_template_alignment = internal constant [4 x i8] c"\01\00\00\00", align 4 |
18 | 19 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 %call66 = call float @Dummy(i32 -110) | 528 %call66 = call float @Dummy(i32 -110) |
528 %conv67 = fpext float %call66 to double | 529 %conv67 = fpext float %call66 to double |
529 %add68 = fadd double %conv67, 0xFFF8000000000000 | 530 %add68 = fadd double %conv67, 0xFFF8000000000000 |
530 br label %return | 531 br label %return |
531 | 532 |
532 return: ; preds = %entry, %sw.bb65, %s
w.bb61, %sw.bb57, %sw.bb53, %sw.bb49, %sw.bb45, %sw.bb41, %sw.bb37, %sw.bb33, %s
w.bb29, %sw.bb25, %sw.bb21, %sw.bb17, %sw.bb13, %sw.bb9, %sw.bb5, %sw.bb1, %sw.b
b | 533 return: ; preds = %entry, %sw.bb65, %s
w.bb61, %sw.bb57, %sw.bb53, %sw.bb49, %sw.bb45, %sw.bb41, %sw.bb37, %sw.bb33, %s
w.bb29, %sw.bb25, %sw.bb21, %sw.bb17, %sw.bb13, %sw.bb9, %sw.bb5, %sw.bb1, %sw.b
b |
533 %retval.0 = phi double [ %add68, %sw.bb65 ], [ %add64, %sw.bb61 ], [ %add60, %
sw.bb57 ], [ %add56, %sw.bb53 ], [ %add52, %sw.bb49 ], [ %conv48, %sw.bb45 ], [
%conv44, %sw.bb41 ], [ %conv40, %sw.bb37 ], [ %conv36, %sw.bb33 ], [ %add32, %sw
.bb29 ], [ %add28, %sw.bb25 ], [ %add24, %sw.bb21 ], [ %add20, %sw.bb17 ], [ %ad
d16, %sw.bb13 ], [ %conv12, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ],
[ %conv, %sw.bb ], [ 0.000000e+00, %entry ] | 534 %retval.0 = phi double [ %add68, %sw.bb65 ], [ %add64, %sw.bb61 ], [ %add60, %
sw.bb57 ], [ %add56, %sw.bb53 ], [ %add52, %sw.bb49 ], [ %conv48, %sw.bb45 ], [
%conv44, %sw.bb41 ], [ %conv40, %sw.bb37 ], [ %conv36, %sw.bb33 ], [ %add32, %sw
.bb29 ], [ %add28, %sw.bb25 ], [ %add24, %sw.bb21 ], [ %add20, %sw.bb17 ], [ %ad
d16, %sw.bb13 ], [ %conv12, %sw.bb9 ], [ %conv8, %sw.bb5 ], [ %conv4, %sw.bb1 ],
[ %conv, %sw.bb ], [ 0.000000e+00, %entry ] |
534 ret double %retval.0 | 535 ret double %retval.0 |
535 } | 536 } |
536 | 537 |
| 538 ; The FP constant pool entries for each type are dumped in some |
| 539 ; implementation-dependent order. So for the purposes of lit, we just |
| 540 ; pick one value for each type, and make sure it appears exactly once. |
| 541 |
| 542 ; Check for float 0.5 |
| 543 ; CHECK: .long 0x3f000000 |
| 544 ; CHECK-NOT: .long 0x3f000000 |
| 545 ; Check for double 0.5 |
| 546 ; CHECK: .quad 0x3fe0000000000000 |
| 547 ; CHECK-NOT: .quad 0x3fe0000000000000 |
| 548 |
537 ; ERRORS-NOT: ICE translation error | 549 ; ERRORS-NOT: ICE translation error |
538 ; DUMP-NOT: SZ | 550 ; DUMP-NOT: SZ |
OLD | NEW |