Chandler Carruth | 6bb5c06 | 2012-12-09 10:39:18 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s |
Eric Christopher | 16bfebc | 2011-08-19 21:24:37 +0000 | [diff] [blame] | 2 | // The store of p.y into the temporary was not |
| 3 | // getting extended to 32 bits, so uninitialized |
| 4 | // bits of the temporary were used. 7366161. |
| 5 | struct foo { |
| 6 | char x:8; |
| 7 | signed int y:24; |
| 8 | }; |
| 9 | int bar(struct foo p, int x) { |
| 10 | // CHECK: bar |
David Blaikie | a953f28 | 2015-02-27 21:19:58 +0000 | [diff] [blame^] | 11 | // CHECK: %[[val:.*]] = load i32, i32* {{.*}} |
Chandler Carruth | ff0e3a1 | 2012-12-06 11:14:44 +0000 | [diff] [blame] | 12 | // CHECK-NEXT: ashr i32 %[[val]] |
David Blaikie | a953f28 | 2015-02-27 21:19:58 +0000 | [diff] [blame^] | 13 | // CHECK: = load i32, i32* {{.*}} |
| 14 | // CHECK: = load i32, i32* {{.*}} |
| 15 | // CHECK: %[[val:.*]] = load i32, i32* {{.*}} |
Chandler Carruth | ff0e3a1 | 2012-12-06 11:14:44 +0000 | [diff] [blame] | 16 | // CHECK-NEXT: ashr i32 %[[val]] |
Eric Christopher | 16bfebc | 2011-08-19 21:24:37 +0000 | [diff] [blame] | 17 | x = (p.y > x ? x : p.y); |
| 18 | return x; |
| 19 | // CHECK: ret |
| 20 | } |