1*0a6a1f1dSLionel Sambuc // Test this without PCH. 2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include %S/local_static.h -fsyntax-only %s -emit-llvm -o %t.no_pch.ll %s 3*0a6a1f1dSLionel Sambuc // RUN: FileCheck --input-file %t.no_pch.ll %s 4*0a6a1f1dSLionel Sambuc 5*0a6a1f1dSLionel Sambuc // Test with PCH. 6*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -x c++-header -emit-pch -o %t.pch %S/local_static.h 7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include-pch %t.pch -emit-llvm -o %t.pch.ll %s 8*0a6a1f1dSLionel Sambuc // RUN: FileCheck --input-file %t.pch.ll %s 9*0a6a1f1dSLionel Sambuc test(Bar & b)10*0a6a1f1dSLionel Sambucvoid test(Bar &b) { 11*0a6a1f1dSLionel Sambuc b.f<int>(); 12*0a6a1f1dSLionel Sambuc static int s; 13*0a6a1f1dSLionel Sambuc } 14*0a6a1f1dSLionel Sambuc 15*0a6a1f1dSLionel Sambuc // Check if the mangling of static and local extern variables 16*0a6a1f1dSLionel Sambuc // are correct and preserved by PCH. 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc // CHECK: @_ZZ4testR3BarE1s = internal global i32 0, align 4 19*0a6a1f1dSLionel Sambuc // CHECK: @_ZZN3Bar1fIiEEvvE1y = linkonce_odr constant i32 0, align 4 20*0a6a1f1dSLionel Sambuc 21