xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/x86-64-static-relo-movl.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-pc-win32-macho -relocation-model=static -O0 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Ensure that we don't generate a movl and not a lea for a static relocation
4*9880d681SAndroid Build Coastguard Worker; when compiling for 64 bit.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker%struct.MatchInfo = type [64 x i64]
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker@NO_MATCH = internal constant %struct.MatchInfo zeroinitializer, align 8
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @setup() {
11*9880d681SAndroid Build Coastguard Worker  %pending = alloca %struct.MatchInfo, align 8
12*9880d681SAndroid Build Coastguard Worker  %t = bitcast %struct.MatchInfo* %pending to i8*
13*9880d681SAndroid Build Coastguard Worker  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %t, i8* bitcast (%struct.MatchInfo* @NO_MATCH to i8*), i64 512, i32 8, i1 false)
14*9880d681SAndroid Build Coastguard Worker  %u = getelementptr inbounds %struct.MatchInfo, %struct.MatchInfo* %pending, i32 0, i32 2
15*9880d681SAndroid Build Coastguard Worker  %v = load i64, i64* %u, align 8
16*9880d681SAndroid Build Coastguard Worker  br label %done
17*9880d681SAndroid Build Coastguard Workerdone:
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker  ; CHECK: movabsq $_NO_MATCH, {{.*}}
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
24*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)
25