mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 11:03:14 +01:00
Removed tango from the repository and instead added a runtime dir with the files needed to patch and build tango from svn.
Reworked the LLVMDC specific pragmas.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
module alloca1;
|
||||
|
||||
pragma(LLVM_internal, "alloca")
|
||||
void* alloca(uint);
|
||||
pragma(alloca) void* alloca(uint);
|
||||
|
||||
extern(C) int printf(char*, ...);
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ module arrays7;
|
||||
|
||||
extern(C) int printf(char*, ...);
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module bug44;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct rgb
|
||||
{
|
||||
long l;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module bug49;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
module bug50;
|
||||
extern(C) int printf(char*, ...);
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -24,7 +24,7 @@ extern(C)
|
||||
int rand();
|
||||
}
|
||||
|
||||
import llvm.intrinsic;
|
||||
import llvmdc.intrinsics;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
import llvm.intrinsic;
|
||||
import llvmdc.intrinsics;
|
||||
|
||||
extern(C) int printf(char*,...);
|
||||
extern(C) int scanf(char*,...);
|
||||
|
||||
void main()
|
||||
{
|
||||
{
|
||||
float f;
|
||||
printf("Enter float: ");
|
||||
scanf("%f", &f);
|
||||
float sf = llvm_sqrt(f);
|
||||
//scanf("%f", &f);
|
||||
f = 1.22345;
|
||||
float sf = llvm_sqrt_f32(f);
|
||||
printf("sqrt(%f) = %f\n", f, sf);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
double d;
|
||||
printf("Enter double: ");
|
||||
scanf("%lf", &d);
|
||||
double sd = llvm_sqrt(d);
|
||||
//scanf("%lf", &d);
|
||||
d = 2.2311167895435245;
|
||||
double sd = llvm_sqrt_f64(d);
|
||||
printf("sqrt(%lf) = %lf\n", d, sd);
|
||||
}
|
||||
|
||||
{
|
||||
real d;
|
||||
|
||||
real r;
|
||||
printf("Enter real: ");
|
||||
scanf("%lf", &d);
|
||||
real sd = llvm_sqrt(d);
|
||||
printf("sqrt(%lf) = %lf\n", d, sd);
|
||||
//scanf("%lf", &d);
|
||||
r = 3.2311167891231231234754764576;
|
||||
version(LLVM_X86_FP80)
|
||||
{
|
||||
real sr = llvm_sqrt_f80(r);
|
||||
printf("sqrt(%llf) = %llf\n", r, sr);
|
||||
}
|
||||
else
|
||||
{
|
||||
real sr = llvm_sqrt_f64(r);
|
||||
printf("sqrt(%lf) = %lf\n", r, sr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module structs7;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct S
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module union1;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
union U
|
||||
{
|
||||
float f;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module union2;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
union U
|
||||
{
|
||||
float f;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module union3;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
union vec3
|
||||
{
|
||||
struct { float x,y,z; }
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module union4;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
union U {
|
||||
struct { float x,y,z; }
|
||||
float[3] xyz;
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
module union5;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
union S
|
||||
{
|
||||
union S
|
||||
{
|
||||
T t;
|
||||
U u;
|
||||
uint i;
|
||||
struct {
|
||||
ushort sl,sh;
|
||||
}
|
||||
T t;
|
||||
U u;
|
||||
uint i;
|
||||
struct {
|
||||
ushort sl,sh;
|
||||
}
|
||||
}
|
||||
|
||||
struct T
|
||||
{
|
||||
int i;
|
||||
}
|
||||
struct T
|
||||
{
|
||||
int i;
|
||||
}
|
||||
|
||||
struct U
|
||||
{
|
||||
float f;
|
||||
}
|
||||
struct U
|
||||
{
|
||||
float f;
|
||||
}
|
||||
|
||||
void main()
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
module union6;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo") {
|
||||
struct S
|
||||
{
|
||||
byte a;
|
||||
byte b;
|
||||
}
|
||||
union U
|
||||
{
|
||||
byte a;
|
||||
byte b;
|
||||
S c;
|
||||
}
|
||||
struct S
|
||||
{
|
||||
byte a;
|
||||
byte b;
|
||||
}
|
||||
union U
|
||||
{
|
||||
byte a;
|
||||
byte b;
|
||||
S c;
|
||||
}
|
||||
|
||||
void main()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module union7;
|
||||
|
||||
pragma(LLVM_internal, "notypeinfo")
|
||||
struct Union
|
||||
{
|
||||
union {
|
||||
|
||||
@@ -15,6 +15,6 @@ extern(C) int add(int n, ...)
|
||||
|
||||
void main()
|
||||
{
|
||||
int i = add(4,1,2,3,4);
|
||||
int i = add(4, 1,2,3,4);
|
||||
assert(i == 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user