2012-11-09 04:34:25 +08:00
|
|
|
// RUN: %clang -O3 -emit-llvm -S -o - %s | FileCheck %s
|
2009-05-02 04:41:21 +08:00
|
|
|
|
|
|
|
long long f0(void) {
|
|
|
|
struct { unsigned f0 : 32; } x = { 18 };
|
|
|
|
return (long long) (x.f0 - (int) 22);
|
|
|
|
}
|
2012-11-02 17:59:06 +08:00
|
|
|
// CHECK: @f0()
|
|
|
|
// CHECK: ret i64 4294967292
|
2009-05-02 04:41:21 +08:00
|
|
|
|
|
|
|
long long f1(void) {
|
|
|
|
struct { unsigned f0 : 31; } x = { 18 };
|
|
|
|
return (long long) (x.f0 - (int) 22);
|
|
|
|
}
|
2012-11-02 17:59:06 +08:00
|
|
|
// CHECK: @f1()
|
|
|
|
// CHECK: ret i64 -4
|
2009-05-02 04:41:21 +08:00
|
|
|
|
|
|
|
long long f2(void) {
|
|
|
|
struct { unsigned f0 ; } x = { 18 };
|
|
|
|
return (long long) (x.f0 - (int) 22);
|
|
|
|
}
|
2012-11-02 17:59:06 +08:00
|
|
|
// CHECK: @f2()
|
|
|
|
// CHECK: ret i64 4294967292
|