brintos

brintos / llvm-project-archived public Read only

0
0
Text · 794 B · ae2d6b4 Raw
31 lines · plain
1; RUN: llc -verify-machineinstrs -o - %s -mtriple=aarch64-linux-gnu | FileCheck %s2 3@var32 = dso_local global i32 04@var64 = dso_local global i64 05 6define dso_local void @test_zr() {7; CHECK-LABEL: test_zr:8 9  store i32 0, ptr @var3210; CHECK: str wzr, [{{x[0-9]+}}, {{#?}}:lo12:var32]11  store i64 0, ptr @var6412; CHECK: str xzr, [{{x[0-9]+}}, {{#?}}:lo12:var64]13 14  ret void15; CHECK: ret16}17 18define dso_local void @test_sp(i32 %val) {19; CHECK-LABEL: test_sp:20 21; Important correctness point here is that LLVM doesn't try to use xzr22; as an addressing register: "str w0, [xzr]" is not a valid A6423; instruction (0b11111 in the Rn field would mean "sp").24  %addr = getelementptr i32, ptr null, i64 025  store i32 %val, ptr %addr26; CHECK: str {{w[0-9]+}}, [{{x[0-9]+|sp}}]27 28  ret void29; CHECK: ret30}31