1 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s 2 // RUN: %clang_cc1 -fsyntax-only -pedantic -verify=system -Wsystem-headers %s 3 4 int x; 5 6 # 42 // #1 7 // expected-warning@#1 {{this style of line directive is a GNU extension}} 8 // system-warning@#1 {{this style of line directive is a GNU extension}} 9 # 42 "foo" // #2 10 // expected-warning@#2 {{this style of line directive is a GNU extension}} 11 // system-warning@#2 {{this style of line directive is a GNU extension}} 12 # 42 "foo" 2 // #3 13 // expected-error@#3 {{invalid line marker flag '2': cannot pop empty include stack}} 14 // system-error@#3 {{invalid line marker flag '2': cannot pop empty include stack}} 15 # 42 "foo" 1 3 // #4: enter 16 // Warnings silenced when -Wsystem-headers isn't passed. 17 // system-warning@#4 {{this style of line directive is a GNU extension}} 18 # 42 "foo" 2 3 // #5: exit 19 // Warnings silenced when -Wsystem-headers isn't passed. 20 // system-warning@#5 {{this style of line directive is a GNU extension}} 21 # 42 "foo" 2 3 4 // #6 22 // expected-error@#6 {{invalid line marker flag '2': cannot pop empty include stack}} 23 // system-error@#6 {{invalid line marker flag '2': cannot pop empty include stack}} 24 # 42 "foo" 3 4 // #7 25 // expected-warning@#7 {{this style of line directive is a GNU extension}} 26 // system-warning@#7 {{this style of line directive is a GNU extension}} 27 28 29 // Verify that linemarker diddling of the system header flag works. 30 31 # 192 "glomp.h" // #8: not a system header. 32 // expected-warning@#8 {{this style of line directive is a GNU extension}} 33 // system-warning@#8 {{this style of line directive is a GNU extension}} 34 35 # 192 "glomp.h" 3 // #9: System header. 36 // Warnings silenced when -Wsystem-headers isn't passed. 37 // system-warning@#9 {{this style of line directive is a GNU extension}} 38 39 #line 42 "blonk.h" // doesn't change system headerness. 40 41 # 97 // #10: doesn't change system headerness. 42 // Warnings silenced when -Wsystem-headers isn't passed. 43 // system-warning@#10 {{this style of line directive is a GNU extension}} 44 45 # 42 "blonk.h" // #11: DOES change system headerness. 46 // Warnings silenced when -Wsystem-headers isn't passed. 47 // system-warning@#11 {{this style of line directive is a GNU extension}} 48