1bc068586SAdrian Prantl // REQUIRES: x86-registered-target
2a683f639STed Kremenek // Test this without PCH.
3a683f639STed Kremenek // 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
4a683f639STed Kremenek // RUN: FileCheck --input-file %t.no_pch.ll %s
5a683f639STed Kremenek
6a683f639STed Kremenek // Test with PCH.
7a683f639STed Kremenek // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -x c++-header -emit-pch -o %t.pch %S/local_static.h
8a683f639STed Kremenek // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include-pch %t.pch -emit-llvm -o %t.pch.ll %s
9a683f639STed Kremenek // RUN: FileCheck --input-file %t.pch.ll %s
10a683f639STed Kremenek
11*a45f713cSLuboš Luňák // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -x c++-header -emit-pch -fpch-instantiate-templates -o %t.pch %S/local_static.h
12*a45f713cSLuboš Luňák // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include-pch %t.pch -emit-llvm -o %t.pch.ll %s
13*a45f713cSLuboš Luňák // RUN: FileCheck --input-file %t.pch.ll %s
14*a45f713cSLuboš Luňák
test(Bar & b)15a683f639STed Kremenek void test(Bar &b) {
16a683f639STed Kremenek b.f<int>();
17a683f639STed Kremenek static int s;
18a683f639STed Kremenek }
19a683f639STed Kremenek
20a683f639STed Kremenek // Check if the mangling of static and local extern variables
21a683f639STed Kremenek // are correct and preserved by PCH.
22a683f639STed Kremenek
23a683f639STed Kremenek // CHECK: @_ZZ4testR3BarE1s = internal global i32 0, align 4
24a683f639STed Kremenek // CHECK: @_ZZN3Bar1fIiEEvvE1y = linkonce_odr constant i32 0, align 4
25a683f639STed Kremenek
26