pr77285-2.C: Require tls_native support.
[gcc.git] / gcc / testsuite / g++.dg / pr65032.C
1 // { dg-do compile { target i?86-*-* x86_64-*-* } }
2 // { dg-options "-Os -std=c++11 -fPIC -fstack-protector-strong -fomit-frame-pointer" }
3
4 #pragma GCC visibility push(hidden)
5 #pragma GCC visibility push(default)
6 extern "C" {
7 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
8 }
9 enum class nsresult;
10 #pragma GCC visibility pop
11 class A
12 {
13 float mRawPtr;
14
15 public:
16 A (float *);
17 };
18 class B
19 {
20 public:
21 B (int64_t, int, int);
22 };
23 typedef struct
24 {
25 int channels;
26 } vorbis_info;
27 template <typename _Key> class C
28 {
29 public:
30 typedef int size_type;
31 size_type erase (_Key &);
32 };
33
34 template <typename _Key> class D
35 {
36 public:
37 typedef _Key key_type;
38 typedef C<key_type> _Rep_type;
39 _Rep_type _M_t;
40 typename _Rep_type::size_type
41 erase (key_type p1)
42 {
43 return _M_t.erase (p1);
44 }
45 };
46
47 class F
48 {
49 public:
50 vorbis_info mInfo;
51 D<int *> mVorbisPacketSamples;
52 void ValidateVorbisPacketSamples (int *);
53 int64_t Time (int64_t);
54 };
55 class G
56 {
57 nsresult DecodeVorbis (int *);
58 F *mVorbisState;
59 int64_t mDecodedAudioFrames;
60 };
61 int fn1 (float ***);
62 void fn2 (int);
63 void
64 F::ValidateVorbisPacketSamples (int *p1)
65 {
66 mVorbisPacketSamples.erase (p1);
67 }
68
69 nsresult
70 G::DecodeVorbis (int *p1)
71 {
72 float **a;
73 int b;
74 long long c;
75 while ((b = fn1 (&a)))
76 {
77 mVorbisState->ValidateVorbisPacketSamples (p1);
78 A (new float);
79 for (; mVorbisState->mInfo.channels;)
80 {
81 }
82 int64_t d = mVorbisState->Time (c - b);
83 (B (d, b, mVorbisState->mInfo.channels));
84 mDecodedAudioFrames -= b;
85 fn2 (b);
86 }
87
88 return nsresult();
89 }