libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr91885.c
blob35be32be559c77e195307ddd8e64240ec79ebc21
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fprofile-generate" } */
3 /* { dg-require-profiling "-fprofile-generate" } */
5 typedef signed long long int __int64_t;
6 typedef unsigned long long int __uint64_t;
7 typedef __int64_t int64_t;
8 typedef __uint64_t uint64_t;
9 inline void
10 BLI_endian_switch_int64 (int64_t *val)
12 uint64_t tval = *val;
13 *val = ((tval >> 56)) | ((tval << 40) & 0x00ff000000000000ll)
14 | ((tval << 24) & 0x0000ff0000000000ll)
15 | ((tval << 8) & 0x000000ff00000000ll)
16 | ((tval >> 8) & 0x00000000ff000000ll)
17 | ((tval >> 24) & 0x0000000000ff0000ll)
18 | ((tval >> 40) & 0x000000000000ff00ll) | ((tval << 56));
20 typedef struct anim_index_entry
22 unsigned long long seek_pos_dts;
23 unsigned long long pts;
24 } anim_index_entry;
25 extern struct anim_index_entry *
26 MEM_callocN (int);
27 struct anim_index
29 int num_entries;
30 struct anim_index_entry *entries;
32 struct anim_index *
33 IMB_indexer_open (const char *name)
35 char header[13];
36 struct anim_index *idx;
37 int i;
38 idx->entries = MEM_callocN (8);
39 if (((1 == 0) != (header[8] == 'V')))
41 for (i = 0; i < idx->num_entries; i++)
43 BLI_endian_switch_int64 ((int64_t *) &idx->entries[i].seek_pos_dts);
44 BLI_endian_switch_int64 ((int64_t *) &idx->entries[i].pts);