| // RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s |
| // CHECK: %"struct.rdar20621065::B" = type { float, float } |
| explicit A(unsigned a = 0xffffffff) : a(a) { } |
| C(const C& other) : A(0x12345678), Empty(other) { } |
| D& operator=(const D& other) { |
| #define CHECK(x) if (!(x)) return __LINE__ |
| // CHECK-LABEL: define i32 @_Z1fv() |
| // Check that A::a is not overwritten by the Empty default constructor. |
| CHECK(b1.a == 0xffffffff); |
| // Check that A::a has the value set in the C::C copy constructor. |
| CHECK(c2.a == 0x12345678); |
| // Check that A::as has the value set in the D copy assignment operator. |
| CHECK(d2.a == 0x87654321); |
| extern "C" void printf(const char *, ...); |
| printf("test on line %d failed!\n", result); |
| // Type checked at the top of the file. |
| // This test used to crash when CGRecordLayout::getNonVirtualBaseLLVMFieldNo was called. |
| namespace record_layout { |