diff options
author | John McCall <rjmccall@apple.com> | 2010-12-04 03:47:34 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-04 03:47:34 +0000 |
commit | 34376a68c414ccf372e9d83f3251ecb08eb055f2 (patch) | |
tree | 336b12526893f3694b8cb5654fef621818daca81 /clang/test/CodeGen/volatile-1.c | |
parent | 1c8ac8f027d4a7af830e91513f37a2139c684f19 (diff) | |
download | bcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.tar.gz bcm5719-llvm-34376a68c414ccf372e9d83f3251ecb08eb055f2.zip |
Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.
In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.
This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.
Ted Kremenek kindly contributed the analyzer workarounds in this patch.
llvm-svn: 120890
Diffstat (limited to 'clang/test/CodeGen/volatile-1.c')
-rw-r--r-- | clang/test/CodeGen/volatile-1.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/CodeGen/volatile-1.c b/clang/test/CodeGen/volatile-1.c index e4c6c679bd2..d8ce39acd9f 100644 --- a/clang/test/CodeGen/volatile-1.c +++ b/clang/test/CodeGen/volatile-1.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-unused-value -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -o - | FileCheck %s // CHECK: @i = common global [[INT:i[0-9]+]] 0 volatile int i, j, k; @@ -301,3 +301,13 @@ void test() { printf("s.x is at %p\n", &((s = s1).x)); #endif } + +extern volatile enum X x; +// CHECK: define void @test1() +void test1() { + // CHECK-NEXT: : + // CHECK-NEXT: ret void + x; + (void) x; + return x; +} |