2012-05-08 04:23:03 +08:00
|
|
|
// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm %s -o - | FileCheck %s
|
2010-04-11 02:34:14 +08:00
|
|
|
|
|
|
|
// PR6805
|
2012-05-08 04:23:03 +08:00
|
|
|
// CHECK: @foo
|
2010-04-11 02:34:14 +08:00
|
|
|
void foo() {
|
|
|
|
union { int i; } u;
|
2012-05-08 04:23:03 +08:00
|
|
|
// CHECK: objectsize
|
2012-05-08 09:54:53 +08:00
|
|
|
// CHECK: icmp uge
|
2010-04-11 02:34:14 +08:00
|
|
|
u.i=1;
|
|
|
|
}
|
2012-05-08 04:23:03 +08:00
|
|
|
|
|
|
|
// CHECK: @bar
|
|
|
|
int bar(int *a) {
|
|
|
|
// CHECK: objectsize
|
2012-05-08 09:54:53 +08:00
|
|
|
// CHECK: icmp uge
|
2012-05-08 04:23:03 +08:00
|
|
|
return *a;
|
|
|
|
}
|