Douglas Gregor | 58e9797 | 2011-09-06 16:38:46 +0000 | [diff] [blame] | 1 | // Test with PCH |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -std=c++11 -x c++-header -emit-pch -o %t %s |
| 3 | // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s |
Douglas Gregor | 58e9797 | 2011-09-06 16:38:46 +0000 | [diff] [blame] | 4 | |
| 5 | // PR10847 |
| 6 | #ifndef HEADER |
| 7 | #define HEADER |
| 8 | struct NSSize { |
| 9 | double width; |
| 10 | double height; |
| 11 | }; |
| 12 | typedef struct NSSize NSSize; |
| 13 | |
| 14 | static inline NSSize NSMakeSize(double w, double h) { |
| 15 | NSSize s = { w, h }; |
| 16 | return s; |
| 17 | } |
| 18 | #else |
| 19 | float test(float v1, float v2) { |
| 20 | NSSize s = NSMakeSize(v1, v2); |
| 21 | return s.width; |
| 22 | } |
| 23 | #endif |