| OLD | NEW |
| 1 ; Tests various aspects of x86 branch encodings (near vs far, | 1 ; Tests various aspects of x86 branch encodings (near vs far, |
| 2 ; forward vs backward, using CFG labels, or local labels). | 2 ; forward vs backward, using CFG labels, or local labels). |
| 3 | 3 |
| 4 ; Use -ffunction-sections so that the offsets reset for each function. | 4 ; Use -ffunction-sections so that the offsets reset for each function. |
| 5 ; RUN: %p2i --assemble --disassemble -i %s --args -O2 --verbose none \ | 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ |
| 6 ; RUN: -ffunction-sections | FileCheck %s | 6 ; RUN: -ffunction-sections | FileCheck %s |
| 7 | 7 |
| 8 ; Use atomic ops as filler, which shouldn't get optimized out. | 8 ; Use atomic ops as filler, which shouldn't get optimized out. |
| 9 declare void @llvm.nacl.atomic.store.i32(i32, i32*, i32) | 9 declare void @llvm.nacl.atomic.store.i32(i32, i32*, i32) |
| 10 declare i32 @llvm.nacl.atomic.load.i32(i32*, i32) | 10 declare i32 @llvm.nacl.atomic.load.i32(i32*, i32) |
| 11 declare i32 @llvm.nacl.atomic.rmw.i32(i32, i32*, i32, i32) | 11 declare i32 @llvm.nacl.atomic.rmw.i32(i32, i32*, i32, i32) |
| 12 | 12 |
| 13 define void @test_near_backward(i32 %iptr, i32 %val) { | 13 define void @test_near_backward(i32 %iptr, i32 %val) { |
| 14 entry: | 14 entry: |
| 15 br label %next | 15 br label %next |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 %success = icmp eq i32 1, %a | 191 %success = icmp eq i32 1, %a |
| 192 br i1 %success, label %next, label %next2 | 192 br i1 %success, label %next, label %next2 |
| 193 } | 193 } |
| 194 ; CHECK-LABEL: test_local_backward | 194 ; CHECK-LABEL: test_local_backward |
| 195 ; CHECK: 9: {{.*}} mov {{.*}},DWORD | 195 ; CHECK: 9: {{.*}} mov {{.*}},DWORD |
| 196 ; CHECK: b: {{.*}} mov | 196 ; CHECK: b: {{.*}} mov |
| 197 ; CHECK-NEXT: d: {{.*}} xor | 197 ; CHECK-NEXT: d: {{.*}} xor |
| 198 ; CHECK-NEXT: f: {{.*}} lock cmpxchg | 198 ; CHECK-NEXT: f: {{.*}} lock cmpxchg |
| 199 ; CHECK-NEXT: 13: 75 f6 jne b | 199 ; CHECK-NEXT: 13: 75 f6 jne b |
| 200 ; CHECK: 1c: 74 eb je 9 | 200 ; CHECK: 1c: 74 eb je 9 |
| OLD | NEW |