Files
swift-mirror/test/stdlib/simd_diagnostics.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

21 lines
1.7 KiB
Swift

// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated
// FIXME: No simd module on linux rdar://problem/20795411
// XFAIL: OS=linux-gnu, OS=windows-msvc, OS=openbsd, OS=linux-android, OS=linux-androideabi, OS=freebsd
// XFAIL: CPU=wasm32
import simd
let a = int4(0) + int4(0) // expected-error{{'+' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&+' instead}}
let b = int4(0) - int4(0) // expected-error{{'-' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&-' instead}}
let c = int4(0) * int4(0) // expected-error{{'*' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&*' instead}}
let x = int4(0) * (0 as Int32) // expected-error{{'*' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&*' instead}}
let y = (0 as Int32) * int4(0) // expected-error{{'*' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&*' instead}}
var d = int4(0)
d += int4(0) // expected-error{{'+=' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&+=' instead}}
d -= int4(0) // expected-error{{'-=' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&-=' instead}}
d *= int4(0) // expected-error{{'*=' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&*=' instead}}
d *= 0 // expected-error{{'*=' is unavailable: integer vector types do not support checked arithmetic; use the wrapping operator '&*=' instead}}