"Fossies" - the Fresh Open Source Software Archive

Member "cfe-9.0.0.src/test/CodeGen/x86-64-inline-asm.c" (8 Mar 2019, 1205 Bytes) of package /linux/misc/cfe-9.0.0.src.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "x86-64-inline-asm.c": 8.0.1_vs_9.0.0.

    1 // REQUIRES: x86-registered-target
    2 // RUN: %clang_cc1 -triple x86_64 %s -S -o /dev/null -DWARN -verify
    3 // RUN: %clang_cc1 -triple x86_64 %s -S -o /dev/null -Werror -verify
    4 // RUN: %clang_cc1 -triple x86_64-linux-gnu %s -S -o - | FileCheck %s
    5 void f() {
    6   asm("movaps %xmm3, (%esi, 2)");
    7 // expected-note@1 {{instantiated into assembly here}}
    8 #ifdef WARN
    9 // expected-warning@-3 {{scale factor without index register is ignored}}
   10 #else
   11 // expected-error@-5 {{scale factor without index register is ignored}}
   12 #endif
   13 }
   14 
   15 static unsigned var[1] = {};
   16 void g(void) { asm volatile("movd %%xmm0, %0"
   17                             :
   18                             : "m"(var)); }
   19 
   20 void pr40890(void) {
   21   struct s {
   22     int a, b;
   23   } s;
   24   __asm__ __volatile__("\n#define S_A abcd%0\n" : : "n"(&((struct s*)0)->a));
   25   __asm__ __volatile__("\n#define S_B abcd%0\n" : : "n"(&((struct s*)0)->b));
   26   __asm__ __volatile__("\n#define BEEF abcd%0\n" : : "n"((int*)0xdeadbeeeeeef));
   27   __asm__ __volatile__("movabsq %0, %%rax" : : "n"(4624529908474429119));
   28 
   29 // CHECK-LABEL: pr40890
   30 // CHECK: #define S_A abcd$0
   31 // CHECK: #define S_B abcd$4
   32 // CHECK: #define BEEF abcd$244837814038255
   33 // CHECK: movabsq $4624529908474429119, %rax
   34 }