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 |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 4 | // expected-no-diagnostics |
Douglas Gregor | 58e9797 | 2011-09-06 16:38:46 +0000 | [diff] [blame] | 5 | |
| 6 | // PR10847 |
| 7 | #ifndef HEADER |
| 8 | #define HEADER |
| 9 | struct NSSize { |
| 10 | double width; |
| 11 | double height; |
| 12 | }; |
| 13 | typedef struct NSSize NSSize; |
| 14 | |
| 15 | static inline NSSize NSMakeSize(double w, double h) { |
| 16 | NSSize s = { w, h }; |
| 17 | return s; |
| 18 | } |
| 19 | #else |
| 20 | float test(float v1, float v2) { |
| 21 | NSSize s = NSMakeSize(v1, v2); |
| 22 | return s.width; |
| 23 | } |
| 24 | #endif |