| OLD | NEW |
| 1 ; Simple test that returns various immediates. For fixed-width instruction | 1 ; Simple test that returns various immediates. For fixed-width instruction |
| 2 ; sets, some immediates are more complicated than others. | 2 ; sets, some immediates are more complicated than others. |
| 3 ; For x86-32, it shouldn't be a problem. | 3 ; For x86-32, it shouldn't be a problem. |
| 4 | 4 |
| 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ | 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ |
| 6 ; RUN: -allow-externally-defined-symbols | FileCheck %s | 6 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
| 7 | 7 |
| 8 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) | 8 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) |
| 9 ; once enough infrastructure is in. Also, switch to --filetype=obj | 9 ; once enough infrastructure is in. Also, switch to --filetype=obj |
| 10 ; when possible. | 10 ; when possible. |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 296 |
| 297 ; 64-bit immediates. | 297 ; 64-bit immediates. |
| 298 | 298 |
| 299 define internal i64 @ret_64bits_shift_left0() { | 299 define internal i64 @ret_64bits_shift_left0() { |
| 300 ret i64 1095216660735 | 300 ret i64 1095216660735 |
| 301 } | 301 } |
| 302 ; CHECK-LABEL: ret_64bits_shift_left0 | 302 ; CHECK-LABEL: ret_64bits_shift_left0 |
| 303 ; CHECK-NEXT: mov eax,0xff | 303 ; CHECK-NEXT: mov eax,0xff |
| 304 ; CHECK-NEXT: mov edx,0xff | 304 ; CHECK-NEXT: mov edx,0xff |
| 305 ; ARM32-LABEL: ret_64bits_shift_left0 | 305 ; ARM32-LABEL: ret_64bits_shift_left0 |
| 306 ; ARM32-NEXT: movw r0, #255 | 306 ; ARM32-NEXT: mov r0, #255 |
| 307 ; ARM32-NEXT: movw r1, #255 | 307 ; ARM32-NEXT: mov r1, #255 |
| 308 ; MIPS32-LABEL: ret_64bits_shift_left0 | 308 ; MIPS32-LABEL: ret_64bits_shift_left0 |
| 309 ; MIPS32-NEXT: li v0,255 | 309 ; MIPS32-NEXT: li v0,255 |
| 310 ; MIPS32-NEXT: li v1,255 | 310 ; MIPS32-NEXT: li v1,255 |
| 311 | 311 |
| 312 | 312 |
| 313 ; A relocatable constant is assumed to require 32-bits along with | 313 ; A relocatable constant is assumed to require 32-bits along with |
| 314 ; relocation directives. | 314 ; relocation directives. |
| 315 | 315 |
| 316 declare void @_start() | 316 declare void @_start() |
| 317 | 317 |
| 318 define internal i32 @ret_addr() { | 318 define internal i32 @ret_addr() { |
| 319 %ptr = ptrtoint void ()* @_start to i32 | 319 %ptr = ptrtoint void ()* @_start to i32 |
| 320 ret i32 %ptr | 320 ret i32 %ptr |
| 321 } | 321 } |
| 322 ; CHECK-LABEL: ret_addr | 322 ; CHECK-LABEL: ret_addr |
| 323 ; CHECK-NEXT: mov eax,0x0 {{.*}} R_386_32 _start | 323 ; CHECK-NEXT: mov eax,0x0 {{.*}} R_386_32 _start |
| 324 ; ARM32-LABEL: ret_addr | 324 ; ARM32-LABEL: ret_addr |
| 325 ; ARM32-NEXT: movw r0, #0 {{.*}} R_ARM_MOVW_ABS_NC _start | 325 ; ARM32-NEXT: movw r0, #0 {{.*}} R_ARM_MOVW_ABS_NC _start |
| 326 ; ARM32-NEXT: movt r0, #0 {{.*}} R_ARM_MOVT_ABS _start | 326 ; ARM32-NEXT: movt r0, #0 {{.*}} R_ARM_MOVT_ABS _start |
| 327 ; TODO(RKotler) emitting proper li but in disassembly | 327 ; TODO(RKotler) emitting proper li but in disassembly |
| 328 ; it shows up only in the relocation records. Should emit | 328 ; it shows up only in the relocation records. Should emit |
| 329 ; without the macro but we still need to add GOT implementation | 329 ; without the macro but we still need to add GOT implementation |
| 330 ; to finish this case | 330 ; to finish this case |
| 331 ; | 331 ; |
| OLD | NEW |