Skip to content

Commit

Permalink
Tests for bugs 4389 and 4390
Browse files Browse the repository at this point in the history
  • Loading branch information
Don Clugston committed Jan 27, 2011
1 parent ceb271b commit d728641
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions test/compilable/interpret3.d
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,53 @@ static assert(retRefTest1()==2);
static assert(retRefTest2()==2);
static assert(retRefTest3()==26);
static assert(retRefTest4()==218);

int bug4389()
{
string s;
dchar c = '\u2348';
s ~= c;
assert(s.length==3);
dchar d = 'D';
s ~= d;
assert(s.length==4);
s = "";
s ~= c;
assert(s.length==3);
s ~= d;
assert(s.length==4);
string z;
wchar w = '\u0300';
z ~= w;
assert(z.length==2);
z = "";
z ~= w;
assert(z.length==2);
return 1;
}

static assert(bug4389());

// ICE(constfold.c)
int ice4389()
{
string s;
dchar c = '\u2348';
s ~= c;
s = s ~ "xxx";
return 1;
}

static assert(ice4389());

// ICE(expression.c)
string ice4390()
{
string s;
dchar c = '`';
s ~= c;
s ~= c;
return s;
}

static assert(mixin(ice4390()) == ``);

0 comments on commit d728641

Please sign in to comment.