ADT
        ast-experimental
        pthread-emulation
      
      
        
          | 
            Last change
 on this file since 2284d20 was             1d61b67, checked in by Thierry Delisle <tdelisle@…>, 4 years ago           | 
        
        
          | 
             
Added attribute case to typedef replacement test. 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1.3 KB
           | 
        
      
      
| Rev | Line |   | 
|---|
| [70529dc] | 1 | typedef volatile struct Foo FooInterm;
 | 
|---|
 | 2 | typedef const FooInterm Foo;
 | 
|---|
 | 3 | #ifdef ERR1
 | 
|---|
 | 4 | typedef struct Foo Foo;
 | 
|---|
 | 5 | #endif
 | 
|---|
 | 6 | 
 | 
|---|
 | 7 | typedef int ** pt;
 | 
|---|
 | 8 | typedef int ** pt;
 | 
|---|
 | 9 | 
 | 
|---|
 | 10 | #ifdef __CFA__
 | 
|---|
 | 11 | extern "C" {
 | 
|---|
 | 12 | #endif
 | 
|---|
 | 13 | typedef int __io_read_fn ( char buf);
 | 
|---|
 | 14 | typedef int __io_write_fn ( const char buf);
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | 
 | 
|---|
 | 17 | __io_read_fn read;
 | 
|---|
 | 18 | __io_write_fn write;
 | 
|---|
 | 19 | #ifdef __CFA__
 | 
|---|
 | 20 | }
 | 
|---|
 | 21 | #endif
 | 
|---|
 | 22 | 
 | 
|---|
 | 23 | int sz;
 | 
|---|
 | 24 | typedef int FUNC(int, ...);
 | 
|---|
 | 25 | typedef int FUNC(int, ...);
 | 
|---|
 | 26 | 
 | 
|---|
 | 27 | typedef int ARR[];
 | 
|---|
 | 28 | typedef int ARR[];
 | 
|---|
| [66812dd] | 29 | #ifdef ERR1
 | 
|---|
 | 30 | // if a typedef has an array dimension, it can only be redefined to the same dimension
 | 
|---|
| [70529dc] | 31 | typedef int ARR[2];
 | 
|---|
| [66812dd] | 32 | #endif
 | 
|---|
| [70529dc] | 33 | 
 | 
|---|
 | 34 | typedef int X;
 | 
|---|
 | 35 | typedef int Y;
 | 
|---|
 | 36 | typedef Y Y2;
 | 
|---|
 | 37 | typedef X X2;
 | 
|---|
 | 38 | 
 | 
|---|
 | 39 | typedef Y2 Z;
 | 
|---|
 | 40 | typedef X2 Z;
 | 
|---|
 | 41 | 
 | 
|---|
 | 42 | typedef Z X2;
 | 
|---|
 | 43 | typedef int X2;
 | 
|---|
 | 44 | typedef Z X2;
 | 
|---|
 | 45 | typedef int X2;
 | 
|---|
 | 46 | 
 | 
|---|
| [1d61b67] | 47 | X2 value  __attribute__((aligned(4 * sizeof(X2))));
 | 
|---|
 | 48 | 
 | 
|---|
 | 49 | __attribute__((aligned(4 * sizeof(X2)))) struct rseq_cs {
 | 
|---|
 | 50 |         int foo;
 | 
|---|
 | 51 | };
 | 
|---|
 | 52 | 
 | 
|---|
| [70529dc] | 53 | // xxx - this doesn't work yet due to parsing problems with generic types
 | 
|---|
 | 54 | // #ifdef __CFA__
 | 
|---|
 | 55 | // typedef forall(type T) void foo(T);
 | 
|---|
 | 56 | // typedef forall(type T) void foo(T);
 | 
|---|
 | 57 | // typedef forall(type S) void foo(S); // should be allowed to do this...
 | 
|---|
 | 58 | // #endif
 | 
|---|
 | 59 | 
 | 
|---|
 | 60 | int main() {
 | 
|---|
| [66812dd] | 61 |         typedef int ARR[sz];
 | 
|---|
| [70529dc] | 62 | 
 | 
|---|
| [66812dd] | 63 |         // can't redefine typedef which is VLA
 | 
|---|
| [70529dc] | 64 | #if ERR1
 | 
|---|
| [66812dd] | 65 |         typedef int ARR[sz];
 | 
|---|
| [70529dc] | 66 | #endif
 | 
|---|
 | 67 | 
 | 
|---|
| [66812dd] | 68 |         Foo * x;
 | 
|---|
 | 69 | 
 | 
|---|
 | 70 |         typedef struct Bar Foo;
 | 
|---|
 | 71 |         Foo * y;
 | 
|---|
| [70529dc] | 72 | 
 | 
|---|
| [66812dd] | 73 |         typedef int *** pt;
 | 
|---|
| [70529dc] | 74 | 
 | 
|---|
| [53692b3] | 75 |     #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
 | 
|---|
| [70529dc] | 76 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.