Douglas Gregor | 6c1cb99 | 2010-05-04 17:13:42 +0000 | [diff] [blame^] | 1 | // RUN: %clang-cc1 -fsyntax-only -fmacro-backtrace-limit 5 %s > %t 2>&1 |
| 2 | // RUN: FileCheck %s < %t |
| 3 | |
| 4 | #define M1(A, B) ((A) < (B)) |
| 5 | #define M2(A, B) M1(A, B) |
| 6 | #define M3(A, B) M2(A, B) |
| 7 | #define M4(A, B) M3(A, B) |
| 8 | #define M5(A, B) M4(A, B) |
| 9 | #define M6(A, B) M5(A, B) |
| 10 | #define M7(A, B) M6(A, B) |
| 11 | #define M8(A, B) M7(A, B) |
| 12 | #define M9(A, B) M8(A, B) |
| 13 | #define M10(A, B) M9(A, B) |
| 14 | #define M11(A, B) M10(A, B) |
| 15 | #define M12(A, B) M11(A, B) |
| 16 | |
| 17 | void f(int *ip, float *fp) { |
| 18 | // CHECK: macro-backtrace-limit.c:31:7: warning: comparison of distinct pointer types ('int *' and 'float *') |
| 19 | // CHECK: if (M12(ip, fp)) { } |
| 20 | // CHECK: macro-backtrace-limit.c:15:19: note: instantiated from: |
| 21 | // CHECK: #define M12(A, B) M11(A, B) |
| 22 | // CHECK: macro-backtrace-limit.c:14:19: note: instantiated from: |
| 23 | // CHECK: #define M11(A, B) M10(A, B) |
| 24 | // CHECK: note: (skipping 7 contexts in backtrace; use -fmacro-backtrace-limit=0 to see all) |
| 25 | // CHECK: macro-backtrace-limit.c:6:18: note: instantiated from: |
| 26 | // CHECK: #define M3(A, B) M2(A, B) |
| 27 | // CHECK: macro-backtrace-limit.c:5:18: note: instantiated from: |
| 28 | // CHECK: #define M2(A, B) M1(A, B) |
| 29 | // CHECK: macro-backtrace-limit.c:4:23: note: instantiated from: |
| 30 | // CHECK: #define M1(A, B) ((A) < (B)) |
| 31 | if (M12(ip, fp)) { } |
| 32 | } |