blob: bff6ac7bc81c2ae63d66478d957bbfa8e0b7ce8c [file] [log] [blame]
Chandler Carruth6bb5c062012-12-09 10:39:18 +00001// RUN: %clang_cc1 %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
Eric Christopher16bfebc2011-08-19 21:24:37 +00002// 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.
5struct foo {
6 char x:8;
7 signed int y:24;
8};
9int bar(struct foo p, int x) {
10// CHECK: bar
David Blaikiea953f282015-02-27 21:19:58 +000011// CHECK: %[[val:.*]] = load i32, i32* {{.*}}
Chandler Carruthff0e3a12012-12-06 11:14:44 +000012// CHECK-NEXT: ashr i32 %[[val]]
David Blaikiea953f282015-02-27 21:19:58 +000013// CHECK: = load i32, i32* {{.*}}
14// CHECK: = load i32, i32* {{.*}}
15// CHECK: %[[val:.*]] = load i32, i32* {{.*}}
Chandler Carruthff0e3a12012-12-06 11:14:44 +000016// CHECK-NEXT: ashr i32 %[[val]]
Eric Christopher16bfebc2011-08-19 21:24:37 +000017 x = (p.y > x ? x : p.y);
18 return x;
19// CHECK: ret
20}