brintos

brintos / llvm-project-archived public Read only

0
0
Text · 925 B · 99b260f Raw
34 lines · python
1# Test code generation for retrieving function descriptors2# from the ADA when the ADA is extremely large and forces the3# generation of a different instruction sequence4# RUN: %python %s | llc -mtriple=s390x-ibm-zos -O2 | FileCheck %s5 6# CHECK: algfi	8,{{[0-9]+}}7# CHECK: la	8,0(8)8 9from __future__ import print_function10 11num_calls = 3500012 13print("define hidden signext i32 @main() {")14print("entry:")15 16for i in range(num_calls):17    print("  call void @foo%d()" % i)18 19# This is added to force the use of register r8 to generate20# la 8, 0(8) which generates the algfi instruction21print('%0 = call ptr asm " LGR $0,$1\0A", "=r,{r8}"(ptr nonnull @foo)')22print("  call void @bar(ptr noundef %0)")23print("ret i32 0")24print("}")25 26for i in range(num_calls):27    print("declare void @foo%d(...)" % i)28 29print("declare void @bar(ptr noundef)")30print("define internal void @foo() {")31print("entry:")32print("  ret void")33print("  }")34