11f5207bJohn Levonstatic int add(int a, int b) { return (a + b) == (b + a); }
21f5207bJohn Levonstatic int mul(int a, int b) { return (a * b) == (b * a); }
31f5207bJohn Levonstatic int and(int a, int b) { return (a & b) == (b & a); }
41f5207bJohn Levonstatic int ior(int a, int b) { return (a | b) == (b | a); }
51f5207bJohn Levonstatic int xor(int a, int b) { return (a ^ b) == (b ^ a); }
61f5207bJohn Levonstatic int  eq(int a, int b) { return (a == b) == (b == a); }
71f5207bJohn Levonstatic int  ne(int a, int b) { return (a != b) == (b != a); }
81f5207bJohn Levon
91f5207bJohn Levon
101f5207bJohn Levon/*
111f5207bJohn Levon * check-name: cse-commutativity
121f5207bJohn Levon * check-command: test-linearize $file
131f5207bJohn Levon * check-output-ignore
141f5207bJohn Levon *
151f5207bJohn Levon * check-output-excludes: add\\.
161f5207bJohn Levon * check-output-excludes: muls\\.
171f5207bJohn Levon * check-output-excludes: and\\.
181f5207bJohn Levon * check-output-excludes: or\\.
191f5207bJohn Levon * check-output-excludes: xor\\.
201f5207bJohn Levon * check-output-excludes: seteq\\.
211f5207bJohn Levon * check-output-excludes: setne\\.
221f5207bJohn Levon */
23