1 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++11 -Wuninitialized -verify %s
3 // test1: Expect no diagnostics
6 asm goto("" : "=r"(y
) : "r"(x
) : : err
);
12 // test2: Expect no diagnostics
16 asm goto("" : "+S"(x
), "+D"(y
) : "r"(x
) :: indirect_1
, indirect_2
);
18 asm goto("" : "+S"(x
), "+D"(y
) : "r"(x
), "r"(y
) :: indirect_1
, indirect_2
);
26 // test3: Expect no diagnostics
29 asm goto("" : "=&r"(y
) : "r"(x
) : : fail
);
40 // test4: Expect no diagnostics
47 asm goto("" : "=r"(y
) : "r"(x
) : : backward
);
51 // test5: Expect no diagnostics
54 asm goto("" : "+S"(x
), "+D"(y
) : "r"(x
) :: indirect
, fallthrough
);
61 // test6: Expect no diagnostics.
62 int test6(unsigned int *x
) {
65 // See through casts and unary operators.
66 asm goto("" : "=r" (*(unsigned int *)(&val
)) ::: indirect
);
73 // test7: Expect no diagnostics.
77 asm goto ("":"=r"(x
):::A1
,A2
);
84 // test8: Expect no diagnostics
87 asm goto ("":"=r"(x
):::A1
,A2
);
94 // test9: Expect no diagnostics
97 asm goto("": "=r"(y
) :::out
);
104 int y
; // expected-note {{initialize the variable 'y' to silence this warning}}
108 return y
; // expected-warning {{variable 'y' is uninitialized when used here}}