source: src/tests/gccExtensions.c@ 5ead9f9

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 5ead9f9 was 5ead9f9, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

add copyright notice to test files

  • Property mode set to 100644
File size: 2.5 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// gccExtensions.c --
8//
9// Author : Peter A. Buhr
10// Created On : Sun Aug 14 17:28:17 2016
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Wed Aug 17 08:34:57 2016
13// Update Count : 7
14//
15
16extern int x asm( "xx" );
17
18int main(int argc, char const *argv[]) {
19 asm( "nop" );
20 __asm( "nop" );
21 __asm__( "nop" );
22
23 static int y asm( "yy" );
24#ifdef __CFA__
25 static * int z asm( "zz" ); // CFA declaration
26#endif // __CFA__
27
28 int src;
29 int dst;
30
31 asm volatile ( "mov %1, %0\n\t"
32 "add $1, %0" : : : );
33
34 asm volatile ( "mov %1, %0\n\t"
35 "add $1, %0"
36 : "=" "r" (dst));
37
38 asm volatile ( "mov %1, %0\n\t"
39 "add $1, %0"
40 : "=r" (dst)
41 : "r" (src));
42
43 asm ( "mov %1, %0\n\t"
44 "add $1, %0"
45 : "=r" (dst), "=r" (src)
46 : [src] "r" (dst)
47 : "r0");
48
49 L1: L2:
50 asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5"
51 : /* No outputs. */
52 : "r"(src), "r"(&dst)
53 : "r5", "memory"
54 : L1, L2 );
55
56 __complex__ c1;
57 _Complex c2;
58
59 const int i1;
60 __const int i2;
61 __const__ int i3;
62
63 __extension__ const int ex;
64 struct S {
65 __extension__ int a, b, c;
66 };
67 int i = __extension__ 3;
68 __extension__ int a, b, c;
69 __extension__ a, __extension__ b, __extension__ c;
70 __extension__ a = __extension__ b + __extension__ c;
71 __extension__ a = __extension__ ( __extension__ b + __extension__ c );
72
73 __inline int f1() {}
74 __inline__ int f2() {}
75
76 __signed s1;
77 __signed s2;
78
79 __typeof(s1) t1;
80 __typeof__(s1) t2;
81
82 __volatile int v1;
83 __volatile__ int v2;
84
85 __attribute__(()) int a1;
86 const __attribute(()) int a2;
87 const static __attribute(()) int a3;
88 const static int __attribute(()) a4;
89 const static int a5 __attribute(());
90 const static int a6, __attribute(()) a7;
91
92 int * __attribute(()) p1;
93 int (* __attribute(()) p2);
94// int (__attribute(()) (p3));
95// int ( __attribute(()) (* __attribute(()) p4));
96
97 struct __attribute(()) s1;
98 struct __attribute(()) s2 { int i; };
99 struct __attribute(()) s3 { int i; } x1, __attribute(()) y1;
100 struct __attribute(()) s4 { int i; } x2, y2 __attribute(());
101
102 int m1 [10] __attribute(());
103 int m2 [10][10] __attribute(());
104 int __attribute(()) m3 [10][10];
105// int ( __attribute(()) m4 [10] )[10];
106
107 return 0;
108}
109
110// Local Variables: //
111// tab-width: 4 //
112// compile-command: "cfa gccExtensions.c" //
113// End: //
Note: See TracBrowser for help on using the repository browser.