[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / SystemZ / systemz-inline-asm-03.c
bloba0c58e15a218815b97fdc82867e778d7f99622bc
1 // RUN: %clang_cc1 -triple s390x-linux-gnu -O2 -emit-llvm \
2 // RUN: -o - %s 2>&1 | FileCheck %s
3 // REQUIRES: systemz-registered-target
5 long *A;
6 long Idx;
7 unsigned long Addr;
9 unsigned long fun_BD12_Q() {
10 // CHECK-LABEL: define{{.*}} i64 @fun_BD12_Q()
11 // CHECK: call i64 asm "lay $0, $1", "=r,^ZQ"(ptr nonnull %arrayidx)
12 asm("lay %0, %1" : "=r" (Addr) : "ZQ" (&A[100]));
13 return Addr;
16 unsigned long fun_BD12_R() {
17 // CHECK-LABEL: define{{.*}} i64 @fun_BD12_R()
18 // CHECK: call i64 asm "lay $0, $1", "=r,^ZR"(ptr nonnull %arrayidx)
19 asm("lay %0, %1" : "=r" (Addr) : "ZR" (&A[100]));
20 return Addr;
23 unsigned long fun_BD12_S() {
24 // CHECK-LABEL: define{{.*}} i64 @fun_BD12_S()
25 // CHECK: call i64 asm "lay $0, $1", "=r,^ZS"(ptr nonnull %arrayidx)
26 asm("lay %0, %1" : "=r" (Addr) : "ZS" (&A[100]));
27 return Addr;
30 unsigned long fun_BD12_T() {
31 // CHECK-LABEL: define{{.*}} i64 @fun_BD12_T()
32 // CHECK: call i64 asm "lay $0, $1", "=r,^ZT"(ptr nonnull %arrayidx)
33 asm("lay %0, %1" : "=r" (Addr) : "ZT" (&A[100]));
34 return Addr;
37 unsigned long fun_BD12_p() {
38 // CHECK-LABEL: define{{.*}} i64 @fun_BD12_p()
39 // CHECK: call i64 asm "lay $0, $1", "=r,p"(ptr nonnull %arrayidx)
40 asm("lay %0, %1" : "=r" (Addr) : "p" (&A[100]));
41 return Addr;
44 unsigned long fun_BDX12_Q() {
45 // CHECK-LABEL: define{{.*}} i64 @fun_BDX12_Q()
46 // CHECK: call i64 asm "lay $0, $1", "=r,^ZQ"(ptr %arrayidx)
47 asm("lay %0, %1" : "=r" (Addr) : "ZQ" (&A[Idx + 100]));
48 return Addr;
51 unsigned long fun_BDX12_R() {
52 // CHECK-LABEL: define{{.*}} i64 @fun_BDX12_R()
53 // CHECK: call i64 asm "lay $0, $1", "=r,^ZR"(ptr %arrayidx)
54 asm("lay %0, %1" : "=r" (Addr) : "ZR" (&A[Idx + 100]));
55 return Addr;
58 unsigned long fun_BDX12_S() {
59 // CHECK-LABEL: define{{.*}} i64 @fun_BDX12_S()
60 // CHECK: call i64 asm "lay $0, $1", "=r,^ZS"(ptr %arrayidx)
61 asm("lay %0, %1" : "=r" (Addr) : "ZS" (&A[Idx + 100]));
62 return Addr;
65 unsigned long fun_BDX12_T() {
66 // CHECK-LABEL: define{{.*}} i64 @fun_BDX12_T()
67 // CHECK: call i64 asm "lay $0, $1", "=r,^ZT"(ptr %arrayidx)
68 asm("lay %0, %1" : "=r" (Addr) : "ZT" (&A[Idx + 100]));
69 return Addr;
72 unsigned long fun_BDX12_p() {
73 // CHECK-LABEL: define{{.*}} i64 @fun_BDX12_p()
74 // CHECK: call i64 asm "lay $0, $1", "=r,p"(ptr %arrayidx)
75 asm("lay %0, %1" : "=r" (Addr) : "p" (&A[Idx + 100]));
76 return Addr;
79 unsigned long fun_BD20_Q() {
80 // CHECK-LABEL: define{{.*}} i64 @fun_BD20_Q()
81 // CHECK: call i64 asm "lay $0, $1", "=r,^ZQ"(ptr nonnull %arrayidx)
82 asm("lay %0, %1" : "=r" (Addr) : "ZQ" (&A[1000]));
83 return Addr;
86 unsigned long fun_BD20_R() {
87 // CHECK-LABEL: define{{.*}} i64 @fun_BD20_R()
88 // CHECK: call i64 asm "lay $0, $1", "=r,^ZR"(ptr nonnull %arrayidx)
89 asm("lay %0, %1" : "=r" (Addr) : "ZR" (&A[1000]));
90 return Addr;
93 unsigned long fun_BD20_S() {
94 // CHECK-LABEL: define{{.*}} i64 @fun_BD20_S()
95 // CHECK: call i64 asm "lay $0, $1", "=r,^ZS"(ptr nonnull %arrayidx)
96 asm("lay %0, %1" : "=r" (Addr) : "ZS" (&A[1000]));
97 return Addr;
100 unsigned long fun_BD20_T() {
101 // CHECK-LABEL: define{{.*}} i64 @fun_BD20_T()
102 // CHECK: call i64 asm "lay $0, $1", "=r,^ZT"(ptr nonnull %arrayidx)
103 asm("lay %0, %1" : "=r" (Addr) : "ZT" (&A[1000]));
104 return Addr;
107 unsigned long fun_BD20_p() {
108 // CHECK-LABEL: define{{.*}} i64 @fun_BD20_p()
109 // CHECK: call i64 asm "lay $0, $1", "=r,p"(ptr nonnull %arrayidx)
110 asm("lay %0, %1" : "=r" (Addr) : "p" (&A[1000]));
111 return Addr;
114 unsigned long fun_BDX20_Q() {
115 // CHECK-LABEL: define{{.*}} i64 @fun_BDX20_Q()
116 // CHECK: call i64 asm "lay $0, $1", "=r,^ZQ"(ptr %arrayidx)
117 asm("lay %0, %1" : "=r" (Addr) : "ZQ" (&A[Idx + 1000]));
118 return Addr;
121 unsigned long fun_BDX20_R() {
122 // CHECK-LABEL: define{{.*}} i64 @fun_BDX20_R()
123 // CHECK: call i64 asm "lay $0, $1", "=r,^ZR"(ptr %arrayidx)
124 asm("lay %0, %1" : "=r" (Addr) : "ZR" (&A[Idx + 1000]));
125 return Addr;
128 unsigned long fun_BDX20_S() {
129 // CHECK-LABEL: define{{.*}} i64 @fun_BDX20_S()
130 // CHECK: call i64 asm "lay $0, $1", "=r,^ZS"(ptr %arrayidx)
131 asm("lay %0, %1" : "=r" (Addr) : "ZS" (&A[Idx + 1000]));
132 return Addr;
135 unsigned long fun_BDX20_T() {
136 // CHECK-LABEL: define{{.*}} i64 @fun_BDX20_T()
137 // CHECK: call i64 asm "lay $0, $1", "=r,^ZT"(ptr %arrayidx)
138 asm("lay %0, %1" : "=r" (Addr) : "ZT" (&A[Idx + 1000]));
139 return Addr;
142 unsigned long fun_BDX20_p() {
143 // CHECK-LABEL: define{{.*}} i64 @fun_BDX20_p()
144 // CHECK: call i64 asm "lay $0, $1", "=r,p"(ptr %arrayidx)
145 asm("lay %0, %1" : "=r" (Addr) : "p" (&A[Idx + 1000]));
146 return Addr;