-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1845 from LemonBoy/instr
Implement -finstrument-functions.
- Loading branch information
Showing
7 changed files
with
81 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// RUN: %ldc -c -output-ll -finstrument-functions -of=%t.ll %s && FileCheck %s < %t.ll | ||
|
||
void fun0 () { | ||
// CHECK-LABEL: define{{.*}} @{{.*}}4fun0FZv | ||
// CHECK: call void @__cyg_profile_func_enter | ||
// CHECK: call void @__cyg_profile_func_exit | ||
// CHECK-NEXT: ret | ||
return; | ||
} | ||
|
||
pragma(LDC_profile_instr, false) | ||
int fun1 (int x) { | ||
// CHECK-LABEL: define{{.*}} @{{.*}}4fun1FiZi | ||
// CHECK-NOT: call void @__cyg_profile_func_enter | ||
// CHECK-NOT: call void @__cyg_profile_func_exit | ||
return 42; | ||
} | ||
|
||
bool fun2 (int x) { | ||
// CHECK-LABEL: define{{.*}} @{{.*}}4fun2FiZb | ||
if (x < 10) | ||
// CHECK: call void @__cyg_profile_func_exit | ||
// CHECK-NEXT: ret | ||
return true; | ||
|
||
// CHECK: call void @__cyg_profile_func_exit | ||
// CHECK-NEXT: ret | ||
return false; | ||
} |