Split a test for windows aarch64 and have it pass

The test availability_returns_twice-msvc.swift leads to a different
compile error for windows aarch64 because _JBTYPE is a macro as
opposed to a typedef and the swift compiler doesn't parse the
macro. Split the test and handle the results respectively.
This commit is contained in:
Hiroshi Yamauchi
2023-08-28 13:48:57 -07:00
parent db22b88af9
commit d932d3b23f
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
// RUN: not %target-swift-frontend -typecheck -verify %s 2>&1 | %FileCheck %s
// REQUIRES: OS=windows-msvc && CPU=aarch64
import vcruntime
typealias JumpBuffer = _JBTYPE
func test_unavailable_returns_twice_function() {
var x: JumpBuffer
_ = _setjmp(&x)
}
// CHECK: availability_returns_twice-msvc-aarch64.swift:{{[0-9]+}}:{{[0-9]+}}: error: unexpected error produced: cannot find type '_JBTYPE' in scope
// CHECK-NEXT: typealias JumpBuffer = _JBTYPE
// CHECK-NEXT: ^
// CHECK-NEXT: setjmp.h:{{[0-9]+}}:{{[0-9]+}}: note: diagnostic produced elsewhere: macro '_JBTYPE' unavailable: structure not supported
// CHECK-NEXT: #define _JBTYPE unsigned __int64

View File

@@ -1,5 +1,5 @@
// RUN: %target-typecheck-verify-swift
// REQUIRES: OS=windows-msvc
// REQUIRES: OS=windows-msvc && CPU=x86_64
import vcruntime
typealias JumpBuffer = _JBTYPE