diff options
author | Ayke van Laethem <[email protected]> | 2023-03-16 20:05:46 +0100 |
---|---|---|
committer | Damian Gryski <[email protected]> | 2023-03-16 13:46:03 -0700 |
commit | e4f29ae2f95a188a39463599a7a56b82562158dc (patch) | |
tree | d78e8189d0abd6fbd7a1e22b4a45ebb52fe3cff5 /transform | |
parent | 7fb23824e271bf680465f3c796acfdb5dec9ce51 (diff) | |
download | tinygo-e4f29ae2f95a188a39463599a7a56b82562158dc.tar.gz tinygo-e4f29ae2f95a188a39463599a7a56b82562158dc.zip |
transform: update interrupt test to opaque pointers
Diffstat (limited to 'transform')
-rw-r--r-- | transform/testdata/interrupt.ll | 37 | ||||
-rw-r--r-- | transform/testdata/interrupt.out.ll | 27 |
2 files changed, 31 insertions, 33 deletions
diff --git a/transform/testdata/interrupt.ll b/transform/testdata/interrupt.ll index 1436827b0..f4d2e0226 100644 --- a/transform/testdata/interrupt.ll +++ b/transform/testdata/interrupt.ll @@ -1,39 +1,39 @@ target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7em-none-eabi" -%machine.UART = type { %machine.RingBuffer* } +%machine.UART = type { ptr } %machine.RingBuffer = type { [128 x %"runtime/volatile.Register8"], %"runtime/volatile.Register8", %"runtime/volatile.Register8" } %"runtime/volatile.Register8" = type { i8 } -%"runtime/interrupt.handle" = type { i8*, i32, %"runtime/interrupt.Interrupt" } +%"runtime/interrupt.handle" = type { ptr, i32, %"runtime/interrupt.Interrupt" } %"runtime/interrupt.Interrupt" = type { i32 } -@"runtime/interrupt.$interrupt2" = private unnamed_addr constant %"runtime/interrupt.handle" { i8* bitcast (%machine.UART* @machine.UART0 to i8*), i32 ptrtoint (void (i32, i8*)* @"(*machine.UART).handleInterrupt$bound" to i32), %"runtime/interrupt.Interrupt" { i32 2 } } [email protected] = internal global %machine.UART { %machine.RingBuffer* @"machine$alloc.335" } +@"runtime/interrupt.$interrupt2" = private unnamed_addr constant %"runtime/interrupt.handle" { ptr @machine.UART0, i32 ptrtoint (ptr @"(*machine.UART).handleInterrupt$bound" to i32), %"runtime/interrupt.Interrupt" { i32 2 } } [email protected] = internal global %machine.UART { ptr @"machine$alloc.335" } @"machine$alloc.335" = internal global %machine.RingBuffer zeroinitializer -declare void @"runtime/interrupt.callHandlers"(i32, i8*) local_unnamed_addr +declare void @"runtime/interrupt.callHandlers"(i32, ptr) local_unnamed_addr -declare void @"device/arm.EnableIRQ"(i32, i8* nocapture readnone) +declare void @"device/arm.EnableIRQ"(i32, ptr nocapture readnone) -declare void @"device/arm.SetPriority"(i32, i32, i8* nocapture readnone) +declare void @"device/arm.SetPriority"(i32, i32, ptr nocapture readnone) declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt") -define void @runtime.initAll(i8* nocapture readnone) unnamed_addr { +define void @runtime.initAll(ptr nocapture readnone) unnamed_addr { entry: - call void @"device/arm.SetPriority"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i32 192, i8* undef) - call void @"device/arm.EnableIRQ"(i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32), i8* undef) - call void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt" { i32 ptrtoint (%"runtime/interrupt.handle"* @"runtime/interrupt.$interrupt2" to i32) }) + call void @"device/arm.SetPriority"(i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32), i32 192, ptr undef) + call void @"device/arm.EnableIRQ"(i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32), ptr undef) + call void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt" { i32 ptrtoint (ptr @"runtime/interrupt.$interrupt2" to i32) }) ret void } define void @UARTE0_UART0_IRQHandler() { - call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef) + call void @"runtime/interrupt.callHandlers"(i32 2, ptr undef) ret void } define void @NFCT_IRQHandler() { - call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef) + call void @"runtime/interrupt.callHandlers"(i32 5, ptr undef) ret void } @@ -45,22 +45,21 @@ entry: ] switch.body2: - call void @"runtime/interrupt.callHandlers"(i32 2, i8* undef) + call void @"runtime/interrupt.callHandlers"(i32 2, ptr undef) ret void switch.body5: - call void @"runtime/interrupt.callHandlers"(i32 5, i8* undef) + call void @"runtime/interrupt.callHandlers"(i32 5, ptr undef) ret void switch.done: ret void } -define internal void @"(*machine.UART).handleInterrupt$bound"(i32, i8* nocapture %context) { +define internal void @"(*machine.UART).handleInterrupt$bound"(i32, ptr nocapture %context) { entry: - %unpack.ptr = bitcast i8* %context to %machine.UART* - call void @"(*machine.UART).handleInterrupt"(%machine.UART* %unpack.ptr, i32 %0, i8* undef) + call void @"(*machine.UART).handleInterrupt"(ptr %context, i32 %0, ptr undef) ret void } -declare void @"(*machine.UART).handleInterrupt"(%machine.UART* nocapture, i32, i8* nocapture readnone) +declare void @"(*machine.UART).handleInterrupt"(ptr nocapture, i32, ptr nocapture readnone) diff --git a/transform/testdata/interrupt.out.ll b/transform/testdata/interrupt.out.ll index 7eb9f0a87..3663c0a33 100644 --- a/transform/testdata/interrupt.out.ll +++ b/transform/testdata/interrupt.out.ll @@ -1,31 +1,31 @@ target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7em-none-eabi" -%machine.UART = type { %machine.RingBuffer* } +%machine.UART = type { ptr } %machine.RingBuffer = type { [128 x %"runtime/volatile.Register8"], %"runtime/volatile.Register8", %"runtime/volatile.Register8" } %"runtime/volatile.Register8" = type { i8 } %"runtime/interrupt.Interrupt" = type { i32 } [email protected] = internal global %machine.UART { %machine.RingBuffer* @"machine$alloc.335" } [email protected] = internal global %machine.UART { ptr @"machine$alloc.335" } @"machine$alloc.335" = internal global %machine.RingBuffer zeroinitializer -declare void @"runtime/interrupt.callHandlers"(i32, i8*) local_unnamed_addr +declare void @"runtime/interrupt.callHandlers"(i32, ptr) local_unnamed_addr -declare void @"device/arm.EnableIRQ"(i32, i8* nocapture readnone) +declare void @"device/arm.EnableIRQ"(i32, ptr nocapture readnone) -declare void @"device/arm.SetPriority"(i32, i32, i8* nocapture readnone) +declare void @"device/arm.SetPriority"(i32, i32, ptr nocapture readnone) declare void @"runtime/interrupt.use"(%"runtime/interrupt.Interrupt") -define void @runtime.initAll(i8* nocapture readnone %0) unnamed_addr { +define void @runtime.initAll(ptr nocapture readnone %0) unnamed_addr { entry: - call void @"device/arm.SetPriority"(i32 2, i32 192, i8* undef) - call void @"device/arm.EnableIRQ"(i32 2, i8* undef) + call void @"device/arm.SetPriority"(i32 2, i32 192, ptr undef) + call void @"device/arm.EnableIRQ"(i32 2, ptr undef) ret void } define void @UARTE0_UART0_IRQHandler() { - call void @"(*machine.UART).handleInterrupt$bound"(i32 2, i8* bitcast (%machine.UART* @machine.UART0 to i8*)) + call void @"(*machine.UART).handleInterrupt$bound"(i32 2, ptr @machine.UART0) ret void } @@ -37,7 +37,7 @@ entry: ] switch.body2: ; preds = %entry - call void @"(*machine.UART).handleInterrupt$bound"(i32 2, i8* bitcast (%machine.UART* @machine.UART0 to i8*)) + call void @"(*machine.UART).handleInterrupt$bound"(i32 2, ptr @machine.UART0) ret void switch.body5: ; preds = %entry @@ -47,11 +47,10 @@ switch.done: ; preds = %entry ret void } -define internal void @"(*machine.UART).handleInterrupt$bound"(i32 %0, i8* nocapture %context) { +define internal void @"(*machine.UART).handleInterrupt$bound"(i32 %0, ptr nocapture %context) { entry: - %unpack.ptr = bitcast i8* %context to %machine.UART* - call void @"(*machine.UART).handleInterrupt"(%machine.UART* %unpack.ptr, i32 %0, i8* undef) + call void @"(*machine.UART).handleInterrupt"(ptr %context, i32 %0, ptr undef) ret void } -declare void @"(*machine.UART).handleInterrupt"(%machine.UART* nocapture, i32, i8* nocapture readnone) +declare void @"(*machine.UART).handleInterrupt"(ptr nocapture, i32, ptr nocapture readnone) |