diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-03-25 21:09:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-03-25 21:09:49 +0000 |
commit | c4fc3a2ba52d24195ab06388c662b118a2664358 (patch) | |
tree | 4139da3dca6baebf14abc1dc4326880dfcfd8871 /clang/test/Sema/asm.c | |
parent | 8c0d63c120cc76fefdb128d0b07b8b1cdf183c26 (diff) | |
download | bcm5719-llvm-c4fc3a2ba52d24195ab06388c662b118a2664358.tar.gz bcm5719-llvm-c4fc3a2ba52d24195ab06388c662b118a2664358.zip |
Emit an error message instead of crashing when dereferencing an incomplete pointer type.
If the ASM statement is dereferencing an incomplete pointer type, issue an error
instead of crashing.
<rdar://problem/12700799>
llvm-svn: 177915
Diffstat (limited to 'clang/test/Sema/asm.c')
-rw-r--r-- | clang/test/Sema/asm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/asm.c b/clang/test/Sema/asm.c index 155d736b995..b901e378cf3 100644 --- a/clang/test/Sema/asm.c +++ b/clang/test/Sema/asm.c @@ -123,3 +123,10 @@ void test13(void) { void *esp; __asm__ volatile ("mov %%esp, %o" : "=r"(esp) : : ); // expected-error {{invalid % escape in inline assembly string}} } + +// <rdar://problem/12700799> +struct S; +void test14(struct S *s) { + __asm("": : "a"(*s)); // expected-error {{dereference of pointer to incomplete type 'struct S'}} + __asm("": "=a" (*s) :); // expected-error {{dereference of pointer to incomplete type 'struct S'}} +} |