1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=avr --mcpu=atmega328 -O0 -verify-machineinstrs | FileCheck %s
4 ;; This .ll file is generated from the following cpp program:
10 ;; Check https://github.com/llvm/llvm-project/issues/43443 for details.
12 %struct.foo = type { i8 }
14 @f2 = global %struct.foo zeroinitializer
16 @llvm.global_ctors = appending global [1 x { i32, void () addrspace(1)*, i8* }] [{ i32, void () addrspace(1)*, i8* } { i32 65535, void () addrspace(1)* @_GLOBAL__sub_I_failed.cc, i8* null }]
18 @_ZN3fooC1Ev = alias void (%struct.foo*), void (%struct.foo*) addrspace(1)* @_ZN3fooC2Ev
20 define void @_ZN3fooC2Ev(%struct.foo* dereferenceable(1) %this) {
21 ; CHECK-LABEL: _ZN3fooC2Ev:
22 ; CHECK: ; %bb.0: ; %entry
23 ; CHECK-NEXT: push r28
24 ; CHECK-NEXT: push r29
25 ; CHECK-NEXT: in r28, 61
26 ; CHECK-NEXT: in r29, 62
27 ; CHECK-NEXT: sbiw r28, 2
28 ; CHECK-NEXT: in r0, 63
30 ; CHECK-NEXT: out 62, r29
31 ; CHECK-NEXT: out 63, r0
32 ; CHECK-NEXT: out 61, r28
33 ; CHECK-NEXT: std Y+2, r25
34 ; CHECK-NEXT: std Y+1, r24
35 ; CHECK-NEXT: adiw r28, 2
36 ; CHECK-NEXT: in r0, 63
38 ; CHECK-NEXT: out 62, r29
39 ; CHECK-NEXT: out 63, r0
40 ; CHECK-NEXT: out 61, r28
45 %this.addr = alloca %struct.foo*
46 store %struct.foo* %this, %struct.foo** %this.addr
47 %this1 = load %struct.foo*, %struct.foo** %this.addr
51 define internal void @__cxx_global_var_init() addrspace(1) {
52 ; CHECK-LABEL: __cxx_global_var_init:
53 ; CHECK: ; %bb.0: ; %entry
54 ; CHECK-NEXT: ldi r24, lo8(f2)
55 ; CHECK-NEXT: ldi r25, hi8(f2)
56 ; CHECK-NEXT: call _ZN3fooC1Ev
59 call addrspace(1) void @_ZN3fooC1Ev(%struct.foo* dereferenceable(1) @f2)
63 define internal void @_GLOBAL__sub_I_failed.cc() addrspace(1) {
64 ; CHECK-LABEL: _GLOBAL__sub_I_failed.cc:
65 ; CHECK: ; %bb.0: ; %entry
66 ; CHECK-NEXT: call __cxx_global_var_init
69 call addrspace(1) void @__cxx_global_var_init()