Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 1 | // RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED |
| 2 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame^] | 3 | // CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|bounds),?){12}"}} |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 4 | |
| 5 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-thread-sanitizer -fno-sanitize=float-cast-overflow,vptr %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame^] | 6 | // CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|bounds),?){10}"}} |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 7 | |
NAKAMURA Takumi | 17b00a4 | 2012-11-06 20:44:29 +0000 | [diff] [blame] | 8 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI |
| 9 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 10 | // CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti' |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 11 | |
NAKAMURA Takumi | 17b00a4 | 2012-11-06 20:44:29 +0000 | [diff] [blame] | 12 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 13 | // CHECK-SANA-SANT: '-fsanitize=address' not allowed with '-fsanitize=thread' |
| 14 | |
NAKAMURA Takumi | 17b00a4 | 2012-11-06 20:44:29 +0000 | [diff] [blame] | 15 | // RUN: %clang -target x86_64-linux-gnu -faddress-sanitizer -fthread-sanitizer -fno-rtti %s -c -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TSAN |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 16 | // CHECK-ASAN-TSAN: '-faddress-sanitizer' not allowed with '-fthread-sanitizer' |
| 17 | |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame^] | 18 | // RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior -fthread-sanitizer -fno-thread-sanitizer -faddress-sanitizer -fno-address-sanitizer -fbounds-checking -c -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 19 | // CHECK-DEPRECATED: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined' instead |
| 20 | // CHECK-DEPRECATED: argument '-fthread-sanitizer' is deprecated, use '-fsanitize=thread' instead |
| 21 | // CHECK-DEPRECATED: argument '-fno-thread-sanitizer' is deprecated, use '-fno-sanitize=thread' instead |
| 22 | // CHECK-DEPRECATED: argument '-faddress-sanitizer' is deprecated, use '-fsanitize=address' instead |
| 23 | // CHECK-DEPRECATED: argument '-fno-address-sanitizer' is deprecated, use '-fno-sanitize=address' instead |
Joey Gouly | 8548908 | 2012-11-23 10:39:49 +0000 | [diff] [blame^] | 24 | // CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use '-fsanitize=bounds' instead |