| Manman Ren | f46262e | 2016-03-29 17:37:21 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs < %s -mtriple=x86_64-unknown-unknown | FileCheck %s |
| 2 | ; RUN: llc -O0 -verify-machineinstrs < %s -mtriple=x86_64-unknown-unknown | FileCheck --check-prefix=CHECK-O0 %s |
| 3 | ; RUN: llc -verify-machineinstrs < %s -march=x86 -mcpu=yonah -mtriple=i386-apple-darwin | FileCheck --check-prefix=CHECK-i386 %s |
| 4 | ; RUN: llc -O0 -verify-machineinstrs < %s -march=x86 -mcpu=yonah -mtriple=i386-apple-darwin | FileCheck --check-prefix=CHECK-i386-O0 %s |
| 5 | |
| 6 | ; Parameter with swiftself should be allocated to r10. |
| 7 | define void @check_swiftself(i32* swiftself %addr0) { |
| 8 | ; CHECK-LABEL: check_swiftself: |
| 9 | ; CHECK-O0-LABEL: check_swiftself: |
| 10 | ; CHECK-i386-LABEL: check_swiftself: |
| 11 | ; CHECK-i386-O0-LABEL: check_swiftself: |
| 12 | |
| 13 | %val0 = load volatile i32, i32* %addr0 |
| 14 | ; CHECK: movl (%r10), |
| 15 | ; CHECK-O0: movl (%r10), |
| 16 | ; CHECK-i386: movl {{[0-9a-f]+}}(%esp) |
| 17 | ; CHECK-i386-O0: movl {{[0-9a-f]+}}(%esp) |
| 18 | ret void |
| 19 | } |
| 20 | |
| 21 | @var8_3 = global i8 0 |
| 22 | declare void @take_swiftself(i8* swiftself %addr0) |
| 23 | |
| 24 | define void @simple_args() { |
| 25 | ; CHECK-LABEL: simple_args: |
| 26 | ; CHECK-O0-LABEL: simple_args: |
| 27 | ; CHECK-i386-LABEL: simple_args: |
| 28 | ; CHECK-i386-O0-LABEL: simple_args: |
| 29 | |
| 30 | call void @take_swiftself(i8* @var8_3) |
| 31 | ; CHECK: movl {{.*}}, %r10d |
| 32 | ; CHECK: callq {{_?}}take_swiftself |
| 33 | ; CHECK-O0: movabsq {{.*}}, %r10 |
| 34 | ; CHECK-O0: callq {{_?}}take_swiftself |
| 35 | ; CHECK-i386: movl {{.*}}, (%esp) |
| 36 | ; CHECK-i386: calll {{.*}}take_swiftself |
| 37 | ; CHECK-i386-O0: movl {{.*}}, (%esp) |
| 38 | ; CHECK-i386-O0: calll {{.*}}take_swiftself |
| 39 | |
| 40 | ret void |
| 41 | } |