1; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s 2; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s 3; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s 4; RUN: sed -e "s/RETTYPE/double/;s/RETVAL/0./" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL,DOUBLE %s 5 6; We don't need to save registers before using them inside preserve_none function. 7define preserve_nonecc RETTYPE @preserve_nonecc1(i64, i64, double, double) nounwind { 8entry: 9;ALL-LABEL: preserve_nonecc1 10;ALL: ; %bb.0: 11;ALL-NEXT: InlineAsm Start 12;ALL-NEXT: InlineAsm End 13;DOUBLE-NEXT: movi d0, #0000000000000000 14;ALL-NEXT: ret 15 call void asm sideeffect "", "~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{d0},~{d1},~{d2},~{d3},~{d4},~{d5},~{d6},~{d7},~{d8},~{d9},~{d10},~{d11},~{d12},~{d13},~{d14},~{d15},~{d16}"() 16 ret RETTYPE RETVAL 17} 18 19; When calling a preserve_none function, all live registers must be saved and 20; restored around the function call. 21declare preserve_nonecc RETTYPE @preserve_nonecc2(i64, i64, double, double) 22define void @bar() nounwind { 23entry: 24;ALL-LABEL: bar 25;ALL: InlineAsm Start 26;ALL: stp x9, x8 27;ALL: stp x11, x10 28;ALL: stp x13, x12 29;ALL: stp x15, x14 30;ALL: stp x17, x16 31;ALL: stp x20, x19 32;ALL: stp x22, x21 33;ALL: stp x24, x23 34;ALL: stp x26, x25 35;ALL: stp x28, x27 36;ALL: stp d8, d7 37;ALL: stp d10, d9 38;ALL: stp d12, d11 39;ALL: stp d14, d13 40;ALL: stp d16, d15 41;ALL: ldp x20, x19 42;ALL: ldp x22, x21 43;ALL: ldp x24, x23 44;ALL: ldp x26, x25 45;ALL: ldp x28, x27 46;ALL: ldp d8, d7 47;ALL: ldp d10, d9 48;ALL: ldp d12, d11 49;ALL: ldp d14, d13 50;ALL: ldp d16, d15 51;ALL: ldp x9, x8 52;ALL: ldp x11, x10 53;ALL: ldp x13, x12 54;ALL: ldp x15, x14 55;ALL: ldp x17, x16 56;ALL: InlineAsm Start 57 %a0 = call i64 asm sideeffect "", "={x8}"() nounwind 58 %a1 = call i64 asm sideeffect "", "={x9}"() nounwind 59 %a2 = call i64 asm sideeffect "", "={x10}"() nounwind 60 %a3 = call i64 asm sideeffect "", "={x11}"() nounwind 61 %a4 = call i64 asm sideeffect "", "={x12}"() nounwind 62 %a5 = call i64 asm sideeffect "", "={x13}"() nounwind 63 %a6 = call i64 asm sideeffect "", "={x14}"() nounwind 64 %a7 = call i64 asm sideeffect "", "={x15}"() nounwind 65 %a8 = call i64 asm sideeffect "", "={x16}"() nounwind 66 %a9 = call i64 asm sideeffect "", "={x17}"() nounwind 67 %a10 = call i64 asm sideeffect "", "={x19}"() nounwind 68 %a11 = call i64 asm sideeffect "", "={x20}"() nounwind 69 %a12 = call i64 asm sideeffect "", "={x21}"() nounwind 70 %a13 = call i64 asm sideeffect "", "={x22}"() nounwind 71 %a14 = call i64 asm sideeffect "", "={x23}"() nounwind 72 %a15 = call i64 asm sideeffect "", "={x24}"() nounwind 73 %a16 = call i64 asm sideeffect "", "={x25}"() nounwind 74 %a17 = call i64 asm sideeffect "", "={x26}"() nounwind 75 %a18 = call i64 asm sideeffect "", "={x27}"() nounwind 76 %a19 = call i64 asm sideeffect "", "={x28}"() nounwind 77 78 %f0 = call <1 x double> asm sideeffect "", "={d7}"() nounwind 79 %f1 = call <1 x double> asm sideeffect "", "={d8}"() nounwind 80 %f2 = call <1 x double> asm sideeffect "", "={d9}"() nounwind 81 %f3 = call <1 x double> asm sideeffect "", "={d10}"() nounwind 82 %f4 = call <1 x double> asm sideeffect "", "={d11}"() nounwind 83 %f5 = call <1 x double> asm sideeffect "", "={d12}"() nounwind 84 %f6 = call <1 x double> asm sideeffect "", "={d13}"() nounwind 85 %f7 = call <1 x double> asm sideeffect "", "={d14}"() nounwind 86 %f8 = call <1 x double> asm sideeffect "", "={d15}"() nounwind 87 %f9 = call <1 x double> asm sideeffect "", "={d16}"() nounwind 88 89 call preserve_nonecc RETTYPE @preserve_nonecc2(i64 1, i64 2, double 3.0, double 4.0) 90 call void asm sideeffect "", "{x8},{x9},{x10},{x11},{x12},{x13},{x14},{x15},{x16},{x17},{x19},{x20},{x21},{x22},{x23},{x24},{x25},{x26},{x27},{x28},{d7},{d8},{d9},{d10},{d11},{d12},{d13},{d14},{d15},{d16}"(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i64 %a9, i64 %a10, i64 %a11, i64 %a12, i64 %a13, i64 %a14, i64 %a15, i64 %a16, i64 %a17, i64 %a18, i64 %a19, <1 x double> %f0, <1 x double> %f1, <1 x double> %f2, <1 x double> %f3, <1 x double> %f4, <1 x double> %f5, <1 x double> %f6, <1 x double> %f7, <1 x double> %f8, <1 x double> %f9) 91 ret void 92} 93