File: asm_diagnostics.d

package info (click to toggle)
ldc 1%3A1.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,248 kB
  • sloc: cpp: 61,598; ansic: 14,545; sh: 1,014; makefile: 972; asm: 510; objc: 135; exp: 48; python: 12
file content (22 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Try to compile a single object file and check inline asm errors from
// 2 source files.

// REQUIRES: target_X86

// RUN: not %ldc -mtriple=x86_64-linux-gnu %s %S/inputs/asm_diagnostics2.d 2> %t.stderr
// RUN: FileCheck %s < %t.stderr

void foo()
{
    import asm_diagnostics2;
    barTemplate();

    asm { "nope\nnoper\nmovq %0, %%eax" : : "b" (123L); }
}

// CHECK: inputs{{.}}asm_diagnostics2.d(6):1:2: error: invalid instruction mnemonic 'hello'
// CHECK: inputs{{.}}asm_diagnostics2.d(6):2:19: error: invalid register name

// CHECK: asm_diagnostics.d(14):1:2: error: invalid instruction mnemonic 'nope'
// CHECK: asm_diagnostics.d(14):2:1: error: invalid instruction mnemonic 'noper'
// CHECK: asm_diagnostics.d(14):3:12: error: invalid operand for instruction