Hi Reid, Quentin (and all),
This patch slightly refactors how clang sets default features for AMD bdver cpus.
Method 'getDefaultFeatures' (in Basic/Targets.cpp), already uses a fallthrough mechanism to set default features for 'bdver4', bdver3 and bdver2. This patch simply adds another fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'. That is because 'bdver2' has the same features available in 'bdver1' plus BMI,FMA,F16C and TBM etc.
While at it, I added missing checks for features in test predefined-arch-macros.c.
In the case of BTVER2, this patch adds explicit checks for F16C, BMI and PCLMUL.
In the case of BDVER3 and BDVER4, this patch checks for the presence of FSGSBASE (added at r221130).
Please let me know if ok to submit.