Daniel Dunbar | 0d7b091 | 2009-02-03 21:54:49 +0000 | [diff] [blame] | 1 | // RUN: clang -triple i386-unknown-unknown --emit-llvm-bc -o - %s | opt --std-compile-opts | llvm-dis > %t && |
Daniel Dunbar | 894bbab | 2008-08-05 16:15:29 +0000 | [diff] [blame] | 2 | // RUN: grep "ret i32" %t | count 1 && |
| 3 | // RUN: grep "ret i32 1" %t | count 1 |
| 4 | // PR2001 |
| 5 | |
| 6 | /* Test that the result of the assignment properly uses the value *in |
| 7 | the bitfield* as opposed to the RHS. */ |
| 8 | static int foo(int i) { |
| 9 | struct { |
| 10 | int f0 : 2; |
| 11 | } x; |
| 12 | return (x.f0 = i); |
| 13 | } |
| 14 | |
| 15 | int bar() { |
| 16 | return foo(-5) == -1; |
| 17 | } |