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 |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 3 | |
| 4 | // 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 |
Will Dietz | b854036 | 2012-11-27 15:01:55 +0000 | [diff] [blame] | 5 | // CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|bounds),?){13}"}} |
| 6 | // |
| 7 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER |
| 8 | // CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift),?){4}"}} |
| 9 | |
| 10 | // 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 |
| 11 | // CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|bounds),?){11}"}} |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 12 | |
Alexey Samsonov | 4d1a6e4 | 2012-11-29 22:36:21 +0000 | [diff] [blame] | 13 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address-full %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-FULL |
| 14 | // CHECK-ASAN-FULL: "-fsanitize={{((address|init-order|use-after-return|use-after-scope),?){4}"}} |
| 15 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 16 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI |
| 17 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 18 | // CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti' |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 19 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 20 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT |
Richard Smith | c4dabad | 2012-11-05 22:04:41 +0000 | [diff] [blame] | 21 | // CHECK-SANA-SANT: '-fsanitize=address' not allowed with '-fsanitize=thread' |
| 22 | |
Evgeniy Stepanov | 99469f7 | 2012-12-05 13:37:12 +0000 | [diff] [blame^] | 23 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address,memory -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANM |
| 24 | // CHECK-SANA-SANM: '-fsanitize=address' not allowed with '-fsanitize=memory' |
| 25 | |
| 26 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,memory -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANT-SANM |
| 27 | // CHECK-SANT-SANM: '-fsanitize=thread' not allowed with '-fsanitize=memory' |
| 28 | |
| 29 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT |
| 30 | // CHECK-SANM-SANT: '-fsanitize=thread' not allowed with '-fsanitize=memory' |
| 31 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 32 | // RUN: %clang -target x86_64-linux-gnu -faddress-sanitizer -fthread-sanitizer -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ASAN-TSAN |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 33 | // CHECK-ASAN-TSAN: '-faddress-sanitizer' not allowed with '-fthread-sanitizer' |
| 34 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 35 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=init-order %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-EXTRA-ASAN |
Alexey Samsonov | 4d1a6e4 | 2012-11-29 22:36:21 +0000 | [diff] [blame] | 36 | // CHECK-ONLY-EXTRA-ASAN: argument '-fsanitize=init-order' only allowed with '-fsanitize=address' |
| 37 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 38 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize=alignment -fsanitize=vptr -fno-sanitize=vptr %s -### 2>&1 |
Richard Smith | 0565037 | 2012-12-01 01:02:45 +0000 | [diff] [blame] | 39 | // OK |
Alexey Samsonov | 3325b16 | 2012-11-28 17:34:24 +0000 | [diff] [blame] | 40 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 41 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1 |
Richard Smith | 0565037 | 2012-12-01 01:02:45 +0000 | [diff] [blame] | 42 | // OK |
Alexey Samsonov | 3325b16 | 2012-11-28 17:34:24 +0000 | [diff] [blame] | 43 | |
Joey Gouly | 4247d9c | 2012-12-01 13:07:22 +0000 | [diff] [blame] | 44 | // RUN: %clang -target x86_64-linux-gnu -fcatch-undefined-behavior -fthread-sanitizer -fno-thread-sanitizer -faddress-sanitizer -fno-address-sanitizer -fbounds-checking -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEPRECATED |
Richard Smith | 04fd382 | 2012-11-06 01:12:02 +0000 | [diff] [blame] | 45 | // CHECK-DEPRECATED: argument '-fcatch-undefined-behavior' is deprecated, use '-fsanitize=undefined' instead |
| 46 | // CHECK-DEPRECATED: argument '-fthread-sanitizer' is deprecated, use '-fsanitize=thread' instead |
| 47 | // CHECK-DEPRECATED: argument '-fno-thread-sanitizer' is deprecated, use '-fno-sanitize=thread' instead |
| 48 | // CHECK-DEPRECATED: argument '-faddress-sanitizer' is deprecated, use '-fsanitize=address' instead |
| 49 | // 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] | 50 | // CHECK-DEPRECATED: argument '-fbounds-checking' is deprecated, use '-fsanitize=bounds' instead |
Evgeniy Stepanov | 99469f7 | 2012-12-05 13:37:12 +0000 | [diff] [blame^] | 51 | |
| 52 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE |
| 53 | // CHECK-TSAN-NO-PIE: invalid argument '-fsanitize=thread' only allowed with '-pie' |
| 54 | |
| 55 | // RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NO-PIE |
| 56 | // CHECK-MSAN-NO-PIE: invalid argument '-fsanitize=memory' only allowed with '-pie' |
| 57 | |
| 58 | // RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-NO-PIE |
| 59 | // CHECK-ANDROID-ASAN-NO-PIE: AddressSanitizer on Android requires '-pie' |