Renato Golin | e7b3d5d | 2014-05-27 16:46:27 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s |
| 2 | |
| 3 | namespace Common { |
| 4 | enum RenderMode { |
| 5 | kRenderEGA, |
| 6 | kRenderCGA |
| 7 | }; |
| 8 | class C; |
| 9 | class A { |
| 10 | A(); |
| 11 | C *_vm; |
| 12 | unsigned char _highlightColorTableVGA[]; |
| 13 | static const unsigned char b[]; |
| 14 | }; |
| 15 | class B { |
| 16 | public: |
| 17 | Common::RenderMode _configRenderMode; |
| 18 | }; |
| 19 | class C : public B {}; |
| 20 | A::A() { |
| 21 | 0 == Common::kRenderCGA || _vm->_configRenderMode == Common::kRenderEGA |
| 22 | ? b |
| 23 | : _highlightColorTableVGA; |
| 24 | // Make sure the PHI value is casted correctly to the PHI type |
Renato Golin | a627a10 | 2014-05-27 17:01:21 +0000 | [diff] [blame^] | 25 | // CHECK: %{{.*}} = phi [0 x i8]* [ bitcast ([1 x i8]* @_ZN6Common1A1bE to [0 x i8]*), %{{.*}} ], [ %{{.*}}, %{{.*}} ] |
Renato Golin | e7b3d5d | 2014-05-27 16:46:27 +0000 | [diff] [blame] | 26 | } |
| 27 | const unsigned char A::b[] = { 0 }; |
| 28 | } |