Ignore:
Timestamp:
Aug 19, 2016, 2:42:04 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
e85a8631
Parents:
03da511 (diff), ac71a86 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/gccExtensions.c

    r03da511 r04cdd9b  
     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 09:26:50 2016
     13// Update Count     : 10
     14//
     15
     16extern int x asm( "xx" );
     17
    118int main(int argc, char const *argv[]) {
     19        // asm extensions
     20
    221        asm( "nop" );
    322        __asm( "nop" );
    423        __asm__( "nop" );
     24
     25        static int y asm( "yy" );
     26#ifdef __CFA__
     27        static * int z asm( "zz" );                                                     // CFA declaration
     28#endif // __CFA__
     29
     30        int src;
     31        int dst;
     32
     33        asm volatile ( "mov %1, %0\n\t"
     34                                   "add $1, %0" : : : );
     35
     36        asm volatile ( "mov %1, %0\n\t"
     37                                   "add $1, %0"
     38                                   : "=" "r" (dst));
     39
     40        asm volatile ( "mov %1, %0\n\t"
     41                                   "add $1, %0"
     42                                   : "=r" (dst)
     43                                   : "r" (src));
     44
     45        asm ( "mov %1, %0\n\t"
     46                  "add $1, %0"
     47                  : "=r" (dst), "=r" (src)
     48                  : [src] "r" (dst)
     49                  : "r0");
     50
     51  L1: L2:
     52        asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5"
     53                           : /* No outputs. */
     54                           : "r"(src), "r"(&dst)
     55                           : "r5", "memory"
     56                           : L1, L2 );
     57
     58        // alternative type/qualifer names
    559
    660        __complex__ c1;
     
    1064        __const int i2;
    1165        __const__ int i3;
     66
     67        __inline int f1() {}
     68        __inline__ int f2() {}
     69
     70        __signed s1;
     71        __signed s2;
     72
     73        __volatile int v1;
     74        __volatile__ int v2;
     75
     76        // symbol table attributes
     77
     78        __typeof(s1) t1;
     79        __typeof__(s1) t2;
     80
     81        // strange extension qualifier
    1282
    1383        __extension__ const int ex;
     
    2191        __extension__ a = __extension__ ( __extension__ b + __extension__ c );
    2292
    23         __inline int f1() {}
    24         __inline__ int f2() {}
    25 
    26         __signed s1;
    27         __signed s2;
    28 
    29         __typeof(s1) t1;
    30         __typeof__(s1) t2;
    31 
    32         __volatile int v1;
    33         __volatile__ int v2;
     93        // attributes
    3494
    3595        __attribute__(()) int a1;
     
    57117        return 0;
    58118}
     119
     120// Local Variables: //
     121// tab-width: 4 //
     122// compile-command: "cfa gccExtensions.c" //
     123// End: //
Note: See TracChangeset for help on using the changeset viewer.