Rong Xu | 9837ef5 | 2016-02-04 18:39:09 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t |
Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame] | 2 | // RUN: FileCheck -input-file %t %s |
| 3 | // RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s |
Justin Bogner | 00270df | 2015-01-22 02:17:23 +0000 | [diff] [blame] | 4 | |
| 5 | // Since foo is never emitted, there should not be a profile name for it. |
| 6 | |
Xinliang David Li | ddbdb1e | 2015-12-15 00:33:12 +0000 | [diff] [blame] | 7 | // CHECK-DAG: @__profn_bar = {{.*}} [3 x i8] c"bar", section "{{.*}}__llvm_prf_names" |
| 8 | // CHECK-DAG: @__profn_baz = {{.*}} [3 x i8] c"baz", section "{{.*}}__llvm_prf_names" |
| 9 | // CHECK-DAG: @__profn_unused_names.c_qux = {{.*}} [18 x i8] c"unused_names.c:qux", section "{{.*}}__llvm_prf_names" |
Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame] | 10 | |
Xinliang David Li | ddbdb1e | 2015-12-15 00:33:12 +0000 | [diff] [blame] | 11 | // SYSHEADER-NOT: @__profn_foo = |
Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame] | 12 | |
Justin Bogner | 00270df | 2015-01-22 02:17:23 +0000 | [diff] [blame] | 13 | |
| 14 | #ifdef IS_SYSHEADER |
| 15 | |
| 16 | #pragma clang system_header |
| 17 | inline int foo() { return 0; } |
| 18 | |
| 19 | #else |
| 20 | |
| 21 | #define IS_SYSHEADER |
| 22 | #include __FILE__ |
| 23 | |
| 24 | int bar() { return 0; } |
Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame] | 25 | inline int baz() { return 0; } |
| 26 | static int qux() { return 42; } |
Justin Bogner | 00270df | 2015-01-22 02:17:23 +0000 | [diff] [blame] | 27 | |
| 28 | #endif |