blob: b4131bffde2289abe3778668ea1886cfb1479535 [file] [log] [blame]
Adrian Prantlbc068582015-07-08 01:00:30 +00001// REQUIRES: x86-registered-target
Ted Kremeneka683f632014-02-11 06:29:29 +00002// Test this without PCH.
3// 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
4// RUN: FileCheck --input-file %t.no_pch.ll %s
5
6// Test with PCH.
7// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -x c++-header -emit-pch -o %t.pch %S/local_static.h
8// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include-pch %t.pch -emit-llvm -o %t.pch.ll %s
9// RUN: FileCheck --input-file %t.pch.ll %s
10
11void test(Bar &b) {
12 b.f<int>();
13 static int s;
14}
15
16// Check if the mangling of static and local extern variables
17// are correct and preserved by PCH.
18
19// CHECK: @_ZZ4testR3BarE1s = internal global i32 0, align 4
20// CHECK: @_ZZN3Bar1fIiEEvvE1y = linkonce_odr constant i32 0, align 4
21