Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t |
| 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 | |
Justin Bogner | 2368c82 | 2015-02-11 02:53:03 +0000 | [diff] [blame^] | 7 | // CHECK-DAG: @__llvm_profile_name_bar = {{.*}} section "{{.*}}__llvm_prf_names" |
| 8 | // CHECK-DAG: @__llvm_profile_name_baz = {{.*}} section "{{.*}}__llvm_prf_names" |
| 9 | // CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} section "{{.*}}__llvm_prf_names" |
| 10 | |
| 11 | // SYSHEADER-NOT: @__llvm_profile_name_foo = |
| 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 |