blob: 37005c5e9df77f7623b6ae93b3d37a9ada4b71aa [file] [log] [blame]
Eli Friedman4219c662011-11-08 19:55:32 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-apple-macosx10.7.2
Eric Christopher335552e2011-08-19 23:08:33 +00002// PR1084
3
4extern "C"
5{
6 typedef unsigned char PRUint8;
7 typedef unsigned int PRUint32;
8}
9typedef PRUint32 nsresult;
10struct nsID
11{
12};
13typedef nsID nsIID;
14class nsISupports
15{
16};
17extern "C++"
18{
19 template < class T > struct nsCOMTypeInfo
20 {
21 static const nsIID & GetIID ()
22 {
23 }
24 };
25}
26
27class nsIDOMEvent:public nsISupports
28{
29};
30class nsIDOMEventListener:public nsISupports
31{
32public:static const nsIID & GetIID ()
33 {
34 }
35 virtual nsresult
36 __attribute__ ((regparm (0), cdecl)) HandleEvent (nsIDOMEvent * event) =
37 0;
38};
39class nsIDOMMouseListener:public nsIDOMEventListener
40{
41public:static const nsIID & GetIID ()
42 {
43 static const nsIID iid = {
44 };
45 }
46 virtual nsresult
47 __attribute__ ((regparm (0),
48 cdecl)) MouseDown (nsIDOMEvent * aMouseEvent) = 0;
49};
50typedef
51typeof (&nsIDOMEventListener::HandleEvent)
52 GenericHandler;
53 struct EventDispatchData
54 {
55 PRUint32 message;
56 GenericHandler method;
57 PRUint8 bits;
58 };
59 struct EventTypeData
60 {
61 const EventDispatchData *events;
62 int numEvents;
63 const nsIID *iid;
64 };
65 static const EventDispatchData sMouseEvents[] = {
66 {
67 (300 + 2),
68 reinterpret_cast < GenericHandler > (&nsIDOMMouseListener::MouseDown),
69 0x01}
70 };
71static const EventTypeData sEventTypes[] = {
72 {
73 sMouseEvents, (sizeof (sMouseEvents) / sizeof (sMouseEvents[0])),
74 &nsCOMTypeInfo < nsIDOMMouseListener >::GetIID ()}
75};