xref: /aosp_15_r20/external/llvm/test/Transforms/ArgumentPromotion/variadic.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -argpromotion -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Unused arguments from variadic functions cannot be eliminated as that changes
4*9880d681SAndroid Build Coastguard Worker; their classiciation according to the SysV amd64 ABI. Clang and other frontends
5*9880d681SAndroid Build Coastguard Worker; bake in the classification when they use things like byval, as in this test.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu"
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker%struct.tt0 = type { i64, i64 }
11*9880d681SAndroid Build Coastguard Worker%struct.__va_list_tag = type { i32, i32, i8*, i8* }
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker@t45 = internal global %struct.tt0 { i64 1335139741, i64 438042995 }, align 8
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
16*9880d681SAndroid Build Coastguard Workerdefine i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 {
17*9880d681SAndroid Build Coastguard Workerentry:
18*9880d681SAndroid Build Coastguard Worker  tail call void (i8*, i8*, i8*, i8*, i8*, ...) @callee_t0f(i8* undef, i8* undef, i8* undef, i8* undef, i8* undef, %struct.tt0* byval align 8 @t45)
19*9880d681SAndroid Build Coastguard Worker  ret i32 0
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
23*9880d681SAndroid Build Coastguard Workerdefine internal void @callee_t0f(i8* nocapture readnone %tp13, i8* nocapture readnone %tp14, i8* nocapture readnone %tp15, i8* nocapture readnone %tp16, i8* nocapture readnone %tp17, ...) {
24*9880d681SAndroid Build Coastguard Workerentry:
25*9880d681SAndroid Build Coastguard Worker  ret void
26*9880d681SAndroid Build Coastguard Worker}
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: define internal void @callee_t0f(i8* nocapture readnone %tp13, i8* nocapture readnone %tp14, i8* nocapture readnone %tp15, i8* nocapture readnone %tp16, i8* nocapture readnone %tp17, ...)
29