{"id":14591,"date":"2016-05-20T10:49:44","date_gmt":"2016-05-20T14:49:44","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=14591"},"modified":"2016-05-20T10:49:44","modified_gmt":"2016-05-20T14:49:44","slug":"code-coverage-from-the-command-line-with-clang","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/05\/20\/code-coverage-from-the-command-line-with-clang\/","title":{"rendered":"Code Coverage From the Command Line With Clang"},"content":{"rendered":"<p><a href=\"https:\/\/alastairs-place.net\/blog\/2016\/05\/20\/code-coverage-from-the-command-line-with-clang\/\">Alastair Houghton<\/a>:<\/p>\n<blockquote cite=\"https:\/\/alastairs-place.net\/blog\/2016\/05\/20\/code-coverage-from-the-command-line-with-clang\/\">\n<p>Having searched the Internet several times to find out how to get coverage\ninformation out of <code>clang<\/code>, I ended up feeling rather confused.  I&rsquo;m sure I&rsquo;m\nnot the only one.  The reason for the confusion is fairly simple; <code>clang<\/code>\nsupports <em>two different coverage tools<\/em>, one of which uses a tool with a name\nthat used to be used by the other one!<\/p>\n<p>[&#8230;]<\/p>\n<p><strong>In both cases<\/strong>, you need to pass the coverage options to the <code>clang<\/code> or\n<code>clang++<\/code> driver when you are <em>linking<\/em> as well as when you are compiling.\nThis will cause <code>clang<\/code> to link with any libraries required by the profiling\nsystem.  You <em>do not<\/em> need to explicitly link with a profiling library when\nusing <code>clang<\/code>.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Alastair Houghton: Having searched the Internet several times to find out how to get coverage information out of clang, I ended up feeling rather confused. I&rsquo;m sure I&rsquo;m not the only one. The reason for the confusion is fairly simple; clang supports two different coverage tools, one of which uses a tool with a name [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[326,230,31,30,54,71,268],"class_list":["post-14591","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c-plus-plus","tag-clang","tag-ios","tag-mac","tag-objective-c","tag-programming","tag-testing"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=14591"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14591\/revisions"}],"predecessor-version":[{"id":14593,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/14591\/revisions\/14593"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=14591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=14591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=14591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}