forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged master:183342c0a98 into amd-gfx:bd825eb42a4
Local branch amd-gfx bd825eb Merged master:def48b0e888 into amd-gfx:1fd38bfef96 Remote branch master 183342c [SCCP] Add another switch+phi test (NFC)
- Loading branch information
Showing
65 changed files
with
7,494 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,25 @@ | ||
// RUN: %clang_dfsan %s -o %t | ||
// RUN: DFSAN_OPTIONS=fast16labels=1 %run %t | ||
// RUN: DFSAN_OPTIONS=fast16labels=1 not %run %t dfsan_create_label 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=CREATE-LABEL | ||
// RUN: DFSAN_OPTIONS=fast16labels=1 not %run %t dfsan_get_label_info 2>&1 \ | ||
// RUN: | FileCheck %s --check-prefix=GET-LABEL-INFO | ||
// RUN: DFSAN_OPTIONS=fast16labels=1 not %run %t dfsan_has_label_with_desc \ | ||
// RUN: 2>&1 | FileCheck %s --check-prefix=HAS-LABEL-WITH-DESC | ||
// RUN: DFSAN_OPTIONS=fast16labels=1:dump_labels_at_exit=/dev/stdout not %run \ | ||
// RUN: %t 2>&1 | FileCheck %s --check-prefix=DUMP-LABELS | ||
// RUN: %clang_dfsan %s -o %t && DFSAN_OPTIONS=fast16labels=1 %run %t | ||
// | ||
// Tests DFSAN_OPTIONS=fast16labels=1 | ||
// | ||
#include <sanitizer/dfsan_interface.h> | ||
|
||
#include <assert.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
int foo(int a, int b) { | ||
return a + b; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
// Death tests for unsupported API usage. | ||
const char *command = (argc < 2) ? "" : argv[1]; | ||
fprintf(stderr, "Running with command %s\n", command); | ||
// CREATE-LABEL: FATAL: DataFlowSanitizer: dfsan_create_label is unsupported | ||
if (strcmp(command, "dfsan_create_label") == 0) | ||
dfsan_create_label("", NULL); | ||
// GET-LABEL-INFO: FATAL: DataFlowSanitizer: dfsan_get_label_info is unsupported | ||
if (strcmp(command, "dfsan_get_label_info") == 0) | ||
dfsan_get_label_info(1); | ||
// HAS-LABEL-WITH-DESC: FATAL: DataFlowSanitizer: dfsan_has_label_with_desc is unsupported | ||
if (strcmp(command, "dfsan_has_label_with_desc") == 0) | ||
dfsan_has_label_with_desc(1, ""); | ||
// DUMP-LABELS: FATAL: DataFlowSanitizer: dfsan_dump_labels is unsupported | ||
|
||
// Supported usage. | ||
int main() { | ||
int a = 10; | ||
int b = 20; | ||
dfsan_set_label(8, &a, sizeof(a)); | ||
dfsan_set_label(512, &b, sizeof(b)); | ||
int c = foo(a, b); | ||
fprintf(stderr, "A: 0x%x\n", dfsan_get_label(a)); | ||
fprintf(stderr, "B: 0x%x\n", dfsan_get_label(b)); | ||
printf("A: 0x%x\n", dfsan_get_label(a)); | ||
printf("B: 0x%x\n", dfsan_get_label(b)); | ||
dfsan_label l = dfsan_get_label(c); | ||
fprintf(stderr, "C: 0x%x\n", l); | ||
fprintf(stderr, "Testing l == 520\n"); | ||
printf("C: 0x%x\n", l); | ||
assert(l == 520); // OR of the other two labels. | ||
fprintf(stderr, "Testing dfsan_has_label(l, 8)\n"); | ||
assert(dfsan_has_label(l, 8)); | ||
fprintf(stderr, "Testing dfsan_has_label(l, 512)\n"); | ||
assert(dfsan_has_label(l, 512)); | ||
fprintf(stderr, "Testing !dfsan_has_label(l, 1)\n"); | ||
assert(!dfsan_has_label(l, 1)); | ||
fprintf(stderr, "returning...\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===-- Implementation of fmax function -----------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "src/__support/common.h" | ||
#include "utils/FPUtil/BasicOperations.h" | ||
|
||
namespace __llvm_libc { | ||
|
||
double LLVM_LIBC_ENTRYPOINT(fmax)(double x, double y) { | ||
return fputil::fmax(x, y); | ||
} | ||
|
||
} // namespace __llvm_libc |
Oops, something went wrong.