summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lto/pr45679-2_1.C
blob: 23ba08aecfc6f87f9dc831381938bdcdfd3e4b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
extern "C" {
   typedef struct __locale_struct {
   }
   *__locale_t;
   union wait   {
     };
   extern "C" {
   }
   typedef struct _IO_FILE FILE;
   typedef struct {
     union   {
    }
   __value;
   }
   _G_fpos64_t;
   struct _IO_marker {
   }
   _IO_cookie_io_functions_t;
   extern struct _IO_FILE *stderr;
   extern int fprintf (FILE *__restrict __stream,       __const char *__restrict __format, ...);
   }
    enum {
       kPOVMSObjectClassID = 'OCLA',     kPOVMSMessageClassID = 'MCLA',     kPOVMSMessageIdentID = 'MIDE',     kPOVMSSourceAddressID = 'MSRC',     kPOVMSDestinationAddressID = 'MDST',     kPOVMSMessageTimeoutID = 'TOUT',     kPOVMSMessageErrorID = 'MERR' };
    typedef void * POVMSContext;
    typedef struct POVMSData POVMSObject, *POVMSObjectPtr;
    typedef struct POVMSData POVMSAttribute, *POVMSAttributePtr;
    typedef struct POVMSData POVMSAttributeList, *POVMSAttributeListPtr;
    struct POVMSData {
       int size;
       union     {
           void *ptr;
           struct POVMSNode *root;
       };
   };
    struct POVMSNode {
       struct POVMSNode *next;
       unsigned int key;
       struct POVMSData data;
   };
     int POVMSObject_Set (POVMSObjectPtr object, POVMSAttributePtr attr, unsigned int key);
     int POVMSAttr_Copy (POVMSAttributePtr sourceattr, POVMSAttributePtr destattr);
     int POVMSUtil_GetType (POVMSObjectPtr object, unsigned int key, unsigned int *typevalue);
    namespace pov_base {
   enum {
    kNoError = 0,  kNoErr = kNoError,  kParamErr = -1,  kMemFullErr = -2,  kOutOfMemoryErr = kMemFullErr,  kInvalidDataSizeErr = -3,  kCannotHandleDataErr = -4,  kNullPointerErr = -5,  kChecksumErr = -6,  kParseErr = -7,  kCannotOpenFileErr = -8,  kInvalidDestAddrErr = -9,  kCannotConnectErr = -10,  kDisconnectedErr = -11,  kHostDisconnectedErr = -12,  kNetworkDataErr = -13,  kNetworkConnectionErr = -14,  kObjectAccessErr = -15,  kVersionErr = -16,  kFileDataErr = -17,  kAuthorisationErr = -18,  kDataTypeErr = -19,  kTimeoutErr = -20,  kInvalidContextErr = -21 };
   }
    using namespace pov_base;
    struct POVMSContextData {
   };
    int POVMS_AssertFunction (int cond, const char *str, const char *filename, int line);
     int POVMS_OpenContext(POVMSContext *contextrefptr) {
    POVMSContextData *context = __null;
    if(contextrefptr == __null)   return kParamErr;
    if(POVMS_AssertFunction(context != __null, "POVMS_Open_Context failed, out of memory", "povms.cpp", 283) == false)   return kMemFullErr;
    return kNoErr;
   }
    int POVMS_AssertFunction(int cond, const char *str, const char *filename, int line) {
    if(cond == false)  {
     fprintf(stderr, "POVMS_ASSERT failed in %s line %d: %s\n", filename, (int)line, str);
    }
   }
     int POVMSObject_Copy(POVMSObjectPtr sourceobject, POVMSObjectPtr destobject) {
    POVMSNode *cur = __null;
    POVMSAttribute attr;
    unsigned int t1, t2;
    int ret = kNoErr;
    if(destobject == __null)   return kParamErr;
    if(POVMSUtil_GetType(sourceobject, kPOVMSObjectClassID, &t1) != kNoErr)   return kObjectAccessErr;
    if(POVMSUtil_GetType(sourceobject, kPOVMSObjectClassID, &t2) != kNoErr)   return kObjectAccessErr;
    if(t1 != t2)   return kDataTypeErr;
    for(cur = sourceobject->root;
   cur != __null;
   cur = cur->next)  {
     if(POVMS_AssertFunction(POVMSAttr_Copy(&(cur->data), &attr) == kNoErr, "POVMSObject_Merge failed, out of memory", "povms.cpp", 2084) == false)   {
    }
     if(POVMS_AssertFunction(POVMSObject_Set(destobject, &attr, cur->key) == kNoErr, "POVMSObject_Merge failed, out of memory", "povms.cpp", 2090) == false)   {
    }
    }
    return ret;
   }
     int POVMSObject_Set(POVMSObjectPtr object, POVMSAttributePtr attr, unsigned int key) {
   }
     int POVMSAttrList_Copy(POVMSAttributeListPtr sourcelist, POVMSAttributeListPtr destlist) {
    int cnt;
    int err = kNoErr;
    if(sourcelist == __null)   return kParamErr;
    if(destlist == __null)   return kParamErr;
    if(sourcelist == destlist)   return kParamErr;
    if(sourcelist->size < 0)   return kParamErr;
    if(sourcelist->size > 0)  {
     if(sourcelist->ptr != __null)   {
     if(POVMS_AssertFunction(destlist->ptr != __null, "POVMSAttrList_Copy failed, out of memory", "povms.cpp", 3020) == false)     return -1;
    }
     for(cnt = 0;
   cnt < sourcelist->size;
   cnt++)   {
    }
    }
    return err;
   }