forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dmd-rewrite-stable' into merge_s…
…table Conflicts: tests/dmd/compilable/vcg-ast.d
- Loading branch information
Showing
16 changed files
with
161 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
struct O | ||
{ | ||
invariant() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// https://issues.dlang.org/show_bug.cgi?id=24760 | ||
|
||
long f(int e = 0, uint[] optional...) => optional.length; | ||
long f0() => f(); // compiler segfaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
REQUIRED_ARGS: -vcg-ast -o- | ||
OUTPUT_FILES: compilable/vcg_ast_compilable.d.cg | ||
TEST_OUTPUT: | ||
--- | ||
=== compilable/vcg_ast_compilable.d.cg | ||
import object; | ||
auto binaryFun(E)(E b) | ||
{ | ||
return 'a' == b; | ||
} | ||
void find(Element)(Element needle) if (is(typeof(binaryFun(needle)))) | ||
{ | ||
} | ||
void find()(string needle) | ||
{ | ||
} | ||
void splitter() | ||
{ | ||
find(3); | ||
find(""); | ||
} | ||
binaryFun!int | ||
{ | ||
auto pure nothrow @nogc @safe bool binaryFun(int b) | ||
{ | ||
return 97 == b; | ||
} | ||
} | ||
find!int | ||
{ | ||
pure nothrow @nogc @safe void find(int needle) | ||
{ | ||
} | ||
} | ||
binaryFun!string | ||
{ | ||
auto _error_ binaryFun | ||
{ | ||
__error__ | ||
} | ||
} | ||
find!() | ||
{ | ||
pure nothrow @nogc @safe void find(string needle) | ||
{ | ||
} | ||
} | ||
--- | ||
*/ | ||
|
||
// https://issues.dlang.org/show_bug.cgi?id=24431 | ||
auto binaryFun(E)(E b) | ||
{ | ||
return 'a' == b; | ||
} | ||
|
||
void find(Element)(Element needle) if (is(typeof(binaryFun(needle)))) { } | ||
void find()(string needle) { } | ||
|
||
void splitter() | ||
{ | ||
find!int(3); | ||
find!()(""); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag24812.d(7): Error: enum `diag24812.Foo` enum `Foo` must have at least one member | ||
--- | ||
*/ | ||
enum Foo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import core.stdc.stdio; | ||
|
||
pragma(inline, true) | ||
double sqrt(double x) | ||
{ | ||
static import core.math; | ||
return core.math.sqrt(x); | ||
} | ||
|
||
int main() | ||
{ | ||
double q = -5.0; | ||
double r = q + 1.0; | ||
double result = sqrt(-r); | ||
//printf("%f\n", result); | ||
assert(result == 2); | ||
return 0; | ||
} |