#include <inttypes.h>
#include <stdio.h>

extern "C" void _T3fib5printFT1iNSs5int64_T_(int64_t l) {
  printf("%lld\n", l);
}

extern "C" void _T3fib5printFT1iNS_6double_T_(double l) {
  printf("%f\n", l);
}

extern "C" void _T5nbody5printFT1iNSs6double_T_(double l) {
  printf("%f\n", l);
}

// This cannot be implemented in swift.swift until we have pattern matching.
extern "C" bool _TSs19convertToLogicValueFT1vNSs4bool_i1(bool b) {
  return b;
}

extern "C"
double
_TNSs6double26convert_from_float_literalFT3valf64_S_(double x)
{
    return x;
}

#include <inttypes.h>
#include <stdio.h>

extern "C" bool _TSsop2leFT3lhsNSs5int643rhsS__NSs4bool(int64_t l, int64_t r) {
  return l <= r;
}


extern "C" double _TSsop1sFT1aNSs6double_S_(double x) {
    return -x;
}

extern "C" void _T3fib5printFT1iNSs5int64_T_(int64_t l) {
  printf("%lld\n", l);
}

extern "C" void _T3fib5printFT1iNS_6double_T_(double l) {
  printf("%f\n", l);
}

extern "C" void _T5nbody5printFT1iNSs6double_T_(double l) {
  printf("%f\n", l);
}

extern "C" bool _TSs19convertToLogicValueFT1vNSs4bool_i1(bool b) {
  return b;
}

extern "C"
double
_TNSs6double26convert_from_float_literalFT3valf64_S_(double x)
{
    return x;
}

--- 
+++ 
@@ -1,14 +1,5 @@
 #include <inttypes.h>
 #include <stdio.h>
-
-extern "C" bool _TSsop2leFT3lhsNSs5int643rhsS__NSs4bool(int64_t l, int64_t r) {
-  return l <= r;
-}
-
-
-extern "C" double _TSsop1sFT1aNSs6double_S_(double x) {
-    return -x;
-}
 
 extern "C" void _T3fib5printFT1iNSs5int64_T_(int64_t l) {
   printf("%lld\n", l);
@@ -22,6 +13,7 @@
   printf("%f\n", l);
 }
 
+// This cannot be implemented in swift.swift until we have pattern matching.
 extern "C" bool _TSs19convertToLogicValueFT1vNSs4bool_i1(bool b) {
   return b;
 }
Implement all the integer comparison operators in swift.swift.  Despite
the indirection, each of these compiles into nice simple IR at -O3, with:
 swift swift.swift -I test -emit-llvm | opt -O3 -S | less

for example:

define i1 @_TSsop1gFT3lhsNSs5int643rhsS__NSs4bool(i64, i64) nounwind readnone {
entry:
  %2 = icmp sgt i64 %0, %1
  ret i1 %2
}



Swift SVN r1125
