blob: 633bf5569dd604ed9adc2a0fca5b7e9710721c06 [file] [log] [blame]
Chris Lattner9bffb072010-04-23 16:29:58 +00001// RUN: %clang_cc1 -triple armv6-unknown-unknown -emit-llvm -o - %s | FileCheck %s
Daniel Dunbarc1f2cdd2009-09-17 07:03:19 +00002
Daniel Dunbarc1f2cdd2009-09-17 07:03:19 +00003void test0(void) {
4 asm volatile("mov r0, r0" :: );
5}
6void test1(void) {
7 asm volatile("mov r0, r0" :::
8 "cc", "memory" );
9}
10void test2(void) {
11 asm volatile("mov r0, r0" :::
12 "r0", "r1", "r2", "r3");
13 asm volatile("mov r0, r0" :::
14 "r4", "r5", "r6", "r8");
15}
16void test3(void) {
17 asm volatile("mov r0, r0" :::
18 "a1", "a2", "a3", "a4");
19 asm volatile("mov r0, r0" :::
20 "v1", "v2", "v3", "v5");
21}
Chris Lattner9bffb072010-04-23 16:29:58 +000022
23
24// {} should not be treated as asm variants.
25void test4(float *a, float *b) {
26 // CHECK: @test4
27 // CHECK: call void asm sideeffect "vld1.32 {d8[],d9[]},
28 __asm__ volatile (
29 "vld1.32 {d8[],d9[]}, [%1,:32] \n\t"
30 "vst1.32 {q4}, [%0,:128] \n\t"
31 :: "r"(a), "r"(b));
32}
Daniel Dunbar1fd71712010-08-11 02:17:11 +000033
34// {sp, lr, pc} are the canonical names for {r13, r14, r15}.
35//
36// CHECK: @test5
37// CHECK: call void asm sideeffect "", "~{sp},~{lr},~{pc},~{sp},~{lr},~{pc}"()
38void test5() {
39 __asm__("" : : : "r13", "r14", "r15", "sp", "lr", "pc");
40}
Daniel Dunbarbf3d5522010-08-11 02:17:20 +000041
42// CHECK: @test6
43// CHECK: call void asm sideeffect "", "
44// CHECK: ~{s0},~{s1},~{s2},~{s3},~{s4},~{s5},~{s6},~{s7},
45// CHECK: ~{s8},~{s9},~{s10},~{s11},~{s12},~{s13},~{s14},~{s15},
46// CHECK: ~{s16},~{s17},~{s18},~{s19},~{s20},~{s21},~{s22},~{s23},
47// CHECK: ~{s24},~{s25},~{s26},~{s27},~{s28},~{s29},~{s30},~{s31}"()
48void test6() {
49 __asm__("" : : :
50 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
51 "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
52 "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
53 "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31");
54}