aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Wolfe <thejoshwolfe@gmail.com>2017-11-13 20:49:53 -0700
committerJosh Wolfe <thejoshwolfe@gmail.com>2017-11-13 20:49:53 -0700
commitc1fde0e8c45e4ba20fbc3306238c5e7627c2dfd9 (patch)
tree4e408d57e2c9c221c4f38f56252c6494a82c2aed /test
parent6356724057ffc94fec03c697ae99bed32d33d2f7 (diff)
downloadzig-c1fde0e8c45e4ba20fbc3306238c5e7627c2dfd9.tar.gz
zig-c1fde0e8c45e4ba20fbc3306238c5e7627c2dfd9.zip
parsec supports bitshift operators
Diffstat (limited to 'test')
-rw-r--r--test/parsec.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parsec.zig b/test/parsec.zig
index 9b3e8164fc..60234d153a 100644
--- a/test/parsec.zig
+++ b/test/parsec.zig
@@ -620,6 +620,16 @@ pub fn addCases(cases: &tests.ParseCContext) {
\\}
);
+ cases.addC("bitshift",
+ \\int foo(void) {
+ \\ return (1 << 2) >> 1;
+ \\}
+ ,
+ \\export fn foo() -> c_int {
+ \\ return (1 << @import("std").math.Log2Int(c_int)(2)) >> @import("std").math.Log2Int(c_int)(1);
+ \\}
+ );
+
cases.addC("duplicate typedef",
\\typedef long foo;
\\typedef int bar;