source: tests/nowarn/printf-sizeof.cfa @ 58eb9250

Last change on this file since 58eb9250 was 58eb9250, checked in by Michael Brooks <mlbrooks@…>, 2 weeks ago

Partly fix #269 and try to fix nightly build. Switch to correct type for polymorphic sizeof(-) on 32-bit.

  • Property mode set to 100644
File size: 575 bytes
RevLine 
[58eb9250]1// From fixed Trac #269
2
3forall( T )
4void fred( T x ) {
5    printf( "%zu\n", sizeof(T) );
6    printf( "%zu\n", sizeof(x) );
7    (void) x;  // FIX ME: work around Trac #300
8}
9
10#include <array.hfa>
11forall( [N] )
12void mary( array(char, N) & ) {
13    printf( "%zu\n", N );   
14  #if defined TRY_TRAC_269_REMAINDER
15        for ( i; N ) {
16        if (i > 0) printf(" ");
17        printf( "%zu", i); // FIX ME: i still getting type long unsigned int on -m32
18        }
19    printf("\n");
20  #endif
21}
22
23int main() {
24    char c = 'x';
25    fred(c);
26
27    array( char, 10 ) a;
28    mary(a);
29
30    return 0;
31}
Note: See TracBrowser for help on using the repository browser.