Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 ; This tests that different floating point constants (such as 0.0 and -0.0) | |
| 2 ; remain distinct even when they sort of look equal, and also that different | |
| 3 ; instances of the same floating point constant (such as NaN and NaN) get the | |
| 4 ; same constant pool entry even when "a==a" would suggest they are different. | |
| 5 | |
| 6 ; REQUIRES: allow_dump | |
| 7 | |
| 8 define void @consume_float(float %f) { | |
| 9 ret void | |
| 10 } | |
| 11 | |
| 12 define void @consume_double(double %d) { | |
| 13 ret void | |
| 14 } | |
| 15 | |
| 16 define void @test_zeros() { | |
| 17 entry: | |
| 18 call void @consume_float(float 0.0) | |
| 19 call void @consume_float(float -0.0) | |
| 20 call void @consume_double(double 0.0) | |
| 21 call void @consume_double(double -0.0) | |
| 22 ret void | |
| 23 } | |
| 24 ; RUN: %p2i -i %s --insts | FileCheck --check-prefix=ZERO %s | |
|
JF
2015/03/19 16:33:09
Why different RUN lines? It seems like you could j
Jim Stichnoth
2015/03/19 18:07:04
I tried to clarify this in comments, ptal. The ZE
| |
| 25 ; ZERO: test_zeros | |
| 26 ; ZERO-NEXT: entry: | |
| 27 ; ZERO-NEXT: call void @consume_float(float 0.0 | |
| 28 ; ZERO-NEXT: call void @consume_float(float -0.0 | |
| 29 ; ZERO-NEXT: call void @consume_double(double 0.0 | |
| 30 ; ZERO-NEXT: call void @consume_double(double -0.0 | |
| 31 | |
| 32 | |
| 33 define void @test_nans() { | |
| 34 entry: | |
| 35 call void @consume_float(float 0x7FF8000000000000) | |
| 36 call void @consume_float(float 0x7FF8000000000000) | |
| 37 call void @consume_float(float 0xFFF8000000000000) | |
| 38 call void @consume_float(float 0xFFF8000000000000) | |
| 39 call void @consume_double(double 0x7FF8000000000000) | |
| 40 call void @consume_double(double 0x7FF8000000000000) | |
| 41 call void @consume_double(double 0xFFF8000000000000) | |
| 42 call void @consume_double(double 0xFFF8000000000000) | |
| 43 ret void | |
| 44 } | |
| 45 ; RUN: %p2i -i %s --filetype=asm --llvm-source \ | |
| 46 ; RUN: | FileCheck --check-prefix=NANS1 %s | |
| 47 ; NANS1: float nan | |
| 48 ; NANS1-NOT: float nan | |
| 49 | |
| 50 ; RUN: %p2i -i %s --filetype=asm --llvm-source \ | |
| 51 ; RUN: | FileCheck --check-prefix=NANS2 %s | |
| 52 ; NANS2: float -nan | |
| 53 ; NANS2-NOT: float -nan | |
| 54 | |
| 55 ; RUN: %p2i -i %s --filetype=asm --llvm-source \ | |
| 56 ; RUN: | FileCheck --check-prefix=NANS3 %s | |
| 57 ; NANS3: double nan | |
| 58 ; NANS3-NOT: double nan | |
| 59 | |
| 60 ; RUN: %p2i -i %s --filetype=asm --llvm-source \ | |
| 61 ; RUN: | FileCheck --check-prefix=NANS4 %s | |
| 62 ; NANS4: double -nan | |
| 63 ; NANS4-NOT: double -nan | |
| OLD | NEW |