xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/lpad-linetable.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang_cc1  -fcxx-exceptions -fexceptions -emit-llvm -g -triple x86_64-apple-darwin10 %s -o - | FileCheck %s
2f4a2713aSLionel Sambuc // The landing pad should have the line number of the closing brace of the function.
3f4a2713aSLionel Sambuc // rdar://problem/13888152
4f4a2713aSLionel Sambuc // CHECK: ret i32
5f4a2713aSLionel Sambuc // CHECK: landingpad {{.*}}
6f4a2713aSLionel Sambuc // CHECK-NEXT: !dbg ![[LPAD:[0-9]+]]
7*0a6a1f1dSLionel Sambuc // CHECK: ![[LPAD]] = !MDLocation(line: 24, scope: !{{.*}})
8f4a2713aSLionel Sambuc 
9f4a2713aSLionel Sambuc # 1 "/usr/include/c++/4.2.1/vector" 1 3
10f4a2713aSLionel Sambuc typedef long unsigned int __darwin_size_t;
11f4a2713aSLionel Sambuc typedef __darwin_size_t size_t;
12f4a2713aSLionel Sambuc namespace std {
13f4a2713aSLionel Sambuc   template<typename _Tp>
14f4a2713aSLionel Sambuc   class allocator
15f4a2713aSLionel Sambuc   {
16f4a2713aSLionel Sambuc   public:
17f4a2713aSLionel Sambuc     template<typename _Tp1>
18f4a2713aSLionel Sambuc     struct rebind
19f4a2713aSLionel Sambuc     { typedef allocator<_Tp1> other; };
~allocator()20f4a2713aSLionel Sambuc     ~allocator() throw() { }
21f4a2713aSLionel Sambuc   };
22f4a2713aSLionel Sambuc   template<typename _Tp, typename _Alloc>
23f4a2713aSLionel Sambuc   struct _Vector_base
24f4a2713aSLionel Sambuc   {
25f4a2713aSLionel Sambuc     typedef typename _Alloc::template rebind<_Tp>::other _Tp_alloc_type;
26f4a2713aSLionel Sambuc     struct _Vector_impl
27f4a2713aSLionel Sambuc     {
_Vector_implstd::_Vector_base::_Vector_impl28f4a2713aSLionel Sambuc       _Vector_impl(_Tp_alloc_type const& __a)      { }
29f4a2713aSLionel Sambuc     };
30f4a2713aSLionel Sambuc     typedef _Alloc allocator_type;
_Vector_basestd::_Vector_base31f4a2713aSLionel Sambuc     _Vector_base(const allocator_type& __a)
32f4a2713aSLionel Sambuc     : _M_impl(__a)
33f4a2713aSLionel Sambuc     {  }
~_Vector_basestd::_Vector_base34f4a2713aSLionel Sambuc     ~_Vector_base()  {  }
35f4a2713aSLionel Sambuc     _Vector_impl _M_impl;
36f4a2713aSLionel Sambuc   };
37f4a2713aSLionel Sambuc   template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
38f4a2713aSLionel Sambuc   class vector
39f4a2713aSLionel Sambuc     : protected _Vector_base<_Tp, _Alloc>
40f4a2713aSLionel Sambuc   {
41f4a2713aSLionel Sambuc     typedef _Vector_base<_Tp, _Alloc> _Base;
42f4a2713aSLionel Sambuc   public:
43f4a2713aSLionel Sambuc     typedef _Tp value_type;
44f4a2713aSLionel Sambuc     typedef size_t size_type;
45f4a2713aSLionel Sambuc     typedef _Alloc allocator_type;
vector(const allocator_type & __a=allocator_type ())46f4a2713aSLionel Sambuc     vector(const allocator_type& __a = allocator_type())
47f4a2713aSLionel Sambuc       : _Base(__a)
48f4a2713aSLionel Sambuc     {      }
49f4a2713aSLionel Sambuc     size_type
push_back(const value_type & __x)50f4a2713aSLionel Sambuc     push_back(const value_type& __x)
51f4a2713aSLionel Sambuc     {}
52f4a2713aSLionel Sambuc   };
53f4a2713aSLionel Sambuc }
54f4a2713aSLionel Sambuc # 10 "main.cpp" 2
55f4a2713aSLionel Sambuc 
56f4a2713aSLionel Sambuc 
57f4a2713aSLionel Sambuc 
58f4a2713aSLionel Sambuc 
main(int argc,char const * argv[],char const * envp[])59f4a2713aSLionel Sambuc int main (int argc, char const *argv[], char const *envp[])
60f4a2713aSLionel Sambuc { // 15
61f4a2713aSLionel Sambuc   std::vector<long> longs;
62f4a2713aSLionel Sambuc   std::vector<short> shorts;
63f4a2713aSLionel Sambuc   for (int i=0; i<12; i++)
64f4a2713aSLionel Sambuc     {
65f4a2713aSLionel Sambuc       longs.push_back(i);
66f4a2713aSLionel Sambuc       shorts.push_back(i);
67f4a2713aSLionel Sambuc     }
68f4a2713aSLionel Sambuc   return 0; // 23
69f4a2713aSLionel Sambuc } // 24
70