Skip to content

Commit

Permalink
tests/codegen/inlining_stdlib.d: Find another Phobos function to be i…
Browse files Browse the repository at this point in the history
…nlined

As `std.string.fromStringz()` is now a template.
Use `std.math.nextDown(double)` instead.
  • Loading branch information
kinke committed Jun 19, 2018
1 parent 33631ce commit 072a030
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/codegen/inlining_stdlib.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ int foo(size_t i)

// OPT0-LABEL: define{{.*}} @ggg(
// OPT3-LABEL: define{{.*}} @ggg(
char[] ggg(char* str)
double ggg(double r)
{
// std.string.fromStringz() is inlined when optimizing
import std.string;
// OPT0: call {{.*}} @{{.*}}D3std6string__T11fromStringz
// OPT3: call {{.*}}strlen
return fromStringz(str);
// std.math.nextDown() is inlined when optimizing
import std.math;
// OPT0: call {{.*}} @{{.*}}D3std4math8nextDown
// OPT3: call {{.*}} @{{.*}}D3std4math6nextUp
return nextDown(r);
// OPT0: ret
// OPT3: ret
}
// OPT0: declare {{.*}}D3std6string__T11fromStringz
// OPT3: declare {{.*}}strlen
// OPT0: declare {{.*}}D3std4math8nextDown
// OPT3: declare {{.*}}D3std4math6nextUp

0 comments on commit 072a030

Please sign in to comment.