blob: 8fef68384fc1b583babaec6eeb4a5a7f84a10376 [file] [log] [blame]
Renato Goline7b3d5d2014-05-27 16:46:27 +00001// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2
3namespace Common {
4enum RenderMode {
5 kRenderEGA,
6 kRenderCGA
7};
8class C;
9class A {
10 A();
11 C *_vm;
12 unsigned char _highlightColorTableVGA[];
13 static const unsigned char b[];
14};
NAKAMURA Takumi753d70c2014-05-28 10:53:06 +000015// CHECK: [[Common_A_b:@[^ ]+]] = constant [1 x i8] zeroinitializer
Renato Goline7b3d5d2014-05-27 16:46:27 +000016class B {
17public:
18 Common::RenderMode _configRenderMode;
19};
20class C : public B {};
21A::A() {
22 0 == Common::kRenderCGA || _vm->_configRenderMode == Common::kRenderEGA
23 ? b
24 : _highlightColorTableVGA;
25// Make sure the PHI value is casted correctly to the PHI type
NAKAMURA Takumi753d70c2014-05-28 10:53:06 +000026// CHECK: %{{.*}} = phi [0 x i8]* [ bitcast ([1 x i8]* [[Common_A_b]] to [0 x i8]*), %{{.*}} ], [ %{{.*}}, %{{.*}} ]
Renato Goline7b3d5d2014-05-27 16:46:27 +000027}
28const unsigned char A::b[] = { 0 };
29}