static int precedence(StringRef Op) {
return StringSwitch<int>(Op)
- .Cases("*", "/", "%", 5)
- .Cases("+", "-", 4)
- .Cases("<<", ">>", 3)
- .Cases("<", "<=", ">", ">=", "==", "!=", 2)
- .Cases("&", "|", 1)
+ .Cases("*", "/", "%", 6)
+ .Cases("+", "-", 5)
+ .Cases("<<", ">>", 4)
+ .Cases("<", "<=", ">", ">=", "==", "!=", 3)
+ .Case("&", 2)
+ .Case("|", 1)
.Default(-1);
}
unary = -1 + 3;
lshift = 1 << 5;
rshift = 0xff >> 3;
+ precedence1 = 1 | 0xff & 1 << 1 + 1 * 2;
+ precedence2 = (1 | (0xff & (1 << (1 + (1 * 2)))));
maxpagesize = CONSTANT (MAXPAGESIZE);
commonpagesize = CONSTANT (COMMONPAGESIZE);
. = 0xfff0;
# CHECK: 00000000000002 *ABS* 00000000 unary
# CHECK: 00000000000020 *ABS* 00000000 lshift
# CHECK: 0000000000001f *ABS* 00000000 rshift
+# CHECK: 00000000000009 *ABS* 00000000 precedence1
+# CHECK: 00000000000009 *ABS* 00000000 precedence2
# CHECK: 00000000001000 *ABS* 00000000 maxpagesize
# CHECK: 00000000001000 *ABS* 00000000 commonpagesize
# CHECK: 0000000000ffff *ABS* 00000000 datasegmentalign