Make main do some simple work without requiring main arguments to be happy
authorChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2001 19:18:01 +0000 (19:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 15 Oct 2001 19:18:01 +0000 (19:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@842 91177308-0d34-0410-b5e6-96231b3b80d8

test/fib.ll

index db0bca5d142794457a656be28c57f47d6b305d67..933311dc3d58ab4c66db29613cdc1adaed8b45af 100644 (file)
@@ -19,7 +19,7 @@ RecurseCase:
   ret ulong %result
 end
 
-ulong "main"(int %argc, sbyte ** %argv)
+ulong "realmain"(int %argc, sbyte ** %argv)
 begin
   seteq int %argc, 2      ; {bool}:0
   br bool %0, label %HasArg, label %Continue
@@ -34,3 +34,11 @@ Continue:
   %F = call ulong(ulong) *%fib(ulong %N)
   ret ulong %F
 end
+
+int "main"()
+begin
+  %Result = call ulong %fib(ulong 10)
+  %Result = cast ulong %Result to int
+  ret int %Result
+end
+