Index: lib/CodeGen/CGBuiltin.cpp =================================================================== --- lib/CodeGen/CGBuiltin.cpp +++ lib/CodeGen/CGBuiltin.cpp @@ -9016,6 +9016,8 @@ // Grab the global __cpu_model. llvm::Constant *CpuModel = CGM.CreateRuntimeVariable(STy, "__cpu_model"); + cast(CpuModel)->setVisibility( + llvm::GlobalValue::HiddenVisibility); // Calculate the index needed to access the correct field based on the // range. Also adjust the expected value. @@ -9082,6 +9084,8 @@ // Grab the global __cpu_model. llvm::Constant *CpuModel = CGM.CreateRuntimeVariable(STy, "__cpu_model"); + cast(CpuModel)->setVisibility( + llvm::GlobalValue::HiddenVisibility); // Grab the first (0th) element from the field __cpu_features off of the // global in the struct STy. Index: test/CodeGen/builtin-cpu-is.c =================================================================== --- test/CodeGen/builtin-cpu-is.c +++ test/CodeGen/builtin-cpu-is.c @@ -4,6 +4,8 @@ // global, the bit grab, and the icmp correct. extern void a(const char *); +// CHECK: @__cpu_model = external hidden global { i32, i32, i32, [1 x i32] } + void intel() { if (__builtin_cpu_is("intel")) a("intel"); Index: test/CodeGen/builtin-cpu-supports.c =================================================================== --- test/CodeGen/builtin-cpu-supports.c +++ test/CodeGen/builtin-cpu-supports.c @@ -4,6 +4,8 @@ // global, the bit grab, and the icmp correct. extern void a(const char *); +// CHECK: @__cpu_model = external hidden global { i32, i32, i32, [1 x i32] } + int main() { __builtin_cpu_init();