2013-01-30 07:31:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize-undefined-trap-on-error -fsanitize=undefined-trap %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP
|
2013-10-23 06:51:04 +08:00
|
|
|
// CHECK-UNDEFINED-TRAP: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift|unreachable|return|vla-bound|alignment|null|object-size|float-cast-overflow|array-bounds|enum|bool),?){14}"}}
|
2013-01-30 07:31:22 +08:00
|
|
|
// CHECK-UNDEFINED-TRAP: "-fsanitize-undefined-trap-on-error"
|
|
|
|
|
2012-11-06 06:04:41 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED
|
2013-10-23 06:51:04 +08:00
|
|
|
// CHECK-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|vptr|object-size|float-cast-overflow|array-bounds|enum|bool),?){16}"}}
|
2012-11-06 06:04:41 +08:00
|
|
|
|
2013-11-02 02:16:25 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-DARWIN
|
|
|
|
// CHECK-UNDEFINED-DARWIN: "-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|array-bounds|enum|bool),?){15}"}}
|
|
|
|
|
2012-11-27 23:01:55 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=integer %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-INTEGER
|
|
|
|
// CHECK-INTEGER: "-fsanitize={{((signed-integer-overflow|unsigned-integer-overflow|integer-divide-by-zero|shift),?){4}"}}
|
|
|
|
|
2014-03-21 15:15:47 +08:00
|
|
|
// RUN: %clang -fsanitize=bounds -### -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=CHECK-BOUNDS
|
|
|
|
// CHECK-BOUNDS: "-fsanitize={{((array-bounds|local-bounds),?){2}"}}
|
|
|
|
|
2014-03-20 18:48:29 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,undefined -fno-sanitize=thread -fno-sanitize=float-cast-overflow,vptr,bool,enum %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-PARTIAL-UNDEFINED
|
2013-10-23 06:51:04 +08:00
|
|
|
// CHECK-PARTIAL-UNDEFINED: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|function|shift|unreachable|return|vla-bound|alignment|null|object-size|array-bounds),?){12}"}}
|
2012-11-06 06:04:41 +08:00
|
|
|
|
2013-01-30 07:31:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP-ON-ERROR-UNDEF
|
|
|
|
// CHECK-UNDEFINED-TRAP-ON-ERROR-UNDEF: '-fsanitize=undefined' not allowed with '-fsanitize-undefined-trap-on-error'
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fsanitize-undefined-trap-on-error %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-UNDEFINED-TRAP-ON-ERROR-VPTR
|
|
|
|
// CHECK-UNDEFINED-TRAP-ON-ERROR-VPTR: '-fsanitize=vptr' not allowed with '-fsanitize-undefined-trap-on-error'
|
|
|
|
|
2012-12-01 21:07:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=undefined -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-VPTR-NO-RTTI
|
2012-11-06 09:12:02 +08:00
|
|
|
// CHECK-VPTR-NO-RTTI: '-fsanitize=vptr' not allowed with '-fno-rtti'
|
2012-11-06 06:04:41 +08:00
|
|
|
|
2012-12-01 21:07:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,thread -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANT
|
2012-11-06 06:04:41 +08:00
|
|
|
// CHECK-SANA-SANT: '-fsanitize=address' not allowed with '-fsanitize=thread'
|
|
|
|
|
2012-12-24 16:42:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANM
|
2012-12-05 21:37:12 +08:00
|
|
|
// CHECK-SANA-SANM: '-fsanitize=address' not allowed with '-fsanitize=memory'
|
|
|
|
|
2012-12-24 16:42:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANT-SANM
|
2012-12-05 21:37:12 +08:00
|
|
|
// CHECK-SANT-SANM: '-fsanitize=thread' not allowed with '-fsanitize=memory'
|
|
|
|
|
2012-12-24 16:42:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANM-SANT
|
2012-12-05 21:37:12 +08:00
|
|
|
// CHECK-SANM-SANT: '-fsanitize=thread' not allowed with '-fsanitize=memory'
|
|
|
|
|
2013-05-27 19:17:01 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,thread -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANT
|
|
|
|
// CHECK-SANL-SANT: '-fsanitize=leak' not allowed with '-fsanitize=thread'
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak,memory -pie -fno-rtti %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL-SANM
|
|
|
|
// CHECK-SANL-SANM: '-fsanitize=leak' not allowed with '-fsanitize=memory'
|
|
|
|
|
2012-12-24 16:42:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS
|
|
|
|
// CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins'
|
|
|
|
|
2013-01-16 19:34:36 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-EXTRA-TRACK-ORIGINS
|
|
|
|
// CHECK-NO-EXTRA-TRACK-ORIGINS-NOT: "-fsanitize-memory-track-origins"
|
|
|
|
|
2012-12-01 21:07:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address -fsanitize=alignment -fsanitize=vptr -fno-sanitize=vptr %s -### 2>&1
|
2012-12-01 09:02:45 +08:00
|
|
|
// OK
|
2012-11-29 01:34:24 +08:00
|
|
|
|
2012-12-24 16:42:34 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -pie %s -### 2>&1
|
|
|
|
// OK
|
|
|
|
|
2014-03-20 22:58:36 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=1 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-1
|
|
|
|
|
|
|
|
// CHECK-TRACK-ORIGINS-1: -fsanitize-memory-track-origins=1
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-sanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-track-origins=0 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-TRACK-ORIGINS
|
|
|
|
// CHECK-NO-TRACK-ORIGINS-NOT: sanitize-memory-track-origins
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=2 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-2
|
|
|
|
// CHECK-TRACK-ORIGINS-2: -fsanitize-memory-track-origins=2
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory -fsanitize-memory-track-origins=3 -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TRACK-ORIGINS-3
|
|
|
|
// CHECK-TRACK-ORIGINS-3: error: invalid value '3' in '-fsanitize-memory-track-origins=3'
|
2012-12-24 16:42:34 +08:00
|
|
|
|
2012-12-01 21:07:22 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=vptr -fno-sanitize=vptr -fsanitize=undefined,address %s -### 2>&1
|
2012-12-01 09:02:45 +08:00
|
|
|
// OK
|
2012-11-29 01:34:24 +08:00
|
|
|
|
2012-12-05 21:37:12 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-NO-PIE
|
2013-04-09 12:35:11 +08:00
|
|
|
// CHECK-TSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
|
|
|
|
// CHECK-TSAN-NO-PIE: "-pie"
|
2012-12-05 21:37:12 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NO-PIE
|
2013-04-09 12:35:11 +08:00
|
|
|
// CHECK-MSAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
|
|
|
|
// CHECK-MSAN-NO-PIE: "-pie"
|
2012-12-05 21:37:12 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target arm-linux-androideabi -fsanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-ASAN-NO-PIE
|
2013-04-09 12:35:11 +08:00
|
|
|
// CHECK-ANDROID-ASAN-NO-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pie-level" "2"
|
|
|
|
// CHECK-ANDROID-ASAN-NO-PIE: "-pie"
|
2012-12-31 04:53:28 +08:00
|
|
|
|
2013-08-09 18:56:42 +08:00
|
|
|
// RUN: %clang -target arm-linux-androideabi %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ANDROID-NO-ASAN
|
2014-01-28 14:30:35 +08:00
|
|
|
// CHECK-ANDROID-NO-ASAN: "-mrelocation-model" "pic"
|
2013-08-09 18:56:42 +08:00
|
|
|
|
2012-12-31 04:53:28 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu %s -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu %s -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu %s -fno-sanitize-recover -fsanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-RECOVER
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu %s -fsanitize-recover -fno-sanitize-recover -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-RECOVER
|
|
|
|
// CHECK-RECOVER-NOT: sanitize-recover
|
|
|
|
// CHECK-NO-RECOVER: "-fno-sanitize-recover"
|
2013-05-27 19:17:01 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=leak %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANL
|
|
|
|
// CHECK-SANL: "-fsanitize=leak"
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA
|
|
|
|
// CHECK-SANA-SANL-NO-SANA: "-fsanitize=leak"
|
2013-06-20 18:49:46 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN
|
|
|
|
// CHECK-MSAN: "-fno-assume-sane-operator-new"
|
2013-08-19 17:14:21 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -fsanitize=zzz %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-DIAG1
|
|
|
|
// CHECK-DIAG1: unsupported argument 'zzz' to option 'fsanitize='
|
|
|
|
// CHECK-DIAG1-NOT: unsupported argument 'zzz' to option 'fsanitize='
|
2013-11-02 02:16:25 +08:00
|
|
|
|
|
|
|
// RUN: %clang -target i686-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-X86
|
|
|
|
// CHECK-MSAN-X86: error: unsupported option '-fsanitize=memory' for target 'i686--linux-gnu'
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-DARWIN
|
|
|
|
// CHECK-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fno-sanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-NOMSAN-DARWIN
|
|
|
|
// CHECK-MSAN-NOMSAN-DARWIN-NOT: unsupported option
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=memory -fsanitize=thread,memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN-TSAN-MSAN-DARWIN
|
|
|
|
// CHECK-MSAN-TSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread,memory' for target 'x86_64-apple-darwin10'
|
|
|
|
// CHECK-MSAN-TSAN-MSAN-DARWIN-NOT: unsupported option
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=thread,memory -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-MSAN-MSAN-DARWIN
|
|
|
|
// CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=memory' for target 'x86_64-apple-darwin10'
|
|
|
|
// CHECK-TSAN-MSAN-MSAN-DARWIN: unsupported option '-fsanitize=thread' for target 'x86_64-apple-darwin10'
|
|
|
|
// CHECK-TSAN-MSAN-MSAN-DARWIN-NOT: unsupported option
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-DARWIN
|
|
|
|
// CHECK-FSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10'
|
|
|
|
|
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -fsanitize=function -fsanitize=undefined %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-FSAN-UBSAN-DARWIN
|
|
|
|
// CHECK-FSAN-UBSAN-DARWIN: unsupported option '-fsanitize=function' for target 'x86_64-apple-darwin10'
|