mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
31 lines
730 B
D
31 lines
730 B
D
// PERMUTE_ARGS:
|
|
// REQUIRED_ARGS: -profile
|
|
// POST_SCRIPT: runnable/extra-files/hello-profile-postscript.sh
|
|
// EXECUTE_ARGS: ${RESULTS_DIR}/runnable
|
|
|
|
module hello;
|
|
|
|
extern(C)
|
|
{
|
|
int printf(const char*, ...);
|
|
int trace_setlogfilename(string name);
|
|
int trace_setdeffilename(string name);
|
|
}
|
|
|
|
void showargs(string[] args)
|
|
{
|
|
printf("hello world\n");
|
|
printf("args.length = %zd\n", args.length);
|
|
for (int i = 0; i < args.length; i++)
|
|
printf("args[%d] = '%.*s'\n", i, cast(int)args[i].length, args[i].ptr);
|
|
}
|
|
|
|
int main(string[] args)
|
|
{
|
|
trace_setlogfilename(args[1] ~ "/hello-profile.d.trace.log");
|
|
trace_setdeffilename(args[1] ~ "/hello-profile.d.trace.def");
|
|
|
|
showargs(args);
|
|
|
|
return 0;
|
|
}
|