title: Xcode 7 code coverage reporting not working
body: <p>I'm having problems to get code coverage reporting working in Xcode 7 for a certain iOS project.</p>
  
  <p>I'm following the instructions given here:
  <a href="http://mgrebenets.github.io/mobile%20ci/2015/09/21/code-coverage-for-ios-xcode-7/" rel="nofollow">http://mgrebenets.github.io/mobile%20ci/2015/09/21/code-coverage-for-ios-xcode-7/</a></p>
  
  <p>Of the three projects I tried, two are working fine, but one project is giving me a headache. When using llvm-cov utility to generate a report from the gathered profile data like this:</p>
  
  <pre><code>xcrun llvm-cov report -instr-profile Coverage.profdata MyAppBinary 
  </code></pre>
  
  <p>I receive the error message:</p>
  
  <pre><code>error: Failed to load coverage: The file was not recognized as a valid object file
  </code></pre>
  
  <p>I checked that the "Gather coverage data" is enabled for the Test scheme. I also checked that the -fprofile-instr-generate and -fcoverage-mapping compiler options are passed to clang.</p>
  
  <p>File sizes and types also look valid to me:</p>
  
  <pre><code>ilMac:llvm-cov-test ilja$ ls -la
  total 61976
  drwxr-xr-x   4 ilja  staff       136 14 Okt 21:53 .
  drwxr-xr-x+ 75 ilja  staff      2550 14 Okt 16:31 ..
  -rw-r--r--   1 ilja  staff   1797416 14 Okt 21:53 Coverage.profdata
  -rwxr-xr-x   1 ilja  staff  29932040 14 Okt 16:32 MyAppBinary
  
  ilMac:llvm-cov-test ilja$ file Coverage.profdata 
  Coverage.profdata: data
  
  ilMac:llvm-cov-test ilja$ file MyAppBinary 
  MyAppBinary: Mach-O universal binary with 2 architectures
  MyAppBinary (for architecture i386):    Mach-O executable i386
  MyAppBinary (for architecture x86_64):  Mach-O 64-bit executable x86_64
  </code></pre>
  
  <p>I also noted that the "Coverage" tab in Xcode for the Test run is saying "No coverage data" instead of the indicator bars.</p>
  
  <p>Any idea what I'm doing wrong?</p>