1// Test without PCH.
2// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include %s %s -emit-llvm -o - | FileCheck %s
3//
4// Test with PCH.
5// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -x c++-header %s -emit-pch -o %t
6// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - | FileCheck %s
7
8#ifndef HEADER
9#define HEADER
10
11struct A {
12  struct { int a; } a;
13  struct { int b; } b;
14};
15
16#else
17
18template<typename T> void f(T) {}
19
20// CHECK-LABEL: define void @_Z1g1A(
21void g(A a) {
22  // CHECK: call void @_Z1fIN1AUt0_EEvT_(
23  f(a.b);
24  // CHECK: call void @_Z1fIN1AUt_EEvT_(
25  f(a.a);
26}
27
28#endif
29