Skip to content

Commit

Permalink
Split darwin-minos-ver-1 test
Browse files Browse the repository at this point in the history
  • Loading branch information
aneshlya committed Feb 7, 2025
1 parent e86ab13 commit 2c473fc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
21 changes: 2 additions & 19 deletions tests/lit-tests/darwin-minos-ver-1.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
// RUN: %{ispc} %s --nostdlib --target-os=macos --target=avx2 --arch=x86-64 --emit-llvm-text --nowrap --darwin-version-min="" -o - | FileCheck %s --check-prefix=CHECK-MACOS-VER-UNSET
// RUN: not %{ispc} %s --nostdlib --target-os=macos --arch=x86-64 --nowrap --target=avx2 --darwin-version-min=a.b -o - 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR-VER

// RUN: %{ispc} %s --nostdlib --target-os=macos --target=host -h %t.h -o %t.o
// RUN: %{cc} -x c -c %s --include %t.h -o %t.cpp.o
// RUN: %{cxx} %t.o %t.cpp.o -o %t.bin -mmacosx-version-min=13.0 2>&1 | FileCheck %s --check-prefix=CHECK-WARNING --allow-empty
// RUN: otool -l %t.bin | FileCheck %s --check-prefix=CHECK-MINOS

// REQUIRES: MACOS_HOST && X86_ENABLED

// CHECK-MACOS-DEFAULT: target triple = "x86_64-apple-macosx10.12"
Expand All @@ -18,19 +13,7 @@

// CHECK-ERROR-VER: Error: Invalid version format: "a.b". Use <major_ver.minor_ver>.

// CHECK-WARNING-NOT: no platform load command found

// CHECK-MINOS: minos 13.0
uniform int j;

#ifdef ISPC
export void set(uniform int &result) {
result = programCount;
}
int foo(int i) { return i + 1; }

#else
int main(int argc, char **argv) {
int r = 0;
set(&r);
return 0;
}
#endif
4 changes: 4 additions & 0 deletions tests/lit-tests/darwin-minos-ver-2.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
// CHECK-MACOS-VER-UNSET: target triple = "arm64-apple-macosx"

// CHECK-ERROR-VER: Error: Invalid version format: "a.b". Use <major_ver.minor_ver>.

uniform int j;

int foo(int i) { return i + 1; }
27 changes: 27 additions & 0 deletions tests/lit-tests/darwin-minos-ver-4.ispc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// The test checks that there is no warning during linking and the minimum OS version is set to 13.0.

// Set to unsupported for now since it's failing when we build x86-enabled ISPC on macOS ARM64 host
// where clang and linker are aarch64.

// RUN: %{ispc} %s --nostdlib --target-os=macos --target=host -h %t.h -o %t.o
// RUN: %{cc} -x c -c %s --include %t.h -o %t.cpp.o
// RUN: %{cxx} %t.o %t.cpp.o -o %t.bin -mmacosx-version-min=13.0 2>&1 | FileCheck %s --check-prefix=CHECK-WARNING --allow-empty
// RUN: otool -l %t.bin | FileCheck %s --check-prefix=CHECK-MINOS

// UNSUPPORTED: *

// CHECK-WARNING-NOT: no platform load command found
// CHECK-MINOS: minos 13.0

#ifdef ISPC
export void set(uniform int &result) {
result = programCount;
}

#else
int main(int argc, char **argv) {
int r = 0;
set(&r);
return 0;
}
#endif

0 comments on commit 2c473fc

Please sign in to comment.