Chad Rosier | f4e832b | 2011-05-18 19:59:50 +0000 | [diff] [blame^] | 1 | ; RUN: llc < %s -march=x86-64 | FileCheck %s |
| 2 | |
| 3 | @.str = private unnamed_addr constant [5 x i8] c"%ld\0A\00" |
| 4 | @sel = external global i8* |
| 5 | @sel3 = external global i8* |
| 6 | @sel4 = external global i8* |
| 7 | @sel5 = external global i8* |
| 8 | @sel6 = external global i8* |
| 9 | @sel7 = external global i8* |
| 10 | |
| 11 | ; CHECK: @foo |
| 12 | ; CHECK: jmp |
| 13 | define void @foo(i64 %arg) nounwind optsize ssp noredzone { |
| 14 | entry: |
| 15 | %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([5 x i8]* @.str, i64 0, i64 0), i64 %arg) nounwind optsize noredzone |
| 16 | ret void |
| 17 | } |
| 18 | |
| 19 | declare i32 @printf(i8*, ...) optsize noredzone |
| 20 | |
| 21 | ; CHECK: @bar |
| 22 | ; CHECK: jmp |
| 23 | define void @bar(i64 %arg) nounwind optsize ssp noredzone { |
| 24 | entry: |
| 25 | tail call void @bar2(i8* getelementptr inbounds ([5 x i8]* @.str, i64 0, i64 0), i64 %arg) nounwind optsize noredzone |
| 26 | ret void |
| 27 | } |
| 28 | |
| 29 | declare void @bar2(i8*, i64) optsize noredzone |
| 30 | |
| 31 | ; CHECK: @foo2 |
| 32 | ; CHECK: jmp |
| 33 | define i8* @foo2(i8* %arg) nounwind optsize ssp noredzone { |
| 34 | entry: |
| 35 | %tmp1 = load i8** @sel, align 8, !tbaa !0 |
| 36 | %call = tail call i8* (i8*, i8*, ...)* @x2(i8* %arg, i8* %tmp1) nounwind optsize noredzone |
| 37 | ret i8* %call |
| 38 | } |
| 39 | |
| 40 | declare i8* @x2(i8*, i8*, ...) optsize noredzone |
| 41 | |
| 42 | ; CHECK: @foo6 |
| 43 | ; CHECK: jmp |
| 44 | define i8* @foo6(i8* %arg1, i8* %arg2) nounwind optsize ssp noredzone { |
| 45 | entry: |
| 46 | %tmp2 = load i8** @sel3, align 8, !tbaa !0 |
| 47 | %tmp3 = load i8** @sel4, align 8, !tbaa !0 |
| 48 | %tmp4 = load i8** @sel5, align 8, !tbaa !0 |
| 49 | %tmp5 = load i8** @sel6, align 8, !tbaa !0 |
| 50 | %call = tail call i8* (i8*, i8*, i8*, ...)* @x3(i8* %arg1, i8* %arg2, i8* %tmp2, i8* %tmp3, i8* %tmp4, i8* %tmp5) nounwind optsize noredzone |
| 51 | ret i8* %call |
| 52 | } |
| 53 | |
| 54 | declare i8* @x3(i8*, i8*, i8*, ...) optsize noredzone |
| 55 | |
| 56 | ; CHECK: @foo7 |
| 57 | ; CHECK: callq |
| 58 | define i8* @foo7(i8* %arg1, i8* %arg2) nounwind optsize ssp noredzone { |
| 59 | entry: |
| 60 | %tmp2 = load i8** @sel3, align 8, !tbaa !0 |
| 61 | %tmp3 = load i8** @sel4, align 8, !tbaa !0 |
| 62 | %tmp4 = load i8** @sel5, align 8, !tbaa !0 |
| 63 | %tmp5 = load i8** @sel6, align 8, !tbaa !0 |
| 64 | %tmp6 = load i8** @sel7, align 8, !tbaa !0 |
| 65 | %call = tail call i8* (i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...)* @x7(i8* %arg1, i8* %arg2, i8* %tmp2, i8* %tmp3, i8* %tmp4, i8* %tmp5, i8* %tmp6) nounwind optsize noredzone |
| 66 | ret i8* %call |
| 67 | } |
| 68 | |
| 69 | declare i8* @x7(i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) optsize noredzone |
| 70 | |
| 71 | ; CHECK: @foo8 |
| 72 | ; CHECK: callq |
| 73 | define i8* @foo8(i8* %arg1, i8* %arg2) nounwind optsize ssp noredzone { |
| 74 | entry: |
| 75 | %tmp2 = load i8** @sel3, align 8, !tbaa !0 |
| 76 | %tmp3 = load i8** @sel4, align 8, !tbaa !0 |
| 77 | %tmp4 = load i8** @sel5, align 8, !tbaa !0 |
| 78 | %tmp5 = load i8** @sel6, align 8, !tbaa !0 |
| 79 | %call = tail call i8* (i8*, i8*, i8*, ...)* @x3(i8* %arg1, i8* %arg2, i8* %tmp2, i8* %tmp3, i8* %tmp4, i8* %tmp5, i32 48879, i32 48879) nounwind optsize noredzone |
| 80 | ret i8* %call |
| 81 | } |
| 82 | |
| 83 | !0 = metadata !{metadata !"any pointer", metadata !1} |
| 84 | !1 = metadata !{metadata !"omnipotent char", metadata !2} |
| 85 | !2 = metadata !{metadata !"Simple C/C++ TBAA", null} |