1 /* Adapted from cpp/Winvalid-utf8-1.c
3 P2295R6 - Support for UTF-8 as a portable source file encoding
4 This test intentionally contains various byte sequences which are not valid UTF-8
6 { dg-options "-finput-charset=UTF-8 -Winvalid-utf8 -fdiagnostics-format=sarif-file" } */
47 /* Verify that we generate a valid UTF-8 .sarif file.
49 { dg-final { verify-sarif-file } }
51 Verify that we captured the expected warnings.
53 { dg-final { scan-sarif-file "\"results\": \\\[" } }
54 { dg-final { scan-sarif-file "\"level\": \"warning\"" } }
55 { dg-final { scan-sarif-file "\"ruleId\": \"-Winvalid-utf8\"" } }
56 { dg-final { scan-sarif-file "\"message\": " } }
57 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <80>"} } }
58 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }
59 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c0>"} } }
60 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c1>"} } }
61 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f5>"} } }
62 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ff>"} } }
63 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c2>"} } }
64 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0>"} } }
65 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><80><bf>"} } }
66 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><9f><80>"} } }
67 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><bf>"} } }
68 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ec><80>"} } }
69 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ed><a0><80>"} } }
70 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f0><80><80><80>"} } }
71 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f0><8f><bf><bf>"} } }
72 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f4><90><80><80>"} } }
73 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <fd><bf><bf><bf>"} } }
74 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }
75 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }
76 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <80>"} } }
77 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }
78 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c0>"} } }
79 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c1>"} } }
80 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f5>"} } }
81 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ff>"} } }
82 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <c2>"} } }
83 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0>"} } }
84 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><80><bf>"} } }
85 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><9f><80>"} } }
86 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <e0><bf>"} } }
87 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ec><80>"} } }
88 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <ed><a0><80>"} } }
89 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f0><80><80><80>"} } }
90 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f0><8f><bf><bf>"} } }
91 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <f4><90><80><80>"} } }
92 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <fd><bf><bf><bf>"} } }
93 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }
94 { dg-final { scan-sarif-file {"text": "invalid UTF-8 character <bf>"} } }