Files
codeql/swift/ql/test/library-tests/elements/expr/arithmeticoperation/arithmeticoperation.swift
2023-03-03 16:32:21 +00:00

19 lines
244 B
Swift

func test(c: Bool, x: Int, y: Int, z: Int) {
var v = 0
// arithmetic operations
v = x + y;
v = x - 1;
v = 2 * y;
v = 3 / 4;
v = x % y;
v = -x;
v = +x;
// arithmetic operations with overflow
v = x &+ y;
v = x &- y;
v = x &* y;
}