brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · e9e18b4 Raw
82 lines · plain
1; RUN: lli -jit-kind=orc-lazy %s a b c | FileCheck %s2 3; CHECK: argc = 44; CHECK-NEXT: argv = ["{{.*}}printargv.ll", "a", "b", "c"]5; CHECK-NEXT: argv[4] = null6 7@.str = private unnamed_addr constant [11 x i8] c"argc = %i\0A\00", align 18@.str.1 = private unnamed_addr constant [9 x i8] c"argv = [\00", align 19@.str.3 = private unnamed_addr constant [5 x i8] c"\22%s\22\00", align 110@.str.4 = private unnamed_addr constant [5 x i8] c"null\00", align 111@.str.5 = private unnamed_addr constant [7 x i8] c", \22%s\22\00", align 112@.str.6 = private unnamed_addr constant [15 x i8] c"argv[%i] = %s\0A\00", align 113@.str.7 = private unnamed_addr constant [5 x i8] c"junk\00", align 114@str.8 = private unnamed_addr constant [2 x i8] c"]\00", align 115 16define i32 @main(i32 %argc, ptr nocapture readonly %argv)  {17entry:18  %call = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %argc)19  %call1 = tail call i32 (ptr, ...) @printf(ptr @.str.1)20  %cmp = icmp eq i32 %argc, 021  br i1 %cmp, label %if.then, label %if.end22 23if.then:24  %puts36 = tail call i32 @puts(ptr @str.8)25  br label %if.end26 27if.end:28  %0 = load ptr, ptr %argv, align 829  %tobool = icmp eq ptr %0, null30  br i1 %tobool, label %if.else, label %if.then331 32if.then3:33  %call5 = tail call i32 (ptr, ...) @printf(ptr @.str.3, ptr %0)34  br label %if.end735 36if.else:37  %call6 = tail call i32 (ptr, ...) @printf(ptr @.str.4)38  br label %if.end739 40if.end7:41  %cmp837 = icmp eq i32 %argc, 142  br i1 %cmp837, label %for.cond.cleanup, label %for.body.preheader43 44for.body.preheader:45  %1 = zext i32 %argc to i6446  br label %for.body47 48for.cond.cleanup:49  %puts = tail call i32 @puts(ptr @str.8)50  %idxprom19 = sext i32 %argc to i6451  %arrayidx20 = getelementptr inbounds ptr, ptr %argv, i64 %idxprom1952  %2 = load ptr, ptr %arrayidx20, align 853  %tobool21 = icmp eq ptr %2, null54  %cond = select i1 %tobool21, ptr @.str.4, ptr @.str.755  %call22 = tail call i32 (ptr, ...) @printf(ptr @.str.6, i32 %argc, ptr %cond)56  ret i32 057 58for.body:59  %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]60  %arrayidx9 = getelementptr inbounds ptr, ptr %argv, i64 %indvars.iv61  %3 = load ptr, ptr %arrayidx9, align 862  %tobool10 = icmp eq ptr %3, null63  br i1 %tobool10, label %if.else15, label %if.then1164 65if.then11:66  %call14 = tail call i32 (ptr, ...) @printf(ptr @.str.5, ptr %3)67  br label %for.inc68 69if.else15:70  %call16 = tail call i32 (ptr, ...) @printf(ptr @.str.4)71  br label %for.inc72 73for.inc:74  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 175  %cmp8 = icmp eq i64 %indvars.iv.next, %176  br i1 %cmp8, label %for.cond.cleanup, label %for.body77}78 79declare i32 @printf(ptr nocapture readonly, ...)80 81declare i32 @puts(ptr nocapture readonly)82