Skip to content

Commit e53277d

Browse files
committed
testsuite: add testcase for fixed PR98000
gcc/testsuite/ChangeLog: PR ipa/98000 * g++.dg/ipa/pr98000.C: New test.
1 parent f9ff478 commit e53277d

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

gcc/testsuite/g++.dg/ipa/pr98000.C

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/* { dg-do compile { target c++17 } } */
2+
/* { dg-options "-Og -w" } */
3+
4+
struct {
5+
template <typename T> T *operator()(T);
6+
} hb_addressof;
7+
template <typename, typename, typename... Ts> static int _hb_cmp_method(Ts...) {
8+
return 0;
9+
}
10+
template <typename V, typename K>
11+
inline bool hb_bsearch_impl(K key, V, int compar(void *, void *)) {
12+
V p;
13+
int __trans_tmp_2 = *hb_addressof(key) = compar(&__trans_tmp_2, p);
14+
return false;
15+
}
16+
struct hb_array_t {
17+
int arrayZ;
18+
};
19+
struct hb_sorted_array_t : hb_array_t {
20+
void bsearch() {
21+
hb_bsearch_impl(bsearch_impl_x, &arrayZ, _hb_cmp_method<int, int>);
22+
}
23+
int bsearch_impl_x;
24+
};
25+
template <typename Returned> struct hb_lazy_loader_t {
26+
Returned *operator->();
27+
};
28+
namespace OT {
29+
struct COLR;
30+
}
31+
struct hb_ot_face_t {
32+
hb_lazy_loader_t<OT::COLR> COLR;
33+
};
34+
struct {
35+
hb_ot_face_t table;
36+
} hb_ot_color_glyph_get_layers_face;
37+
namespace OT {
38+
struct IntType {
39+
typedef int wide_type;
40+
operator wide_type();
41+
};
42+
struct UnsizedArrayOf;
43+
struct OffsetTo {
44+
template <typename Base> friend UnsizedArrayOf operator+(Base, OffsetTo);
45+
};
46+
template <typename, bool> using LOffsetTo = OffsetTo;
47+
template <typename Type> using LNNOffsetTo = LOffsetTo<Type, false>;
48+
struct UnsizedArrayOf {
49+
void as_array(int);
50+
};
51+
struct SortedUnsizedArrayOf {
52+
hb_sorted_array_t __trans_tmp_4;
53+
void bsearch() { __trans_tmp_4.bsearch(); }
54+
};
55+
struct COLR {
56+
SortedUnsizedArrayOf __trans_tmp_3;
57+
int get_glyph_layers() {
58+
__trans_tmp_3.bsearch();
59+
int __trans_tmp_3 = numLayers;
60+
(this + layersZ).as_array(__trans_tmp_3);
61+
}
62+
LNNOffsetTo<int> layersZ;
63+
IntType numLayers;
64+
};
65+
} // namespace OT
66+
void hb_ot_color_glyph_get_layers() {
67+
hb_ot_color_glyph_get_layers_face.table.COLR->get_glyph_layers();
68+
}

0 commit comments

Comments
 (0)