xref: /llvm-project/clang/test/CodeGen/LoongArch/lasx/inline-asm-gcc-regs.c (revision d25c79dc70008b835312e5cc7ef48b199fda3165)
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --filter "^define |tail call"
2 // RUN: %clang_cc1 -triple loongarch64 -emit-llvm -O2 %s -o - | FileCheck %s
3 
4 typedef signed char v32i8 __attribute__((vector_size(32), aligned(32)));
5 
6 // CHECK-LABEL: @test_xr0(
7 // CHECK:    tail call void asm sideeffect "", "{$xr0}"(<32 x i8> undef) #[[ATTR1:[0-9]+]], !srcloc !2
8 //
test_xr0()9 void test_xr0() {
10     register v32i8 a asm ("$xr0");
11     asm ("" :: "f"(a));
12 }
13 
14 // CHECK-LABEL: @test_xr7(
15 // CHECK:    tail call void asm sideeffect "", "{$xr7}"(<32 x i8> undef) #[[ATTR1]], !srcloc !3
16 //
test_xr7()17 void test_xr7() {
18     register v32i8 a asm ("$xr7");
19     asm ("" :: "f"(a));
20 }
21 
22 // CHECK-LABEL: @test_xr15(
23 // CHECK:    tail call void asm sideeffect "", "{$xr15}"(<32 x i8> undef) #[[ATTR1]], !srcloc !4
24 //
test_xr15()25 void test_xr15() {
26     register v32i8 a asm ("$xr15");
27     asm ("" :: "f"(a));
28 }
29 
30 // CHECK-LABEL: @test_xr31(
31 // CHECK:    tail call void asm sideeffect "", "{$xr31}"(<32 x i8> undef) #[[ATTR1]], !srcloc !5
32 //
test_xr31()33 void test_xr31() {
34     register v32i8 a asm ("$xr31");
35     asm ("" :: "f"(a));
36 }
37