source: src/tests/shortCircuit.c @ cd3aee2

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since cd3aee2 was 0f35657, checked in by Rob Schluntz <rschlunt@…>, 7 years ago

updated completeTypeError test case

  • Property mode set to 100644
File size: 643 bytes
RevLine 
[10dc7491]1void g( float f ) {}
2void g( int i ) {}
[62edde5]3
4void f( int a ) {
5        int b;
6        float c;
7        g( a ? b : c );
8        g( a && c );
9        g( a || b );
10}
11
[d541057]12void g() {
[0f35657]13        int a;
14        struct { int b; } a;
15        if ( a ) {
[d541057]16                while ( a ) {
17                        int *b;
18                        for ( b; a; b ) {
19                        }
20                }
[0f35657]21        }
[d541057]22}
23
24#include <fstream>
25
26struct test_t {
27        int x;
28};
29
30int ?!=?( test_t lhs, int rhs ) {
31        sout | lhs.x | " ";
32        return lhs.x != 0;
33}
34
35
[62edde5]36int main(int argc, char const *argv[])
37{
[d541057]38        test_t true_val, false_val;
39        true_val.x = 1;
40        false_val.x = 0;
41
42        true_val && false_val;
43        sout | endl;
44
45        true_val || false_val;
46        sout | endl;
47
48        false_val && true_val;
49        sout | endl;
50
51        false_val || true_val;
52        sout | endl;
53
[62edde5]54        return 0;
55}
Note: See TracBrowser for help on using the repository browser.