[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / ms-inline-asm.cpp
blob3e445b80f8874f1ceb6d72ce43e86e72ac32ac7c
1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -verify
4 struct A {
5 int a1;
6 int a2;
7 struct B {
8 int b1;
9 int b2;
10 enum { kValue = 42 };
11 } a3;
12 struct {
13 int indirect_field;
17 namespace asdf {
18 A a_global;
21 // The parser combines adjacent __asm blocks into one. Avoid that by calling
22 // this.
23 void split_inline_asm_call();
25 void test_field_lookup() {
26 __asm mov eax, asdf::a_global.a3.b2
27 split_inline_asm_call();
29 // FIXME: These diagnostics are crap.
31 // expected-error@+1 {{undeclared label}}
32 __asm mov eax, asdf::a_global.not_a_field.b2
33 split_inline_asm_call();
35 // expected-error@+1 {{undeclared label}}
36 __asm mov eax, asdf::a_global.a3.not_a_field
37 split_inline_asm_call();
39 __asm mov eax, A::B::kValue
40 split_inline_asm_call();
42 // expected-error@+1 {{undeclared label}}
43 __asm mov eax, asdf::a_global.a3.kValue
44 split_inline_asm_call();
46 __asm mov eax, asdf :: a_global.a3.b2
47 split_inline_asm_call();
49 __asm mov eax, asdf::a_global . a3 . b2
50 split_inline_asm_call();
52 __asm mov eax, asdf::a_global.indirect_field
53 split_inline_asm_call();