Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [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 | }; |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 15 | // CHECK: [[Common_A_b:@[^ ]+]] = constant [1 x i8] zeroinitializer |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 16 | class B { |
| 17 | public: |
| 18 | Common::RenderMode _configRenderMode; |
| 19 | }; |
| 20 | class C : public B {}; |
| 21 | A::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 |
Stephen Hines | c568f1e | 2014-07-21 00:47:37 -0700 | [diff] [blame] | 26 | // CHECK: %{{.*}} = phi [0 x i8]* [ bitcast ([1 x i8]* [[Common_A_b]] to [0 x i8]*), %{{.*}} ], [ %{{.*}}, %{{.*}} ] |
Stephen Hines | 6bcf27b | 2014-05-29 04:14:42 -0700 | [diff] [blame] | 27 | } |
| 28 | const unsigned char A::b[] = { 0 }; |
| 29 | } |