Chris Lattner | 9bffb07 | 2010-04-23 16:29:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple armv6-unknown-unknown -emit-llvm -o - %s | FileCheck %s |
Daniel Dunbar | c1f2cdd | 2009-09-17 07:03:19 +0000 | [diff] [blame] | 2 | |
Daniel Dunbar | c1f2cdd | 2009-09-17 07:03:19 +0000 | [diff] [blame] | 3 | void test0(void) { |
| 4 | asm volatile("mov r0, r0" :: ); |
| 5 | } |
| 6 | void test1(void) { |
| 7 | asm volatile("mov r0, r0" ::: |
| 8 | "cc", "memory" ); |
| 9 | } |
| 10 | void 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 | } |
| 16 | void 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 Lattner | 9bffb07 | 2010-04-23 16:29:58 +0000 | [diff] [blame] | 22 | |
| 23 | |
| 24 | // {} should not be treated as asm variants. |
| 25 | void 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 Dunbar | 1fd7171 | 2010-08-11 02:17:11 +0000 | [diff] [blame] | 33 | |
| 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}"() |
| 38 | void test5() { |
| 39 | __asm__("" : : : "r13", "r14", "r15", "sp", "lr", "pc"); |
| 40 | } |
Daniel Dunbar | bf3d552 | 2010-08-11 02:17:20 +0000 | [diff] [blame] | 41 | |
| 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}"() |
| 48 | void 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 | } |