Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
4f4f646
ci: exercise the Windows standard library runtime
cpunion Aug 15, 2026
fbe9627
os, syscall: enhance Windows OS system integration and smoke tests
cpunion Aug 17, 2026
0bb7d4c
style: format runtime/_test/windowsstdlib/main.go with gofmt
cpunion Aug 17, 2026
6c5f080
runtime: support Windows OS bridges
cpunion Aug 17, 2026
a11a5ac
test: exercise Windows OS integration
cpunion Aug 17, 2026
b46b27a
runtime: reject Windows netpoll until IOCP support
cpunion Aug 17, 2026
1c1e8ec
test: verify Windows process exit
cpunion Aug 17, 2026
7b5514d
test: exercise Windows overlapped file fallback
cpunion Aug 18, 2026
e1dffe6
test: cover Windows llgo test execution
cpunion Aug 18, 2026
c6d5fa7
runtime: link Windows testing support hooks
cpunion Aug 18, 2026
179400d
ssa: retain Windows zero-sized global aliases
cpunion Aug 18, 2026
ba28a09
test: make stdlib checks Windows-aware
cpunion Aug 18, 2026
6594770
test: exercise Windows-specific stdlib behavior
cpunion Aug 18, 2026
9d32d58
test: match Windows console signal semantics
cpunion Aug 18, 2026
c32e952
runtime: provide Windows system directory hook
cpunion Aug 18, 2026
341eaef
runtime: deliver Windows console signals
cpunion Aug 18, 2026
616acc1
runtime: detach Windows signals from libuv
cpunion Aug 18, 2026
3c4f68f
runtime: support Windows IOCP polling
cpunion Aug 18, 2026
7ee3817
test: execute Windows socket and process coverage
cpunion Aug 18, 2026
bb3b09d
test: exercise Windows account lookup semantics
cpunion Aug 18, 2026
37bccdf
test: require Windows symlink compatibility
cpunion Aug 18, 2026
61f6747
test: enforce Windows os compatibility
cpunion Aug 18, 2026
981f327
test: cover Windows standard library symbols
cpunion Aug 18, 2026
7d25265
test: model Windows stdlib availability
cpunion Aug 18, 2026
b87eccf
ci: check Windows standard library coverage
cpunion Aug 18, 2026
9591adb
test: run goroot helpers on Windows
cpunion Aug 18, 2026
86ab3ce
test: monitor goroot resources on Windows
cpunion Aug 18, 2026
c2adcff
test: ignore Go helper coverage diagnostics
cpunion Aug 18, 2026
0c67bda
runtime: reject regular files from Linux poller
cpunion Aug 18, 2026
b21e8fb
ci: exercise llgo test on Windows
cpunion Aug 18, 2026
e217dda
windows: canonicalize runtime source paths
cpunion Aug 18, 2026
b440037
runtime: honor cleanup cancellation
cpunion Aug 18, 2026
2178976
runtime: keep cleanup handles pointer-free
cpunion Aug 18, 2026
16b9678
test: reuse a configured llgo compiler
cpunion Aug 18, 2026
616a370
test: use executable suffix for print probes
cpunion Aug 18, 2026
6299126
runtime: preserve LF in Windows builtin output
cpunion Aug 18, 2026
fa1aaae
test/goroot: derive GOPATH link from module path
cpunion Aug 18, 2026
e7985fe
runtime: avoid allocations in platform print backend
cpunion Aug 18, 2026
3be0b1f
ci: normalize Windows traceback paths
cpunion Aug 18, 2026
2c70111
runtime: keep non-Windows byte printing inline
cpunion Aug 18, 2026
c2f6fa4
runtime: keep non-Windows string printing inline
cpunion Aug 18, 2026
c500dbc
build: preserve explicit executable output names
cpunion Aug 18, 2026
8b4f2fc
test/goroot: isolate single-file run sources
cpunion Aug 18, 2026
ed3d2f4
test: cover exact Windows executable output names
cpunion Aug 18, 2026
6cdebce
test/goroot: accept equivalent frontend diagnostics
cpunion Aug 20, 2026
cdc3e5e
runtime: avoid cleanup finalizer lock reentrancy
cpunion Aug 20, 2026
38cf93e
runtime: keep proc pin hooks in the core runtime
cpunion Aug 20, 2026
ac97046
runtime: expose C errno on Windows
cpunion Aug 20, 2026
e42a976
runtime: support Windows CPU profiling
cpunion Aug 20, 2026
b89c9cf
ci: cover Windows cgo and CPU profiles
cpunion Aug 20, 2026
38d8dc9
runtime: guard Windows CPU profile frame walks
cpunion Aug 20, 2026
2e7c14f
runtime: retain the Windows os args bridge
cpunion Aug 20, 2026
7a2d18b
runtime: report live goroutine contexts
cpunion Aug 20, 2026
b239b62
test: tolerate passing GOROOT expectations
cpunion Aug 20, 2026
6cef78e
runtime: use address waits for Windows semaphores
cpunion Aug 20, 2026
0ef6f10
test: record Windows GOROOT runtime expectations
cpunion Aug 20, 2026
014a9eb
test: run Windows runtime tests from discoverable package
cpunion Aug 21, 2026
be63eb7
runtime: make Windows process exit race-safe
cpunion Aug 21, 2026
8ea009d
test: tolerate delayed AfterFunc scheduling
cpunion Aug 21, 2026
59c97ed
build: drop unused Windows test main before COFF linking
cpunion Aug 21, 2026
89f8820
test: avoid scheduler-sensitive context deadline bound
cpunion Aug 21, 2026
c0f71b6
runtime: separate Windows random streams by M
cpunion Aug 21, 2026
d2211d6
runtime: retain goroutine startup roots through entry calls
cpunion Aug 21, 2026
11e8180
test: cover Windows network polling
cpunion Aug 21, 2026
fdeb4e5
test: make explicit environment fixtures portable
cpunion Aug 22, 2026
01418c4
runtime: honor Universal CRT stdio semantics
cpunion Aug 22, 2026
8d699b6
cl: cover Windows LLVM IR generation
cpunion Aug 22, 2026
06bd14d
test: share closure ABI checks across hosts
cpunion Aug 22, 2026
9c82c6f
test: cover Windows host ABI in lit checks
cpunion Aug 22, 2026
1ffbae2
test: normalize Windows golden newlines
cpunion Aug 22, 2026
d15c292
build: preserve source patch newline style
cpunion Aug 22, 2026
4c9effe
build: defer Windows shared runtime initialization
cpunion Aug 22, 2026
2614c59
build: scope Windows C export wrappers to main
cpunion Aug 22, 2026
7d2a182
ci: preserve export header line endings
cpunion Aug 22, 2026
100218e
test: complete native Windows fixtures
cpunion Aug 22, 2026
f6cb0ed
test: make Windows checks deterministic
cpunion Aug 22, 2026
d1b1484
test(std): give NewFile sole descriptor ownership
cpunion Aug 23, 2026
a7e89b5
runtime: align Windows hosted semantics
cpunion Aug 23, 2026
16d8a92
runtime: align Windows polling and signal semantics
cpunion Aug 23, 2026
c1106e1
runtime: limit the Windows sleep bridge to 386
cpunion Aug 23, 2026
3c562d4
runtime: preserve Windows close signal cleanup
cpunion Aug 23, 2026
52a188b
test: make host fixtures portable on Windows
cpunion Aug 22, 2026
b2c2930
test: cover amd64 float conversions on Windows
cpunion Aug 22, 2026
822c42d
runtime: link Windows address-wait imports
cpunion Aug 22, 2026
77e2648
test: accept split concurrent select output
cpunion Aug 23, 2026
cdaffc4
test: parse coalesced select output tokens
cpunion Aug 23, 2026
9cf2b91
test: use the current runtime module path on Windows
cpunion Aug 24, 2026
8ab4a50
cabi: preserve Windows COMDAT during ABI lowering
cpunion Aug 24, 2026
31fdadf
cabi: lower Windows void aggregate results safely
cpunion Aug 24, 2026
1068437
build: probe cgo with the configured target compiler
cpunion Aug 24, 2026
197f349
build: parse cgo probes as C
cpunion Aug 24, 2026
b2b2738
runtime: finish sync backend migration in Windows support
cpunion Aug 25, 2026
84aea0d
runtime: support timed Windows condition waits
cpunion Aug 25, 2026
0e78baf
test: keep Windows setjmp checks on UCRT stderr
cpunion Aug 25, 2026
e5d56d4
test: keep embedded target spelling within R6 scope
cpunion Aug 25, 2026
b7c4e68
test: deduplicate Windows runtime host semantics
cpunion Aug 25, 2026
ebede33
test: locate Windows Go toolchains by executable name
cpunion Aug 25, 2026
50290b7
test: cover directory-handle chdir restoration
cpunion Aug 25, 2026
e23b666
test: externally link Windows ARM64 cgo baselines
cpunion Aug 25, 2026
bbb1297
build: reserve hosted stack on 64-bit Windows
cpunion Aug 25, 2026
d8c6f69
test: classify Windows GOROOT compatibility limits
cpunion Aug 25, 2026
802ddff
test: preserve malformed GOROOT diagnostics during cgo probing
cpunion Aug 25, 2026
a485728
test: classify platform-independent GOROOT exclusions
cpunion Aug 25, 2026
8ef06e4
internal/abi: lower oversized aggregate copies
cpunion Aug 25, 2026
b5b9f3d
ssa: lower large array comparisons to runtime helpers
cpunion Aug 25, 2026
0f62f0e
build: bind Plan 9 DATA globals before optimization
cpunion Aug 21, 2026
e138c62
plan9asm: use compiler symbol path for main packages
cpunion Aug 26, 2026
afc5a00
ssa: use fat map lookup for large elements
cpunion Aug 26, 2026
4e52fc7
test: cover inline assembly on windows/386
cpunion Aug 26, 2026
99f5edd
windows: address R6 review feedback
cpunion Aug 26, 2026
ddff712
windows: harden R6 runtime review findings
cpunion Aug 26, 2026
03d99ce
runtime: preserve portable Windows G check
cpunion Aug 26, 2026
7e412bd
test: cover Windows C export validation
cpunion Aug 26, 2026
b067676
test: cover compiler rejection paths
cpunion Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/expect.txt text eol=lf
**/out.txt text eol=lf
*.ll text eol=lf
_demo/go/export/libexport.h.want text eol=lf
4 changes: 3 additions & 1 deletion .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ runs:
"${urls[@]}"
pacman --noconfirm -S --needed \
--assume-installed "$assumed_cc_runtime" \
"$prefix-pkgconf"
"$prefix-pkgconf" \
"$prefix-sqlite3" \
make

for package in clang clang-libs compiler-rt llvm llvm-libs lld libc++ libunwind; do
installed="$(pacman -Q "$prefix-$package" | awk '{print $2}')"
Expand Down
70 changes: 67 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ concurrency:
cancel-in-progress: true

jobs:
std-cover:
name: standard-library coverage (windows-amd64, Go 1.26.7)
runs-on: windows-2022
timeout-minutes: 30
steps:
- uses: actions/checkout@v7

- name: Set up Go
uses: ./.github/actions/setup-go
with:
go-version: "1.26.7"

- name: Check Windows standard-library coverage
shell: bash
run: bash doc/_readme/scripts/check_std_cover.sh

native-compiler:
name: native PE/COFF (windows-amd64, LLVM 19, Go 1.26.7)
runs-on: windows-2022
Expand Down Expand Up @@ -198,6 +214,12 @@ jobs:
-o ..\windows-runtime-smoke.exe `
.\_test\windowsruntime
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -eq 0) {
..\llgo-windows-smoke.exe build -tags=nogc `
-o ..\windows-stdlib-smoke.exe `
.\_test\windowsstdlib
$buildExitCode = $LASTEXITCODE
}
if ($buildExitCode -eq 0) {
..\llgo-windows-smoke.exe build `
-o ..\windows-ffi-smoke.exe `
Expand All @@ -221,6 +243,12 @@ jobs:
.\_test\windowscorefault
$buildExitCode = $LASTEXITCODE
}
if ($buildExitCode -eq 0) {
..\llgo-windows-smoke.exe build `
-o ..\windows-network-smoke.exe `
.\_test\windowsnetwork
$buildExitCode = $LASTEXITCODE
}
Pop-Location
if ($buildExitCode -ne 0) {
exit $buildExitCode
Expand All @@ -230,15 +258,16 @@ jobs:
-ReadObj $readObjExe `
-Artifacts @(
".\windows-runtime-smoke.exe",
".\windows-stdlib-smoke.exe",
".\windows-ffi-smoke.exe",
".\windows-empty-smoke.exe",
".\windows-core-fault-smoke.exe"
".\windows-core-fault-smoke.exe",
".\windows-network-smoke.exe"
)
.\windows-runtime-smoke.exe
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

$env:LLGO_TEST_UNRECOVERED_FAULT = "1"
# This process is expected to write a panic to stderr and fail.
# Temporarily keep native stderr non-terminating so it can be
Expand All @@ -253,6 +282,7 @@ jobs:
}
Remove-Item Env:LLGO_TEST_UNRECOVERED_FAULT
Write-Host $faultOutput
$normalizedFaultOutput = $faultOutput.Replace('\', '/')
if ($faultExitCode -eq 0) {
throw "unrecovered Windows fault exited successfully"
}
Expand All @@ -261,13 +291,26 @@ jobs:
"main.windowsNilFault",
"windowsruntime/main.go"
)) {
if (-not $faultOutput.Contains($expected)) {
if (-not $normalizedFaultOutput.Contains($expected)) {
throw "unrecovered Windows fault output is missing '$expected'"
}
}
if ($faultOutput.Contains("github.com/xgo-dev/llgo/runtime/internal/clite/tls.init")) {
throw "unrecovered Windows fault traceback continued past runtime.goexit"
}
.\windows-stdlib-smoke.exe
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

$env:LLGO_TEST_OS_EXIT = "1"
.\windows-stdlib-smoke.exe
$exitCode = $LASTEXITCODE
Remove-Item Env:LLGO_TEST_OS_EXIT
if ($exitCode -ne 23) {
throw "os.Exit(23) returned exit code $exitCode"
}

.\windows-ffi-smoke.exe
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
Expand All @@ -280,3 +323,24 @@ jobs:
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
.\windows-network-smoke.exe
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}

# Exercise cmd/llgo's test path with testing-package behavior, cgo
# errno propagation, synchronization stress, CPU profiling, and
# runtime trace clock hooks.
# The runtime/FFI binaries above only cover build/run.
.\llgo-windows-smoke.exe test `
-p=1 `
-count=1 `
-timeout=10m `
./test/windows `
./test/cgo `
./test/std/sync `
./test/std/runtime/pprof `
./test/std/runtime/trace
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
7 changes: 4 additions & 3 deletions _demo/go/createtemp-1654/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"sync"
)

// Regression stress for darwin/amd64 create-temp failure path.
// If open failure does not return EEXIST correctly, os.CreateTemp may return
// a file with an invalid fd and later operations can fail with EBADF.
// Regression stress for concurrent temporary-file creation. It originally
// covered the darwin/amd64 open-failure path, where losing EEXIST could leave
// os.CreateTemp with an invalid fd. On Windows it also verifies that native
// threads do not repeat one random-name sequence and continually collide.
const (
goroutines = 4
iterations = 5000
Expand Down
81 changes: 70 additions & 11 deletions _demo/go/export/use/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#endif
#include "../libexport.h"

static int go_string_equals(GoString got, const char *want) {
Expand Down Expand Up @@ -31,6 +34,59 @@ static void void_callback(void) {
void_callback_count++;
}

#ifdef _WIN32
static volatile LONG foreign_fault_count;

static LONG CALLBACK continue_foreign_fault(EXCEPTION_POINTERS *exception) {
EXCEPTION_RECORD *record = exception->ExceptionRecord;
if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION &&
record->NumberParameters >= 2 && record->ExceptionInformation[1] == 0) {
InterlockedIncrement(&foreign_fault_count);
return EXCEPTION_CONTINUE_EXECUTION;
}
return EXCEPTION_CONTINUE_SEARCH;
}

static DWORD WINAPI call_go_export_from_foreign_thread(LPVOID arg) {
intptr_t value = (intptr_t)arg;
ULONG_PTR fault_information[2] = {0, 0};
// The LLGo DLL installs a process-wide vectored exception handler. A
// fault on a thread that has not entered Go must continue to the next
// native handler instead of being converted into a Go panic.
RaiseException(EXCEPTION_ACCESS_VIOLATION, 0, 2, fault_information);
for (int i = 0; i < 32; i++) {
GoString formatted = FormatValue((GoString){"thread", 6}, value + i);
if (formatted.n < 8 || memcmp(formatted.p, "thread:", 7) != 0) {
return 1;
}
}
return 0;
}

static void test_foreign_thread_exports(void) {
enum { thread_count = 8 };
HANDLE threads[thread_count];
PVOID fault_handler = AddVectoredExceptionHandler(0, continue_foreign_fault);
assert(fault_handler != NULL);
foreign_fault_count = 0;
for (intptr_t i = 0; i < thread_count; i++) {
threads[i] = CreateThread(NULL, 0, call_go_export_from_foreign_thread,
(LPVOID)i, 0, NULL);
assert(threads[i] != NULL);
}
assert(WaitForMultipleObjects(thread_count, threads, TRUE, INFINITE) ==
WAIT_OBJECT_0);
for (int i = 0; i < thread_count; i++) {
DWORD result;
assert(GetExitCodeThread(threads[i], &result));
assert(result == 0);
assert(CloseHandle(threads[i]));
}
assert(foreign_fault_count == thread_count);
assert(RemoveVectoredExceptionHandler(fault_handler));
}
#endif

int main() {
printf("=== C Export Demo ===\n");
fflush(stdout); // Force output
Expand Down Expand Up @@ -64,24 +120,27 @@ int main() {
// that depend on the runtime hooks supplied by LLGo.
GoString formatted = FormatValue((GoString){"answer", 6}, 42);
assert(go_string_equals(formatted, "answer:42"));
#ifdef _WIN32
test_foreign_thread_exports();
#endif
#ifdef __linux__
assert(AllThreadsSyscallStatus() == ENOTSUP);
#else
assert(AllThreadsSyscallStatus() == 0);
#endif

// Test small struct
main_SmallStruct small = CreateSmallStruct(5, 1); // 1 for true
assert(small.ID == 5);
assert(small.Flag == 1);
printf("Small struct: %d %d\n", small.ID, small.Flag);
main_SmallStruct small_value = CreateSmallStruct(5, 1); // 1 for true
assert(small_value.ID == 5);
assert(small_value.Flag == 1);
printf("Small struct: %d %d\n", small_value.ID, small_value.Flag);

main_SmallStruct processed = ProcessSmallStruct(small);
main_SmallStruct processed = ProcessSmallStruct(small_value);
assert(processed.ID == 6);
assert(processed.Flag == 0);
printf("Processed small: %d %d\n", processed.ID, processed.Flag);

main_SmallStruct* ptrSmall = ProcessSmallStructPtr(&small);
main_SmallStruct* ptrSmall = ProcessSmallStructPtr(&small_value);
if (ptrSmall != NULL) {
printf("Ptr small: %d %d\n", ptrSmall->ID, ptrSmall->Flag);
}
Expand Down Expand Up @@ -140,13 +199,13 @@ int main() {
printf("Uint64: %" PRIu64 "\n", ProcessUint64(10));

assert(ProcessInt(10) == 110); // ProcessInt(x) returns x * 11
printf("Int: %ld\n", ProcessInt(10));
printf("Int: %" PRIdPTR "\n", ProcessInt(10));

assert(ProcessUint(10) == 210); // ProcessUint(x) returns x * 21
printf("Uint: %lu\n", ProcessUint(10));
printf("Uint: %" PRIuPTR "\n", ProcessUint(10));

assert(ProcessUintptr(0x1000) == 4396); // ProcessUintptr(x) returns x + 300 = 4096 + 300
printf("Uintptr: %lu\n", ProcessUintptr(0x1000));
printf("Uintptr: %" PRIuPTR "\n", ProcessUintptr(0x1000));

// Float comparisons with tolerance
float f32_result = ProcessFloat32(3.14f);
Expand Down Expand Up @@ -209,10 +268,10 @@ int main() {

// Test various parameter counts
assert(NoParams() == 42); // NoParams() always returns 42
printf("NoParams: %ld\n", NoParams());
printf("NoParams: %" PRIdPTR "\n", NoParams());

assert(OneParam(5) == 10); // OneParam(x) returns x * 2
printf("OneParam: %ld\n", OneParam(5));
printf("OneParam: %" PRIdPTR "\n", OneParam(5));

assert(ThreeParams(10, 2.5, 1) == 25.0); // ThreeParams calculates result
printf("ThreeParams: %f\n", ThreeParams(10, 2.5, 1)); // 1 for true
Expand Down
56 changes: 28 additions & 28 deletions cl/_testdata/floatint/in.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// LITTEST: POST-ABI darwin/arm64 linux/amd64 linux/arm64
// LITTEST: POST-ABI darwin/arm64 linux/amd64 linux/arm64 windows/amd64
// NOTE: Assertions have been autogenerated by chore/litgen UTC_ARGS: --function=f32ToI32 --function=f32ToU32 --function=f64ToUintptr --check-globals=none
package main

Expand All @@ -10,46 +10,46 @@ func f64ToUintptr(v float64) uintptr { return uintptr(v) }
// CHECK-SAME: float %[[TMP0:[0-9]+]]){{.*}} {
// CHECK-NEXT: _llgo_[[BB0:[0-9]+]]:
// ARM64-NEXT: %[[TMP1:[0-9]+]] = fcmp ole float %[[TMP0]], 0xC1E0000000000000
// LINUX-AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp olt float %[[TMP0]], 0xC1E0000000000000
// AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp olt float %[[TMP0]], 0xC1E0000000000000
// CHECK-NEXT: %[[TMP2:[0-9]+]] = fcmp oge float %[[TMP0]], 0x41E0000000000000
// CHECK-NEXT: %[[TMP3:[0-9]+]] = fcmp uno float %[[TMP0]], %[[TMP0]]
// ARM64-NEXT: %[[TMP4:[0-9]+]] = select i1 %[[TMP1]], float 0.000000e+00, float %[[TMP0]]
// ARM64-NEXT: %[[TMP5:[0-9]+]] = select i1 %[[TMP2]], float 0.000000e+00, float %[[TMP4]]
// ARM64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP3]], float 0.000000e+00, float %[[TMP5]]
// LINUX-AMD64-NEXT: %[[TMP4:[0-9]+]] = or i1 %[[TMP1]], %[[TMP2]]
// LINUX-AMD64-NEXT: %[[TMP5:[0-9]+]] = or i1 %[[TMP4]], %[[TMP3]]
// LINUX-AMD64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP5]], float 0.000000e+00, float %[[TMP0]]
// AMD64-NEXT: %[[TMP4:[0-9]+]] = or i1 %[[TMP1]], %[[TMP2]]
// AMD64-NEXT: %[[TMP5:[0-9]+]] = or i1 %[[TMP4]], %[[TMP3]]
// AMD64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP5]], float 0.000000e+00, float %[[TMP0]]
// CHECK-NEXT: %[[TMP7:[0-9]+]] = fptosi float %[[TMP6]] to i32
// ARM64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP1]], i32 -2147483648, i32 %[[TMP7]]
// ARM64-NEXT: %[[TMP9:[0-9]+]] = select i1 %[[TMP2]], i32 2147483647, i32 %[[TMP8]]
// ARM64-NEXT: %[[TMP10:[0-9]+]] = select i1 %[[TMP3]], i32 0, i32 %[[TMP9]]
// ARM64-NEXT: ret i32 %[[TMP10]]
// LINUX-AMD64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP5]], i32 -2147483648, i32 %[[TMP7]]
// LINUX-AMD64-NEXT: ret i32 %[[TMP8]]
// AMD64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP5]], i32 -2147483648, i32 %[[TMP7]]
// AMD64-NEXT: ret i32 %[[TMP8]]
// CHECK-NEXT: }

// CHECK-LABEL: define i32 @main.f32ToU32(
// CHECK-SAME: float %[[TMP0:[0-9]+]]){{.*}} {
// CHECK-NEXT: _llgo_[[BB0:[0-9]+]]:
// ARM64-NEXT: %[[TMP1:[0-9]+]] = fcmp ole float %[[TMP0]], 0xC3E0000000000000
// LINUX-AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp olt float %[[TMP0]], 0xC3E0000000000000
// AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp olt float %[[TMP0]], 0xC3E0000000000000
// CHECK-NEXT: %[[TMP2:[0-9]+]] = fcmp oge float %[[TMP0]], 0x43E0000000000000
// CHECK-NEXT: %[[TMP3:[0-9]+]] = fcmp uno float %[[TMP0]], %[[TMP0]]
// ARM64-NEXT: %[[TMP4:[0-9]+]] = select i1 %[[TMP1]], float 0.000000e+00, float %[[TMP0]]
// ARM64-NEXT: %[[TMP5:[0-9]+]] = select i1 %[[TMP2]], float 0.000000e+00, float %[[TMP4]]
// ARM64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP3]], float 0.000000e+00, float %[[TMP5]]
// LINUX-AMD64-NEXT: %[[TMP4:[0-9]+]] = or i1 %[[TMP1]], %[[TMP2]]
// LINUX-AMD64-NEXT: %[[TMP5:[0-9]+]] = or i1 %[[TMP4]], %[[TMP3]]
// LINUX-AMD64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP5]], float 0.000000e+00, float %[[TMP0]]
// AMD64-NEXT: %[[TMP4:[0-9]+]] = or i1 %[[TMP1]], %[[TMP2]]
// AMD64-NEXT: %[[TMP5:[0-9]+]] = or i1 %[[TMP4]], %[[TMP3]]
// AMD64-NEXT: %[[TMP6:[0-9]+]] = select i1 %[[TMP5]], float 0.000000e+00, float %[[TMP0]]
// CHECK-NEXT: %[[TMP7:[0-9]+]] = fptosi float %[[TMP6]] to i64
// ARM64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP1]], i64 -9223372036854775808, i64 %[[TMP7]]
// ARM64-NEXT: %[[TMP9:[0-9]+]] = select i1 %[[TMP2]], i64 9223372036854775807, i64 %[[TMP8]]
// ARM64-NEXT: %[[TMP10:[0-9]+]] = select i1 %[[TMP3]], i64 0, i64 %[[TMP9]]
// ARM64-NEXT: %[[TMP11:[0-9]+]] = trunc i64 %[[TMP10]] to i32
// ARM64-NEXT: ret i32 %[[TMP11]]
// LINUX-AMD64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP5]], i64 -9223372036854775808, i64 %[[TMP7]]
// LINUX-AMD64-NEXT: %[[TMP9:[0-9]+]] = trunc i64 %[[TMP8]] to i32
// LINUX-AMD64-NEXT: ret i32 %[[TMP9]]
// AMD64-NEXT: %[[TMP8:[0-9]+]] = select i1 %[[TMP5]], i64 -9223372036854775808, i64 %[[TMP7]]
// AMD64-NEXT: %[[TMP9:[0-9]+]] = trunc i64 %[[TMP8]] to i32
// AMD64-NEXT: ret i32 %[[TMP9]]
// CHECK-NEXT: }

// CHECK-LABEL: define i64 @main.f64ToUintptr(
Expand All @@ -66,18 +66,18 @@ func f64ToUintptr(v float64) uintptr { return uintptr(v) }
// ARM64-NEXT: %[[TMP9:[0-9]+]] = select i1 %[[TMP1]], i64 0, i64 %[[TMP8]]
// ARM64-NEXT: %[[TMP10:[0-9]+]] = select i1 %[[TMP3]], i64 0, i64 %[[TMP9]]
// ARM64-NEXT: ret i64 %[[TMP10]]
// LINUX-AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp oge double %[[TMP0]], 0x43E0000000000000
// LINUX-AMD64-NEXT: %[[TMP2:[0-9]+]] = fsub double %[[TMP0]], 0x43E0000000000000
// LINUX-AMD64-NEXT: %[[TMP3:[0-9]+]] = select i1 %[[TMP1]], double %[[TMP2]], double %[[TMP0]]
// LINUX-AMD64-NEXT: %[[TMP4:[0-9]+]] = fcmp olt double %[[TMP3]], 0xC3E0000000000000
// LINUX-AMD64-NEXT: %[[TMP5:[0-9]+]] = fcmp oge double %[[TMP3]], 0x43E0000000000000
// LINUX-AMD64-NEXT: %[[TMP6:[0-9]+]] = fcmp uno double %[[TMP3]], %[[TMP3]]
// LINUX-AMD64-NEXT: %[[TMP7:[0-9]+]] = or i1 %[[TMP4]], %[[TMP5]]
// LINUX-AMD64-NEXT: %[[TMP8:[0-9]+]] = or i1 %[[TMP7]], %[[TMP6]]
// LINUX-AMD64-NEXT: %[[TMP9:[0-9]+]] = select i1 %[[TMP8]], double 0.000000e+00, double %[[TMP3]]
// LINUX-AMD64-NEXT: %[[TMP10:[0-9]+]] = fptosi double %[[TMP9]] to i64
// LINUX-AMD64-NEXT: %[[TMP11:[0-9]+]] = select i1 %[[TMP8]], i64 -9223372036854775808, i64 %[[TMP10]]
// LINUX-AMD64-NEXT: %[[TMP12:[0-9]+]] = select i1 %[[TMP1]], i64 -9223372036854775808, i64 0
// LINUX-AMD64-NEXT: %[[TMP13:[0-9]+]] = or i64 %[[TMP11]], %[[TMP12]]
// LINUX-AMD64-NEXT: ret i64 %[[TMP13]]
// AMD64-NEXT: %[[TMP1:[0-9]+]] = fcmp oge double %[[TMP0]], 0x43E0000000000000
// AMD64-NEXT: %[[TMP2:[0-9]+]] = fsub double %[[TMP0]], 0x43E0000000000000
// AMD64-NEXT: %[[TMP3:[0-9]+]] = select i1 %[[TMP1]], double %[[TMP2]], double %[[TMP0]]
// AMD64-NEXT: %[[TMP4:[0-9]+]] = fcmp olt double %[[TMP3]], 0xC3E0000000000000
// AMD64-NEXT: %[[TMP5:[0-9]+]] = fcmp oge double %[[TMP3]], 0x43E0000000000000
// AMD64-NEXT: %[[TMP6:[0-9]+]] = fcmp uno double %[[TMP3]], %[[TMP3]]
// AMD64-NEXT: %[[TMP7:[0-9]+]] = or i1 %[[TMP4]], %[[TMP5]]
// AMD64-NEXT: %[[TMP8:[0-9]+]] = or i1 %[[TMP7]], %[[TMP6]]
// AMD64-NEXT: %[[TMP9:[0-9]+]] = select i1 %[[TMP8]], double 0.000000e+00, double %[[TMP3]]
// AMD64-NEXT: %[[TMP10:[0-9]+]] = fptosi double %[[TMP9]] to i64
// AMD64-NEXT: %[[TMP11:[0-9]+]] = select i1 %[[TMP8]], i64 -9223372036854775808, i64 %[[TMP10]]
// AMD64-NEXT: %[[TMP12:[0-9]+]] = select i1 %[[TMP1]], i64 -9223372036854775808, i64 0
// AMD64-NEXT: %[[TMP13:[0-9]+]] = or i64 %[[TMP11]], %[[TMP12]]
// AMD64-NEXT: ret i64 %[[TMP13]]
// CHECK-NEXT: }
Loading
Loading