1; RUN: llc < %s -march=bpfel -verify-machineinstrs | FileCheck %s 2; RUN: llc < %s -march=bpfeb -verify-machineinstrs | FileCheck %s 3 4; Source code: 5; int g[2]; 6; 7; int test(void *ctx) { 8; int a = 4, b; 9; unsigned long long c = 333333333333ULL; 10; asm volatile("r0 = *(u16 *)skb[%0]" : : "i"(2)); 11; asm volatile("r0 = *(u16 *)skb[%0]" : : "r"(a)); 12; asm volatile("%0 = %1" : "=r"(b) : "i"(4)); 13; asm volatile("%0 = %1 ll" : "=r"(b) : "i"(c)); 14; asm volatile("%0 = *(u16 *) %1" : "=r"(b) : "m"(a)); 15; asm volatile("%0 = *(u32 *) %1" : "=r"(b) : "m"(g[1])); 16; return b; 17; } 18; 19 20@g = common global [2 x i32] zeroinitializer, align 4 21 22; Function Attrs: nounwind 23define i32 @test(i8* nocapture readnone %ctx) local_unnamed_addr #0 { 24entry: 25 %a = alloca i32, align 4 26 %0 = bitcast i32* %a to i8* 27 call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0) #2 28 store i32 4, i32* %a, align 4 29 tail call void asm sideeffect "r0 = *(u16 *)skb[$0]", "i"(i32 2) #2 30; CHECK: r0 = *(u16 *)skb[2] 31 tail call void asm sideeffect "r0 = *(u16 *)skb[$0]", "r"(i32 4) #2 32; CHECK: r0 = *(u16 *)skb[r1] 33 %1 = tail call i32 asm sideeffect "$0 = $1", "=r,i"(i32 4) #2 34; CHECK: r1 = 4 35 %2 = tail call i32 asm sideeffect "$0 = $1 ll", "=r,i"(i64 333333333333) #2 36; CHECK: r1 = 333333333333 ll 37 %3 = call i32 asm sideeffect "$0 = *(u16 *) $1", "=r,*m"(i32* nonnull %a) #2 38; CHECK: r1 = *(u16 *) (r10 - 4) 39 %4 = call i32 asm sideeffect "$0 = *(u32 *) $1", "=r,*m"(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @g, i64 0, i64 1)) #2 40; CHECK: r1 = g ll 41; CHECK: r0 = *(u32 *) (r1 + 4) 42 call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %0) #2 43 ret i32 %4 44} 45 46; Function Attrs: argmemonly nounwind 47declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1 48 49; Function Attrs: argmemonly nounwind 50declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1 51 52attributes #0 = { nounwind } 53attributes #1 = { argmemonly nounwind } 54attributes #2 = { nounwind } 55